From 9487442d647dd452c2b39a60bef83a0bd543448f Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Thu, 5 Nov 2020 13:54:38 +0800 Subject: [PATCH] Make a few tweaks to the theme --- CHANGELOG.adoc | 11 ++++ README.adoc | 2 +- assets/css/prism.css | 8 ++- assets/scss/base.scss | 2 +- assets/scss/layout.scss | 7 --- assets/scss/main.scss | 6 --- config.toml | 4 ++ layouts/_default/list.html | 6 +-- layouts/_default/single.html | 90 ++++++++++++++++---------------- layouts/partials/footer.html | 24 ++++----- layouts/partials/head.html | 14 ++--- layouts/partials/header.html | 8 +-- layouts/partials/pagination.html | 80 ++++++++++++++-------------- 13 files changed, 131 insertions(+), 131 deletions(-) diff --git a/CHANGELOG.adoc b/CHANGELOG.adoc index 59cb12c..8c4dea2 100644 --- a/CHANGELOG.adoc +++ b/CHANGELOG.adoc @@ -17,6 +17,17 @@ and this project adheres to https://semver.org/spec/v2.0.0.html[Semantic Version +== [Unreleased] + +=== Fixed + +* Make a few tweaks with CSS. +* Formatting of files. +* Relative files in the contact links are now linked with `absLangURL` which is useful for linking web feeds. + + + + == [0.1.2] - 2020-11-04 === Fixed diff --git a/README.adoc b/README.adoc index 154e4d5..2e08ef2 100644 --- a/README.adoc +++ b/README.adoc @@ -143,7 +143,7 @@ paginate = 20 [module] [[module.imports]] - path = "github.com/foo-dogsquared/hugo-theme-contentful" + path = "github.com/foo-dogsquared/hugo-theme-more-contentful" [[module.imports]] path = "github.com/foo-dogsquared/hugo-web-feeds" diff --git a/assets/css/prism.css b/assets/css/prism.css index 8b2a7f1..81b7bc3 100644 --- a/assets/css/prism.css +++ b/assets/css/prism.css @@ -1,13 +1,11 @@ /** - * Dracula Theme originally by Zeno Rocha [@zenorocha] - * https://draculatheme.com/ - * - * Ported for PrismJS by Albert Vallverdu [@byverdu] + * This is a CSS stylesheet template for Prism in case you use that. + * This is based from a Prism CSS port by Albert Vallverdu [@byverdu]. */ code[class*="language-"], pre[class*="language-"] { - color: var(--base07); + color: var(--base05); background: none; font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace; text-align: left; diff --git a/assets/scss/base.scss b/assets/scss/base.scss index 7993755..871b585 100644 --- a/assets/scss/base.scss +++ b/assets/scss/base.scss @@ -59,7 +59,7 @@ a { } dd, li, p, td { - line-height: 1.5; + line-height: 1.45; } p { diff --git a/assets/scss/layout.scss b/assets/scss/layout.scss index e3ec343..8f940eb 100644 --- a/assets/scss/layout.scss +++ b/assets/scss/layout.scss @@ -1,10 +1,3 @@ -@for $i from 0 through 15 { - $hex: decToHex($i); - .base#{$hex} { - color: var(--base#{$hex}); - } -} - .list { display: inline-flex; flex-flow: row wrap; diff --git a/assets/scss/main.scss b/assets/scss/main.scss index e83b6be..e96b237 100644 --- a/assets/scss/main.scss +++ b/assets/scss/main.scss @@ -30,12 +30,6 @@ @return str-slice($hex, $first, $first) + str-slice($hex, $second, $second) } -@mixin content-separator { - content: " | "; - color: var(--base03); - margin: auto 0.5em; -} - @mixin header-link-hover-style { > *:hover { color: var(--base0C); diff --git a/config.toml b/config.toml index 555fa6a..fcaab0b 100644 --- a/config.toml +++ b/config.toml @@ -1,4 +1,8 @@ [module] + [module.hugoVersion] + extended = true + min = "0.74.0" + [[module.imports]] path = "github.com/foo-dogsquared/hugo-theme-contentful" [[module.imports]] diff --git a/layouts/_default/list.html b/layouts/_default/list.html index d8213e3..83f9ef8 100644 --- a/layouts/_default/list.html +++ b/layouts/_default/list.html @@ -6,13 +6,13 @@ Otherwise, we take the pages of a section. */ -}} {{- $pages := .Pages }} {{- if .IsHome }} -{{- $pages = where $.Site.RegularPages "Type" "in" $.Site.Params.mainSections }} + {{- $pages = where $.Site.RegularPages "Type" "in" $.Site.Params.mainSections }} {{- end }} {{- range (where (.Paginate $pages).Pages "Params.hidden" "!=" true) }}
-

