diff options
Diffstat (limited to 'layouts')
-rw-r--r-- | layouts/404.html | 4 | ||||
-rw-r--r-- | layouts/_default/baseof.html | 4 | ||||
-rw-r--r-- | layouts/_default/rss.xml | 2 | ||||
-rw-r--r-- | layouts/_default/search.json.json | 1 | ||||
-rw-r--r-- | layouts/_default/single.html | 14 | ||||
-rw-r--r-- | layouts/_default/sitemap.xml | 57 | ||||
-rw-r--r-- | layouts/index.html | 13 | ||||
-rw-r--r-- | layouts/partials/footer.html | 6 | ||||
-rw-r--r-- | layouts/partials/head.html | 16 | ||||
-rw-r--r-- | layouts/partials/header.html | 2 | ||||
-rw-r--r-- | layouts/partials/table-of-contents.html | 9 |
11 files changed, 77 insertions, 51 deletions
diff --git a/layouts/404.html b/layouts/404.html index 9de2956..9b99da1 100644 --- a/layouts/404.html +++ b/layouts/404.html @@ -1,8 +1,8 @@ {{ define "main" }} <main> - <h1>{{ .Site.Params.notFound.title | default .Site.Data.default.notFound.title }}</h1> - <p>{{ .Site.Params.notFound.paragraph | default .Site.Data.default.notFound.paragraph }}</p> + <h1>{{ .Site.Params.notFound.title | emojify | default .Site.Data.default.notFound.title }}</h1> + <p>{{ .Site.Params.notFound.paragraph | emojify | default .Site.Data.default.notFound.paragraph }}</p> </main> {{ end }} diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html index b6b0682..fd10f53 100644 --- a/layouts/_default/baseof.html +++ b/layouts/_default/baseof.html @@ -4,7 +4,7 @@ Currently here to avoid certain priority issues... --> -{{- .Scratch.Set "imageProc" (dict "highRes" (.Site.Params.imageProc.highRes | default .Site.Data.default.imageProc.highRes) "mediumRes" (.Site.Params.imageProc.mediumRes | default .Site.Data.default.imageProc.mediumRes) "lowRes" (.Site.Params.imageProc.lowRes | default .Site.Data.default.imageProc.lowRes) "markupAutoResizeWidth" (.Site.Params.imageProc.markupAutoResizeWidth | default .Site.Data.default.imageProc.markupAutoResizeWidth)) }} +{{- .Scratch.Set "imageProc" (dict "highRes" (.Site.Params.imageProc.highRes | default .Site.Data.default.imageProc.highRes) "mediumRes" (.Site.Params.imageProc.mediumRes | default .Site.Data.default.imageProc.mediumRes) "lowRes" (.Site.Params.imageProc.lowRes | default .Site.Data.default.imageProc.lowRes) "markupAutoResizeWidth" (.Site.Params.imageProc.markupAutoResizeWidth | default .Site.Data.default.imageProc.markupAutoResizeWidth)) -}} <!DOCTYPE html> <html lang="{{ .Site.Language.Lang }}" data-mode="{{ if .Site.Params.Style.isDark }}dark{{ else }}light{{ end }}"> @@ -82,7 +82,7 @@ <!-- KaTeX --> {{ if or .Params.katex .Site.Params.katex .Params.math .Site.Params.math }} - {{ partial "katex.html" . }} + {{ partial "katex" . }} {{ end }} </body> diff --git a/layouts/_default/rss.xml b/layouts/_default/rss.xml index eb0f835..8d0c681 100644 --- a/layouts/_default/rss.xml +++ b/layouts/_default/rss.xml @@ -6,7 +6,7 @@ {{- else -}} {{- $pages = $pctx.Pages -}} {{- end -}} -{{- $pages = where $pages "Params.sitemapexclude" "ne" true -}} +{{- $pages = where $pages "Params.noindex" "ne" true -}} {{- $limit := .Site.Config.Services.RSS.Limit -}} {{- if ge $limit 1 -}} {{- $pages = $pages | first $limit -}} diff --git a/layouts/_default/search.json.json b/layouts/_default/search.json.json index 279aeb2..e401800 100644 --- a/layouts/_default/search.json.json +++ b/layouts/_default/search.json.json @@ -1,6 +1,7 @@ {{- $stopWords := or .Params.stopWords .Site.Params.Search.stopWords -}} {{- $pages := where .Site.RegularPages "Type" "in" .Site.Params.mainSections -}} +{{- $pages = where $pages "Params.noindex" "ne" true -}} {{- $lastIndex := (sub (len $pages) 1) -}} diff --git a/layouts/_default/single.html b/layouts/_default/single.html index 48c7aee..3b32bde 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -4,11 +4,7 @@ <article> <header> - <h1>{{ .Title }}</h1> - - {{ range .Data.Terms }} - {{ .Name }} - {{ end }} + <h1>{{ .Title | emojify }}</h1> {{ if or .Params.categories .Params.tags }} <section class="terms"> @@ -39,13 +35,7 @@ </header> - {{ if .Params.toc }} - <details class="toc" open> - <summary class="outline-dashed">{{ T "tableOfContents" }}</summary> - {{ .Page.TableOfContents }} - </details> - {{ end }} - + {{ partial "table-of-contents" . }} {{ partial "processed-content" . }} </article> diff --git a/layouts/_default/sitemap.xml b/layouts/_default/sitemap.xml index 8177b07..b42a7af 100644 --- a/layouts/_default/sitemap.xml +++ b/layouts/_default/sitemap.xml @@ -1,29 +1,42 @@ +{{- $pages := .RegularPages -}} +{{- $pages = where $pages "Params.sitemapexclude" "ne" true -}} {{ printf "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\" ?>" | safeHTML }} <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:xhtml="http://www.w3.org/1999/xhtml"> - {{ range .Site.RegularPages }} - {{ if not .Params.sitemapExclude }} - <url> - <loc>{{ .Permalink }}</loc> - - {{ if not .Lastmod.IsZero }} - <lastmod>{{ safeHTML ( .Lastmod.Format "2006-01-02T15:04:05-07:00" ) }}</lastmod> - {{ end }} - - {{ with .Sitemap.ChangeFreq }} - <changefreq>{{ . }}</changefreq> - {{ end }} - - {{ if ge .Sitemap.Priority 0.0 }} - <priority>{{ .Sitemap.Priority }}</priority> + {{ range $pages }} + + <url> + <loc>{{ .Permalink }}</loc> + + {{ if not .Lastmod.IsZero }} + <lastmod>{{ safeHTML ( .Lastmod.Format "2006-01-02T15:04:05-07:00" ) }}</lastmod> + {{ end }} + + {{ with .Sitemap.ChangeFreq }} + <changefreq>{{ . }}</changefreq> + {{ end }} + + {{ if ge .Sitemap.Priority 0.0 }} + <priority>{{ .Sitemap.Priority }}</priority> + {{ end }} + + {{ if .IsTranslated }} + {{ range .Translations }} + <xhtml:link + rel="alternate" + hreflang="{{ .Lang }}" + href="{{ .Permalink }}" + /> {{ end }} - {{ if .IsTranslated }} - {{ range .Translations }} - <xhtml:link rel="alternate" hreflang="{{ .Lang }}" href="{{ .Permalink }}" /> - {{ end }} - {{ end }} - </url> - {{ end }} + <xhtml:link + rel="alternate" + hreflang="{{ .Lang }}" + href="{{ .Permalink }}" + /> + {{ end }} + + </url> + {{ end }} </urlset>
\ No newline at end of file diff --git a/layouts/index.html b/layouts/index.html index dc92444..566e19d 100644 --- a/layouts/index.html +++ b/layouts/index.html @@ -6,9 +6,20 @@ {{ if .Content }} <article> - <h1>{{ .Title | emojify }}</h1> + + <header> + + <h1>{{ .Title | emojify }}</h1> + + {{ if .Params.cover }} + {{ partial "cover" . }} + {{ end }} + + </header> + {{ partial "table-of-contents" . }} {{ partial "processed-content" . }} + </article> {{ else }} diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html index 9ea8cee..b314f1b 100644 --- a/layouts/partials/footer.html +++ b/layouts/partials/footer.html @@ -1,8 +1,10 @@ <!-- Custom or default copyright --> -{{ if or (templates.Exists "partials/custom/copyright") (templates.Exists "partials/custom/copyright.html") }} +{{ if (templates.Exists "partials/custom/copyright.html") }} {{ partial "custom/copyright" . }} {{ else }} - <p>{{ .Site.Copyright | markdownify | emojify }}</p> + {{ with .Site.Copyright }} + <p>{{ . | markdownify | emojify }}</p> + {{ end }} {{ end }} <!-- diff --git a/layouts/partials/head.html b/layouts/partials/head.html index 7509980..d950a45 100644 --- a/layouts/partials/head.html +++ b/layouts/partials/head.html @@ -3,8 +3,8 @@ <meta name="generator" content="Hugo {{ hugo.Version }} -- gohugo.io / Color Your World -- gitlab.com/rmaguiar/hugo-theme-color-your-world"> <!-- I'm 99% sure there's a smarter way of doing it but whatever --> -{{ $currentTitle := (.Title | emojify) }} -{{ $mainTitle := .Params.mainTitle }} +{{ $currentTitle := .Title | emojify }} +{{ $mainTitle := .Params.mainTitle | emojify }} {{ $titleSeparator := .Site.Params.titleSeparator }} @@ -13,7 +13,7 @@ {{ if (eq .Kind "404") }} <!-- If 404 page --> - {{ $currentTitle = .Site.Params.notFound.title | default .Site.Data.default.notFound.title }} + {{ $currentTitle = .Site.Params.notFound.title | emojify | default .Site.Data.default.notFound.title }} {{ else if (eq .Kind "section") }} @@ -53,15 +53,15 @@ {{ else if and (.IsHome) (not .Content) }} <!-- If home page without content --> - {{ $currentTitle = (.Site.Title | emojify) }} + {{ $currentTitle = .Site.Title | emojify }} {{ end }} -{{ $currentDesc := (.Params.Description | emojify) }} +{{ $currentDesc := .Params.Description | emojify }} {{ if .IsHome }} - {{ $currentDesc = (.Site.Params.description | emojify) }} + {{ $currentDesc = .Site.Params.description | emojify }} {{ else if and (ne .Kind "taxonomy") (eq .Type "tags") (not .Params.description) }} {{ $currentDesc = (T "postsUnderTag" .) }} {{ else if and (ne .Kind "taxonomy") (eq .Type "categories") (not .Params.description) }} @@ -69,7 +69,7 @@ {{ else if eq .Kind "taxonomy" }} {{ $currentDesc = printf "%s %s." (T "pageContaining") ($currentTitle | lower) }} {{ else if (eq .Kind "404") }} - {{ $currentDesc = .Site.Params.notFound.description | default .Site.Data.default.notFound.description }} + {{ $currentDesc = .Site.Params.notFound.description | emojify | default .Site.Data.default.notFound.description }} {{ end }} @@ -126,7 +126,7 @@ <!-- If the user wants to add something (custom favicons, fonts, scripts, etc) --> -{{ if or (templates.Exists "partials/custom/head-append") (templates.Exists "partials/custom/head-append.html") }} +{{ if (templates.Exists "partials/custom/head-append.html") }} {{ partial "custom/head-append" . }} {{ end }} diff --git a/layouts/partials/header.html b/layouts/partials/header.html index 83e9cfc..8c148f8 100644 --- a/layouts/partials/header.html +++ b/layouts/partials/header.html @@ -1,5 +1,5 @@ <!-- Custom or default site title --> -{{ if or (templates.Exists "partials/custom/site-title") (templates.Exists "partials/custom/site-title.html") }} +{{ if (templates.Exists "partials/custom/site-title.html") }} {{ partial "custom/site-title" . }} {{ else }} <a href="{{ .Site.BaseURL | relLangURL }}">{{ .Site.Title }}</a> diff --git a/layouts/partials/table-of-contents.html b/layouts/partials/table-of-contents.html new file mode 100644 index 0000000..2ccd8cc --- /dev/null +++ b/layouts/partials/table-of-contents.html @@ -0,0 +1,9 @@ +{{ if .Params.toc }} + <details class="toc" open> + <summary class="outline-dashed"> + {{ T "tableOfContents" }} + </summary> + + {{ .Page.TableOfContents }} + </details> +{{ end }}
\ No newline at end of file |