diff options
author | Yauhen Shulitski <jsnjack@gmail.com> | 2018-09-02 21:20:38 +0300 |
---|---|---|
committer | Yauhen Shulitski <jsnjack@gmail.com> | 2018-09-02 21:20:38 +0300 |
commit | 543412e41ec52d3cdc3cba542bd2fda8f617a289 (patch) | |
tree | c6bbf21d66e91c93cb209643e9826f036e8ebe8d | |
parent | 8b854d583d7d98649b701f3272295f106b148e9a (diff) |
Update layout and styles
-rw-r--r-- | .gitmodules | 3 | ||||
-rw-r--r-- | assets/changelog.scss | 83 | ||||
m--------- | assets/spectre | 0 | ||||
-rw-r--r-- | layouts/index.html | 48 | ||||
-rw-r--r-- | layouts/partials/footer.html | 2 | ||||
-rw-r--r-- | layouts/partials/head.html | 27 | ||||
-rw-r--r-- | layouts/partials/header.html | 0 | ||||
-rw-r--r-- | layouts/partials/pagination.html | 29 | ||||
-rw-r--r-- | layouts/shortcodes/tag.html | 3 | ||||
-rw-r--r-- | theme.toml | 2 |
10 files changed, 196 insertions, 1 deletions
diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..d8e3a2d --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "assets/spectre"] + path = assets/spectre + url = git@github.com:picturepan2/spectre.git diff --git a/assets/changelog.scss b/assets/changelog.scss new file mode 100644 index 0000000..ef4001e --- /dev/null +++ b/assets/changelog.scss @@ -0,0 +1,83 @@ +$tag-added: #32b643; +$tag-changed:#ffb700; +$tag-deprecated: #acb3c2; +$tag-removed: #2176ff; +$tag-fixed: #754668; +$tag-security: #e85600; + +// $primary-color: #e54747; + +// Variables and mixins +@import "spectre/src/variables"; +@import "spectre/src/mixins"; + +/*! Spectre.css v#{$version} | MIT License | github.com/picturepan2/spectre */ +// Reset and dependencies +@import "spectre/src/normalize"; +@import "spectre/src/base"; + +// Elements +@import "spectre/src/typography"; +@import "spectre/src/asian"; +@import "spectre/src/tables"; +@import "spectre/src/buttons"; +@import "spectre/src/forms"; +@import "spectre/src/labels"; +@import "spectre/src/codes"; +@import "spectre/src/media"; + +// Layout +@import "spectre/src/layout"; +@import "spectre/src/navbar"; + +// Components +@import "spectre/src/accordions"; +@import "spectre/src/avatars"; +@import "spectre/src/badges"; +@import "spectre/src/breadcrumbs"; +@import "spectre/src/bars"; +@import "spectre/src/cards"; +@import "spectre/src/chips"; +@import "spectre/src/dropdowns"; +@import "spectre/src/empty"; +@import "spectre/src/menus"; +@import "spectre/src/modals"; +@import "spectre/src/navs"; +@import "spectre/src/pagination"; +@import "spectre/src/panels"; +@import "spectre/src/popovers"; +@import "spectre/src/steps"; +@import "spectre/src/tabs"; +@import "spectre/src/tiles"; +@import "spectre/src/toasts"; +@import "spectre/src/tooltips"; + +// Utility classes +@import "spectre/src/animations"; +@import "spectre/src/utilities"; + +@import "spectre/src/timelines"; + + +.tag-added { + background: $tag-added; +} +.tag-changed { + background: $tag-changed; +} + +.tag-deprecated { + background: $tag-deprecated; +} + +.tag-removed { + background: $tag-removed; +} + +.tag-fixed { + background: $tag-fixed; +} + +.tag-security { + background: $tag-security; +} diff --git a/assets/spectre b/assets/spectre new file mode 160000 +Subproject c3f9c6fa422a0413672086ed305a2a91e5fb353 diff --git a/layouts/index.html b/layouts/index.html index e69de29..0f6a21a 100644 --- a/layouts/index.html +++ b/layouts/index.html @@ -0,0 +1,48 @@ +{{ partial "head.html" . }} +<div class="section text-center"> + <h1>{{ .Site.Title }}</h1> +</div> + +<div class="content"> + <div class="container grid-lg"> + <div class="columns"> + <div class="column col-10 col-sm-12 col-mx-auto text-left"> + {{ $paginator := .Paginate ( where .Pages.ByWeight.Reverse "Section" "released" ) }} + + {{ if eq $paginator.PageNumber 1 }} + <div class="section"> + {{ range where .Pages "Section" "experimental"}} + <div class="changes"> + {{ .Content }} + </div> + {{ end }} + </div> + <div class="divider"></div> + {{ end }} + + <div class="section timeline"> + {{ range $paginator.Pages }} + <div class="timeline-item"> + <div class="timeline-left"> + <div class="timeline-icon"></div> + </div> + <div class="changes timeline-content"> + <h4> + v{{ .Weight }} ({{ .Title }}) + </h4> + <div> + {{ .Content }} + </div> + </div> + </div> + {{ end }} + </div> + + <div class="section centered"> + {{ partial "pagination.html" . }} + </div> + </div> + </div> + </div> +</div> +{{ partial "footer.html" . }} diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html index e69de29..308b1d0 100644 --- a/layouts/partials/footer.html +++ b/layouts/partials/footer.html @@ -0,0 +1,2 @@ +</body> +</html> diff --git a/layouts/partials/head.html b/layouts/partials/head.html index e69de29..b49a28a 100644 --- a/layouts/partials/head.html +++ b/layouts/partials/head.html @@ -0,0 +1,27 @@ +<!DOCTYPE html> +<html xmlns="http://www.w3.org/1999/xhtml"{{with .Site.LanguageCode}} xml:lang="{{.}}" lang="{{.}}"{{end}}> +<head> + <link href="http://gmpg.org/xfn/11" rel="profile"> + <meta http-equiv="content-type" content="text/html; charset=utf-8"> + {{ .Hugo.Generator }} + + <!-- Enable responsiveness on mobile devices--> + <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1"> + + {{ if .IsHome -}} + <title>{{ .Site.Title }}</title> + {{- else -}} + <title>{{ .Title }} · {{ .Site.Title }}</title> + {{- end }} + + <!-- Icons --> + + <!-- RSS --> + <link href="{{ .RSSLink }}" rel="alternate" type="application/rss+xml" title="{{ .Site.Title }}" /> + + {{ $scss := resources.Get "changelog.scss" }} + {{ $style := $scss | resources.ToCSS | resources.Minify }} + <link rel="stylesheet" href="{{ $style.Permalink }}"> + +</head> +<body> diff --git a/layouts/partials/header.html b/layouts/partials/header.html deleted file mode 100644 index e69de29..0000000 --- a/layouts/partials/header.html +++ /dev/null diff --git a/layouts/partials/pagination.html b/layouts/partials/pagination.html new file mode 100644 index 0000000..e498cc7 --- /dev/null +++ b/layouts/partials/pagination.html @@ -0,0 +1,29 @@ +{{ $pag := $.Paginator }} +{{ if gt $pag.TotalPages 1 }} +<ul class="pagination"> + <li class="page-item{{ if not $pag.HasPrev }} disabled{{ end }}"> + <a href="{{ if $pag.HasPrev }}{{ $pag.Prev.URL }}{{ end }}" class="page-link" aria-label="Previous"><span aria-hidden="true">Prev</span></a> + </li> + {{ $.Scratch.Set "__paginator.ellipsed" false }} + {{ range $pag.Pagers }} + {{ $right := sub .TotalPages .PageNumber }} + {{ $showNumber := or (le .PageNumber 3) (eq $right 0) }} + {{ $showNumber := or $showNumber (and (gt .PageNumber (sub $pag.PageNumber 2)) (lt .PageNumber (add $pag.PageNumber 2))) }} + {{ if $showNumber }} + {{ $.Scratch.Set "__paginator.ellipsed" false }} + {{ $.Scratch.Set "__paginator.shouldEllipse" false }} + {{ else }} + {{ $.Scratch.Set "__paginator.shouldEllipse" (not ($.Scratch.Get "__paginator.ellipsed") ) }} + {{ $.Scratch.Set "__paginator.ellipsed" true }} + {{ end }} + {{ if $showNumber }} + <li class="page-item{{ if eq . $pag }} active{{ end }}"><a class="page-link" href="{{ .URL }}">{{ .PageNumber }}</a></li> + {{ else if ($.Scratch.Get "__paginator.shouldEllipse") }} + <li class="page-item disabled"><span aria-hidden="true"> … </span></li> + {{ end }} + {{ end }} + <li class="page-item{{ if not $pag.HasNext }} disabled{{ end }}"> + <a href="{{ if $pag.HasNext }}{{ $pag.Next.URL }}{{ end }}" class="page-link" aria-label="Next"><span aria-hidden="true">Next</span></a> + </li> +</ul> +{{ end }} diff --git a/layouts/shortcodes/tag.html b/layouts/shortcodes/tag.html new file mode 100644 index 0000000..3119603 --- /dev/null +++ b/layouts/shortcodes/tag.html @@ -0,0 +1,3 @@ +{{ with .Get 0 }} + <span class="label label-rounded text-light text-capitalize tag-{{ . }}">{{ . }}</span> +{{ end }} @@ -6,7 +6,7 @@ license = "MIT" licenselink = "https://github.com/surfly/hugo-changelog-theme/blob/master/LICENSE" description = "Theme to display a changelog" homepage = "https://github.com/surfly/hugo-changelog-theme" -tags = ["chnagelog"] +tags = ["changelog"] features = [] min_version = "0.41" |