{{ .Title }}

- {{ partial "partials/components/post-meta.html" . }} +

{{ .Title }}

+ {{ partial "partials/components/post-meta.html" . }}
{{- end }} diff --git a/layouts/_default/single.html b/layouts/_default/single.html index 0c1c9c0..54b741a 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -1,58 +1,58 @@ {{ define "main" }}
-
-

{{ .Title }}

-
- {{ partial "partials/components/post-meta.html" . }} +
+

{{ .Title }}

+
+ {{ partial "partials/components/post-meta.html" . }} - {{ $is_toc := cond (ne .Params.toc nil) .Params.toc $.Site.Params.toc }} - {{ if (and $is_toc (gt (countrunes .TableOfContents) 0)) }} - - {{ .TableOfContents }} -{{ end }} + {{ $is_toc := cond (ne .Params.toc nil) .Params.toc $.Site.Params.toc }} + {{ if (and $is_toc (gt (countrunes .TableOfContents) 0)) }} + + {{ .TableOfContents }} + {{ end }} -
+
{{ .Content }} -
+
-
-
{{ end }} diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html index 96dc508..9c8e189 100644 --- a/layouts/partials/footer.html +++ b/layouts/partials/footer.html @@ -5,12 +5,12 @@ {{ if $.Site.IsMultiLingual }} -

{{ i18n "multilingual" }}: - -{{ range $.Site.Languages }} - {{ with .LanguageName }}{{ . }}{{ else }}{{ .Lang }}{{ end }} -{{ end }} - +

{{ i18n "multilingual" }}: + + {{ range $.Site.Languages }} + {{ with .LanguageName }}{{ . }}{{ else }}{{ .Lang }}{{ end }} + {{ end }} +

