Add experimental icons support in menus, move icons to assets folder

This commit is contained in:
Alex Shpak
2025-09-22 23:47:25 +02:00
parent 69fb3210e8
commit 6ba59e191d
23 changed files with 79 additions and 63 deletions
+15 -5
View File
@@ -31,19 +31,29 @@
{{ 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">
<a {{ if .Page.Content }}href="{{ .Page.RelPermalink }}"{{ else }}role="button"{{ end }} class="flex-auto {{ if $current }}active{{ end }}">
{{- partial "docs/title" .Page -}}
<a {{ if .Page.Content }}href="{{ .Page.RelPermalink }}"{{ else }}role="button"{{ end }} class="{{ if $current }}active{{ end }}">
{{ template "book-icon-title" .Page -}}
</a>
<img src="{{ partial "docs/icon" "chevron-right" }}" class="book-icon" />
</label>
{{ else if .Page.Params.BookHref }}
<a href="{{ .Page.Params.BookHref }}" class="{{ if $current }}active{{ end }}" target="_blank" rel="noopener">
{{- partial "docs/title" .Page -}}
{{ template "book-icon-title" .Page -}}
</a>
{{ else if .Page.Content }}
<a href="{{ .Page.RelPermalink }}" class="{{ if $current }}active{{ end }}">
{{- partial "docs/title" .Page -}}
{{ template "book-icon-title" .Page -}}
</a>
{{ else }}
<span>{{- partial "docs/title" .Page -}}</span>
<a>
{{ template "book-icon-title" .Page -}}
</a>
{{ end }}
{{ end }}
{{ define "book-icon-title" }}
{{- with .Page.Params.BookIcon -}}
<img src="{{ partial "docs/icon" . }}" class="book-icon" />
{{- end -}}
{{- partial "docs/title" .Page -}}
{{ end }}