aboutsummaryrefslogtreecommitdiff
path: root/layouts
diff options
context:
space:
mode:
authorAlex Shpak <alex-shpak@users.noreply.github.com>2022-04-26 13:14:22 +0200
committerAlex Shpak <alex-shpak@users.noreply.github.com>2022-04-26 13:14:22 +0200
commit1852b16d938e978409b9066b5fa2bf27b1a0f496 (patch)
tree9941031b9d837f2bf7d7ecec6679e30bbfab3076 /layouts
parentc2014a08a534ef6b55505e719a68ccce88cb3cdb (diff)
#440L Adjust bookHref, check .Content again, add redirect
Diffstat (limited to 'layouts')
-rw-r--r--layouts/partials/docs/html-head.html4
-rw-r--r--layouts/partials/docs/menu-filetree.html12
2 files changed, 10 insertions, 6 deletions
diff --git a/layouts/partials/docs/html-head.html b/layouts/partials/docs/html-head.html
index ee855f6..b22c610 100644
--- a/layouts/partials/docs/html-head.html
+++ b/layouts/partials/docs/html-head.html
@@ -4,6 +4,10 @@
<meta name="theme-color" content="#FFFFFF">
<meta name="color-scheme" content="light dark">
+{{- with .Page.Params.BookHref -}}
+ <meta http-equiv="Refresh" content="0; url='{{ . }}'" />
+{{- end -}}
+
{{- template "_internal/opengraph.html" . -}}
<title>{{ partial "docs/html-head-title" . }}</title>
diff --git a/layouts/partials/docs/menu-filetree.html b/layouts/partials/docs/menu-filetree.html
index 8384f0f..edb150c 100644
--- a/layouts/partials/docs/menu-filetree.html
+++ b/layouts/partials/docs/menu-filetree.html
@@ -15,7 +15,7 @@
{{ template "book-page-link" (dict "Page" . "CurrentPage" $.CurrentPage) }}
{{ template "book-section-children" (dict "Section" . "CurrentPage" $.CurrentPage) }}
</li>
- {{ else if and .IsPage }}
+ {{ else if and .IsPage .Content }}
<li>
{{ template "book-page-link" (dict "Page" . "CurrentPage" $.CurrentPage) }}
</li>
@@ -28,19 +28,19 @@
{{ $current := eq .CurrentPage .Page }}
{{ $ancestor := .Page.IsAncestor .CurrentPage }}
- {{ if .Page.Params.bookCollapseSection }}
+ {{ if .Page.Params.BookCollapseSection }}
<input type="checkbox" id="section-{{ md5 .Page }}" class="toggle" {{ if or $current $ancestor }}checked{{ end }} />
<label for="section-{{ md5 .Page }}" class="flex justify-between">
<a {{ if .Page.Content }}href="{{ .Page.RelPermalink }}"{{ else }}role="button"{{ end }} class="{{ if $current }}active{{ end }}">
{{- partial "docs/title" .Page -}}
</a>
</label>
- {{ else if .Page.Content }}
- <a href="{{ .Page.RelPermalink }}" class="{{ if $current }} active{{ end }}">
+ {{ else if .Page.Params.BookHref }}
+ <a href="{{ .Page.Params.BookHref }}" class="{{ if $current }}active{{ end }}" target="_blank" rel="noopener">
{{- partial "docs/title" .Page -}}
</a>
- {{ else if .Page.Params.bookHref }}
- <a href="{{ .Page.Params.bookHref }}" role="button" class="{{ if $current }} active{{ end }}" target="_blank" rel="noopener">
+ {{ else if .Page.Content }}
+ <a href="{{ .Page.RelPermalink }}" class="{{ if $current }}active{{ end }}">
{{- partial "docs/title" .Page -}}
</a>
{{ else }}