diff options
-rw-r--r-- | layouts/_default/baseof.html | 5 | ||||
-rw-r--r-- | layouts/_default/list.html | 1 | ||||
-rw-r--r-- | layouts/_default/single.html | 7 | ||||
-rw-r--r-- | layouts/partials/head.html | 18 | ||||
-rw-r--r-- | layouts/partials/toc.html | 6 |
5 files changed, 30 insertions, 7 deletions
diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html index bd9f83d..f53932d 100644 --- a/layouts/_default/baseof.html +++ b/layouts/_default/baseof.html @@ -4,12 +4,9 @@ SPDX-FileCopyrightText: 2022 Ngô Ngọc Đức Huy <huyngo@disroot.org> SPDX-License-Identifier: MIT */}} + <!DOCTYPE html> -{{ with .Page.Params.Lang }} -<html lang="{{ . }}"> -{{ else }} <html lang="{{ .Page.Language.Lang }}"> -{{ end }} <head> {{ block "head" . }} {{ partial "head.html" . }} diff --git a/layouts/_default/list.html b/layouts/_default/list.html index 46310ad..9a4672e 100644 --- a/layouts/_default/list.html +++ b/layouts/_default/list.html @@ -9,6 +9,7 @@ SPDX-License-Identifier: MIT {{ .Content }} </section> {{ if in .Params.categories "book" }} + {{ partial "post-navigation-top.html" . }} <section class="toc"> {{ partial "toc.html" . }} </section> diff --git a/layouts/_default/single.html b/layouts/_default/single.html index 79b493d..a170823 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -7,7 +7,12 @@ SPDX-License-Identifier: MIT {{ define "main" }} <article> <header> - <h1>{{ trim .Title " " }}</h1> + <h1> + {{ trim .Title " " }} + {{ with .Params.chapterName }} + – {{ . }} + {{ end }} + </h1> {{ i18n "word count" . }} ({{ i18n "reading time" .ReadingTime }}) diff --git a/layouts/partials/head.html b/layouts/partials/head.html index 3857a99..cfacfb9 100644 --- a/layouts/partials/head.html +++ b/layouts/partials/head.html @@ -3,11 +3,27 @@ {{ $custom := resources.Get "css/custom.css" }} {{ $style := slice $readable $theme $custom | resources.Concat "css/style.css" | minify | fingerprint }} +{{ $fullTitle := .Title }} +{{ with .Params.chapterName }} + {{ $fullTitle = printf "%s – %s" $fullTitle . }} +{{ end }} + +{{ range .Ancestors }} +{{ if in .Params.categories "book" }} + {{ $fullTitle = printf "%s, %s" .Title $fullTitle }} +{{ end }} +{{ end }} + <meta charset="utf-8"> <meta name="HandheldFriendly" content="True"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="referrer" content="no-referrer-when-downgrade"> -<title>{{ if and (.Title) (not .IsHome) }}{{ .Title }} - {{ end }}{{ .Site.Title }}</title> +<title> + {{ if and (.Title) (not .IsHome) }} + {{ $fullTitle }} - + {{ end }} + {{ .Site.Title }} +</title> <meta name="description" content="{{ .Site.Params.Description }}"> <link rel="stylesheet" type="text/css" href="{{ $style.RelPermalink }}"> diff --git a/layouts/partials/toc.html b/layouts/partials/toc.html index f6af753..607e7f0 100644 --- a/layouts/partials/toc.html +++ b/layouts/partials/toc.html @@ -5,7 +5,11 @@ <ol> {{ range sort $chapters "Weight" }} <li> - <a href="{{ .RelPermalink }}">{{ trim .Title " " }}</a> + {{ $fullTitle := .Title }} + {{ with .Params.chapterName }} + {{ $fullTitle = printf "%s – %s" $fullTitle . }} + {{ end }} + <a href="{{ .RelPermalink }}">{{ trim $fullTitle " " }}</a> {{ partial "post-info.html" . }} {{ if .IsSection}} {{ partial "toc.html" . }} |