mirror of
https://github.com/alex-shpak/hugo-book.git
synced 2024-11-24 20:33:00 +00:00
Add BookHref, set explicit URL for the menu (#440)
This commit is contained in:
parent
faede5e749
commit
c2014a08a5
@ -15,7 +15,7 @@
|
|||||||
{{ template "book-page-link" (dict "Page" . "CurrentPage" $.CurrentPage) }}
|
{{ template "book-page-link" (dict "Page" . "CurrentPage" $.CurrentPage) }}
|
||||||
{{ template "book-section-children" (dict "Section" . "CurrentPage" $.CurrentPage) }}
|
{{ template "book-section-children" (dict "Section" . "CurrentPage" $.CurrentPage) }}
|
||||||
</li>
|
</li>
|
||||||
{{ else if and .IsPage .Content }}
|
{{ else if and .IsPage }}
|
||||||
<li>
|
<li>
|
||||||
{{ template "book-page-link" (dict "Page" . "CurrentPage" $.CurrentPage) }}
|
{{ template "book-page-link" (dict "Page" . "CurrentPage" $.CurrentPage) }}
|
||||||
</li>
|
</li>
|
||||||
@ -39,6 +39,10 @@
|
|||||||
<a href="{{ .Page.RelPermalink }}" class="{{ if $current }} active{{ end }}">
|
<a href="{{ .Page.RelPermalink }}" class="{{ if $current }} active{{ end }}">
|
||||||
{{- partial "docs/title" .Page -}}
|
{{- partial "docs/title" .Page -}}
|
||||||
</a>
|
</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 }}
|
{{ else }}
|
||||||
<span>{{- partial "docs/title" .Page -}}</span>
|
<span>{{- partial "docs/title" .Page -}}</span>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
Loading…
Reference in New Issue
Block a user