Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/alex-shpak/hugo-book.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHorea Christian <horea.christ@yandex.com>2022-04-26 14:10:39 +0300
committerGitHub <noreply@github.com>2022-04-26 14:10:39 +0300
commitc2014a08a534ef6b55505e719a68ccce88cb3cdb (patch)
tree72ec864cb1534f35739fb23cd355870b8e3ecf23
parentfaede5e7496c5d5d52ce7458e093c4e8121cca6e (diff)
Add BookHref, set explicit URL for the menu (#440)
-rw-r--r--layouts/partials/docs/menu-filetree.html6
1 files changed, 5 insertions, 1 deletions
diff --git a/layouts/partials/docs/menu-filetree.html b/layouts/partials/docs/menu-filetree.html
index dd61af7..8384f0f 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 .Content }}
+ {{ else if and .IsPage }}
<li>
{{ template "book-page-link" (dict "Page" . "CurrentPage" $.CurrentPage) }}
</li>
@@ -39,6 +39,10 @@
<a href="{{ .Page.RelPermalink }}" class="{{ if $current }} active{{ end }}">
{{- 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">
+ {{- partial "docs/title" .Page -}}
+ </a>
{{ else }}
<span>{{- partial "docs/title" .Page -}}</span>
{{ end }}