{{ end }} @@ -24,12 +24,12 @@ {{ $links = sort $links "weight" "asc" }} {{- range $links -}}
  • - - {{- if $useImage }} - {{- partial "components/icon.html" (dict "id" .id "output" "icons/brand/%s.svg" "template" "templates/simple-icon.svg") }} - {{- else }} - {{- .name }} - {{- end }} + + {{- if $useImage }} + {{- partial "components/icon.html" (dict "id" .id "output" "icons/brand/%s.svg" "template" "templates/simple-icon.svg") }} + {{- else }} + {{- .name }} + {{- end }}
  • {{- end -}} diff --git a/layouts/partials/head.html b/layouts/partials/head.html index c14dba8..d1eb0ea 100644 --- a/layouts/partials/head.html +++ b/layouts/partials/head.html @@ -39,22 +39,22 @@ {{- /* Linking all of the output formats for discovery. */ -}} {{- range .OutputFormats }} -{{- printf "" .Rel .MediaType.Type .Permalink | safeHTML }} + {{- printf "" .Rel .MediaType.Type .Permalink | safeHTML }} {{- end }} {{- if hugo.IsProduction }} - {{ template "_internal/google_analytics_async.html" . }} - {{ template "_internal/disqus.html" . }} + {{ template "_internal/google_analytics_async.html" . }} + {{ template "_internal/disqus.html" . }} {{- end }} {{- /* Persistent theme. It's a very small script so there's little effect on perceived performance. */ -}} diff --git a/layouts/partials/header.html b/layouts/partials/header.html index e7bd707..ffef595 100644 --- a/layouts/partials/header.html +++ b/layouts/partials/header.html @@ -2,9 +2,9 @@ {{ $.Site.Title }} - + diff --git a/layouts/partials/pagination.html b/layouts/partials/pagination.html index 88fb348..d94f5df 100644 --- a/layouts/partials/pagination.html +++ b/layouts/partials/pagination.html @@ -14,52 +14,52 @@ {{- $ellipsed := false -}} {{- $shouldEllipse := false -}} {{- range $pag.Pagers -}} - {{ $minimumActivePage := sub $pag.PageNumber $activeNumberOfPages }} - {{ $maximumActivePage := add $pag.PageNumber $activeNumberOfPages }} + {{ $minimumActivePage := sub $pag.PageNumber $activeNumberOfPages }} + {{ $maximumActivePage := add $pag.PageNumber $activeNumberOfPages }} - {{- /* Make all of the given number of pages starting from both ends to be visible */ -}} - {{- $showNumber := or (le .PageNumber $minimumPage) (lt (sub .TotalPages .PageNumber) $minimumPage) -}} + {{- /* Make all of the given number of pages starting from both ends to be visible */ -}} + {{- $showNumber := or (le .PageNumber $minimumPage) (lt (sub .TotalPages .PageNumber) $minimumPage) -}} - {{- /* Make all of the given number of pages between the active page number visible */ -}} - {{- $showNumber := or $showNumber (and (gt .PageNumber (sub $pag.PageNumber $midpointPages)) (lt .PageNumber (add $pag.PageNumber $midpointPages))) -}} + {{- /* Make all of the given number of pages between the active page number visible */ -}} + {{- $showNumber := or $showNumber (and (gt .PageNumber (sub $pag.PageNumber $midpointPages)) (lt .PageNumber (add $pag.PageNumber $midpointPages))) -}} - {{- /* - Make all of the page number that is just before/after the minimum page threshold to be visible. - This is applied to those situations where there's only one number remaining before the end - */ -}} - {{ if eq .PageNumber (sub $minimumActivePage 1) }} - {{ $showNumber = or $showNumber (eq (sub $minimumActivePage $minimumPage) (add $pag.First.PageNumber 1)) }} - {{ else if eq .PageNumber (add $maximumActivePage 1) }} - {{ $showNumber = or $showNumber (eq (add $maximumActivePage 1) (sub $pag.Last.PageNumber $minimumPage)) }} - {{ end }} + {{- /* + Make all of the page number that is just before/after the minimum page threshold to be visible. + This is applied to those situations where there's only one number remaining before the end + */ -}} + {{ if eq .PageNumber (sub $minimumActivePage 1) }} + {{ $showNumber = or $showNumber (eq (sub $minimumActivePage $minimumPage) (add $pag.First.PageNumber 1)) }} + {{ else if eq .PageNumber (add $maximumActivePage 1) }} + {{ $showNumber = or $showNumber (eq (add $maximumActivePage 1) (sub $pag.Last.PageNumber $minimumPage)) }} + {{ end }} - {{- if $showNumber -}} - {{- $ellipsed = false -}} - {{- $shouldEllipse = false -}} - {{- else -}} - {{- $shouldEllipse = not $ellipsed -}} - {{- $ellipsed = true -}} - {{- end -}} - {{- if $showNumber }} -
  • + {{- if $showNumber -}} + {{- $ellipsed = false -}} + {{- $shouldEllipse = false -}} + {{- else -}} + {{- $shouldEllipse = not $ellipsed -}} + {{- $ellipsed = true -}} + {{- end -}} + {{- if $showNumber }} +
  • -
  • - {{- else if $shouldEllipse }} -
  • - -
  • - {{- end -}} + + {{- else if $shouldEllipse }} +
  • + +
  • + {{- end -}} {{- end }} {{ end }}