diff options
author | zilcH40 <wlh233@live.com> | 2022-09-14 19:21:52 +0300 |
---|---|---|
committer | zilcH40 <wlh233@live.com> | 2022-09-14 19:21:52 +0300 |
commit | 84a7aca340d301ea15700035d5a611a0ad9207d9 (patch) | |
tree | c4c645fad4b9f25145a939c56b0f9eade0bae7b3 /layouts | |
parent | c6535284e9a632d58670f26a4e7689c73e868a8c (diff) |
fix small bugs
- revert wrong toc logic in last commit
- fix display extra character in title when subtitle is not set
- fix unnecessary hover effect of fake button on navbar
Diffstat (limited to 'layouts')
-rw-r--r-- | layouts/_default/term.html | 2 | ||||
-rw-r--r-- | layouts/partials/head.html | 4 | ||||
-rw-r--r-- | layouts/partials/post.html | 2 |
3 files changed, 4 insertions, 4 deletions
diff --git a/layouts/_default/term.html b/layouts/_default/term.html index 94de3c4..d55f674 100644 --- a/layouts/_default/term.html +++ b/layouts/_default/term.html @@ -22,7 +22,7 @@ </nav> {{ end }} <div class="post-lists"> - {{ $paginator := .Paginate (where .Data.Pages "Type" "post") }} + {{ $paginator := .Paginate (where .Data.Pages "Type" "post") (.Site.Params.termPaginate | default 10) }} {{ range $paginator.Pages }} <div class="box post-box"> <div class="post-box-title"> diff --git a/layouts/partials/head.html b/layouts/partials/head.html index be8e90f..c1b9d50 100644 --- a/layouts/partials/head.html +++ b/layouts/partials/head.html @@ -8,8 +8,8 @@ <meta name="theme-color" content="{{.Site.Params.primaryColor}}"> {{- end -}} {{- if .IsHome -}} - <title>{{ .Site.Title }} | {{ .Site.Params.subtitle }}</title> - <meta property="og:title" content="{{ .Site.Title }} | {{ .Site.Params.subtitle }}"> + <title>{{ .Site.Title }} {{- if .Site.Params.subtitle }} | {{ .Site.Params.subtitle }} {{- end -}}</title> + <meta property="og:title" content="{{ .Site.Title }} {{- if .Site.Params.subtitle }} | {{ .Site.Params.subtitle }} {{- end -}}"> <meta property="og:type" content="website"> {{ if .Site.Params.keywords }} <meta name="keywords" content="{{.Site.Params.keywords}}"> diff --git a/layouts/partials/post.html b/layouts/partials/post.html index 0d27aee..63c9d7c 100644 --- a/layouts/partials/post.html +++ b/layouts/partials/post.html @@ -1,5 +1,5 @@ {{ partial "post-header.html" . }} -{{- $setToc := or .Params.toc .Site.Params.toc -}} +{{- $setToc := or .Params.toc (and .Site.Params.toc (ne .Params.toc false)) -}} {{- $headers := findRE "<h[1-3].*?>(.|\n])+?</h[1-3]>" .Content -}} {{- $hasToc := ge (len $headers) 1 -}} {{- $showToc := and $setToc $hasToc -}} |