diff --git a/layouts/blog/single.html b/layouts/blog/single.html index bf1793b..b146e60 100644 --- a/layouts/blog/single.html +++ b/layouts/blog/single.html @@ -27,7 +27,7 @@ {{ partial "components/last-updated.html" . }} {{ .Scratch.Set "reversePagination" true }} - {{ partial "pager.html" . }} + {{ partial "components/pager.html" . }} diff --git a/layouts/docs/list.html b/layouts/docs/list.html index ae0bd28..78f6311 100644 --- a/layouts/docs/list.html +++ b/layouts/docs/list.html @@ -10,7 +10,7 @@ {{ .Content }}
- {{ partial "pager.html" . }} + {{ partial "components/pager.html" . }} diff --git a/layouts/docs/single.html b/layouts/docs/single.html index 6aca8ed..fb651e8 100644 --- a/layouts/docs/single.html +++ b/layouts/docs/single.html @@ -10,7 +10,7 @@ {{ .Content }} {{ partial "components/last-updated.html" . }} - {{ partial "pager.html" . }} + {{ partial "components/pager.html" . }} diff --git a/layouts/partials/pager.html b/layouts/partials/components/pager.html similarity index 100% rename from layouts/partials/pager.html rename to layouts/partials/components/pager.html diff --git a/layouts/partials/custom/head-end.html b/layouts/partials/custom/head-end.html new file mode 100644 index 0000000..e69de29 diff --git a/layouts/partials/favicons.html b/layouts/partials/favicons.html new file mode 100644 index 0000000..c9a6749 --- /dev/null +++ b/layouts/partials/favicons.html @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/layouts/partials/head-css.html b/layouts/partials/head-css.html new file mode 100644 index 0000000..8f33cc4 --- /dev/null +++ b/layouts/partials/head-css.html @@ -0,0 +1,10 @@ +{{ $options := dict "inlineImports" true }} +{{ $styles := resources.Get "css/styles.css" }} +{{ $styles = $styles | resources.PostCSS $options }} +{{ if not hugo.IsProduction }} + +{{ else }} + {{ $styles = $styles | minify | fingerprint | resources.PostProcess }} + + +{{ end }} diff --git a/layouts/partials/head.html b/layouts/partials/head.html index 2a3713e..ff5f5b2 100644 --- a/layouts/partials/head.html +++ b/layouts/partials/head.html @@ -1,18 +1,18 @@ - + + {{ partialCached "favicons.html" . }} - {{ .Title }} + {{- if .IsHome -}} + {{ .Site.Title -}} + {{ else -}} + {{ with .Title }}{{ . }} – {{ end -}} + {{ .Site.Title -}} + {{ end -}} - - {{ $options := dict "inlineImports" true }} - {{ $styles := resources.Get "css/styles.css" }} - {{ $styles = $styles | resources.PostCSS $options }} - {{ if hugo.IsProduction }} - {{ $styles = $styles | minify | fingerprint | resources.PostProcess }} - {{ end }} - - + + {{ partial "opengraph.html" . }} + {{ partial "head-css.html" . }} + + {{ partial "custom/head-end.html" . }} diff --git a/layouts/partials/opengraph.html b/layouts/partials/opengraph.html new file mode 100644 index 0000000..aa5dc5b --- /dev/null +++ b/layouts/partials/opengraph.html @@ -0,0 +1,31 @@ +{{/* From https://github.com/gohugoio/gohugoioTheme/blob/master/layouts/partials/opengraph/opengraph.html */}} + + + + + + +{{- with $.Params.images -}} +{{- range first 6 . }}{{ end -}} +{{- else -}} +{{- $featured := "" }} +{{- with $featured -}} + +{{- else -}} +{{- with $.Site.Params.images }}{{ end -}} +{{- end -}} +{{- end -}} + +{{- if .IsPage }} +{{- $iso8601 := "2006-01-02T15:04:05-07:00" -}} + +{{ with .PublishDate }}{{ end }} +{{ with .Lastmod }}{{ end }} +{{- end -}} + +{{- with .Params.audio }}{{ end }} +{{- with .Params.locale }}{{ end }} +{{- with .Site.Params.title }}{{ end }} +{{- with .Params.videos }}{{- range . }} + +{{ end }}{{ end }} diff --git a/layouts/partials/sidebar.html b/layouts/partials/sidebar.html index 3991268..8567bca 100644 --- a/layouts/partials/sidebar.html +++ b/layouts/partials/sidebar.html @@ -1,12 +1,13 @@ {{ $context := .context }} {{ $disableSidebar := .disableSidebar | default false }} +{{ $sidebarClass := cond $disableSidebar "md:hidden xl:block" "md:sticky" }} {{ $navRoot := cond (eq site.Home.Type "docs") site.Home $context.FirstSection }} {{ $navPages := union $navRoot.RegularPages $navRoot.Sections }} {{ $pageURL := $context.RelPermalink }} -