mirror of
https://github.com/McShelby/hugo-theme-relearn.git
synced 2024-11-27 01:33:04 +00:00
theme: further wildspace
menu and search
This commit is contained in:
parent
8ebff4fb0a
commit
1ad20bd8b2
2 changed files with 13 additions and 23 deletions
|
@ -37,9 +37,7 @@
|
||||||
<h3>{{ if not $disableShortcutsTitle }}{{ T "Shortcuts-Title" }}{{ end }}</h3>
|
<h3>{{ if not $disableShortcutsTitle }}{{ T "Shortcuts-Title" }}{{ end }}</h3>
|
||||||
<ul>
|
<ul>
|
||||||
{{- range sort . "Weight" }}
|
{{- range sort . "Weight" }}
|
||||||
<li>
|
<li>{{ .Pre }}<a class="padding" href="{{ .URL | absLangURL }}">{{ safeHTML .Name }}</a>{{ .Post }}</li>
|
||||||
{{ .Pre }}<a class="padding" href="{{ .URL | absLangURL }}">{{ safeHTML .Name }}</a>{{ .Post }}
|
|
||||||
</li>
|
|
||||||
{{- end }}
|
{{- end }}
|
||||||
</ul>
|
</ul>
|
||||||
</section>
|
</section>
|
||||||
|
@ -75,7 +73,7 @@
|
||||||
width="255px" height="255px" viewBox="0 0 255 255" style="enable-background:new 0 0 255 255;" xml:space="preserve">
|
width="255px" height="255px" viewBox="0 0 255 255" style="enable-background:new 0 0 255 255;" xml:space="preserve">
|
||||||
<g>
|
<g>
|
||||||
<g id="arrow-drop-down">
|
<g id="arrow-drop-down">
|
||||||
<polygon points="0,63.75 127.5,191.25 255,63.75 " />
|
<polygon points="0,63.75 127.5,191.25 255,63.75" />
|
||||||
</g>
|
</g>
|
||||||
</g>
|
</g>
|
||||||
</svg>
|
</svg>
|
||||||
|
@ -107,12 +105,9 @@
|
||||||
{{- else if .IsSection }}
|
{{- else if .IsSection }}
|
||||||
{{- safeHTML .Params.head }}
|
{{- safeHTML .Params.head }}
|
||||||
{{- $currentAlwaysopen := .Params.alwaysopen | default $alwaysopen }}
|
{{- $currentAlwaysopen := .Params.alwaysopen | default $alwaysopen }}
|
||||||
<li data-nav-id="{{.RelPermalink}}" title="{{.Title}}" class="dd-item{{if eq .File.UniqueID $currentFileUniqueID}} active{{end}}{{if .IsAncestor $currentNode }} parent{{end}}{{if $currentAlwaysopen}} alwaysopen{{end}}">
|
<li data-nav-id="{{.RelPermalink}}" title="{{.Title}}" class="dd-item{{if eq .File.UniqueID $currentFileUniqueID}} active{{end}}{{if .IsAncestor $currentNode }} parent{{end}}{{if $currentAlwaysopen}} alwaysopen{{end}}"><a href="{{.RelPermalink}}">
|
||||||
<a href="{{.RelPermalink}}">
|
{{- partial "menu-pre.html" . }}{{ or .Params.menuTitle .LinkTitle .Title }}{{ partial "menu-post.html" . }}
|
||||||
{{ partial "menu-pre.html" . }}{{ or .Params.menuTitle .LinkTitle .Title }}{{ partial "menu-post.html" . }}
|
{{- if $showvisitedlinks }}<i class="fas fa-check read-icon"></i>{{ end }}</a><ul>
|
||||||
{{ if $showvisitedlinks }}<i class="fas fa-check read-icon"></i>{{ end }}
|
|
||||||
</a>
|
|
||||||
<ul>
|
|
||||||
{{- $currentNode.Scratch.Set "pages" .Pages }}
|
{{- $currentNode.Scratch.Set "pages" .Pages }}
|
||||||
{{- if .Sections}}
|
{{- if .Sections}}
|
||||||
{{- $currentNode.Scratch.Set "pages" (.Pages | union .Sections) }}
|
{{- $currentNode.Scratch.Set "pages" (.Pages | union .Sections) }}
|
||||||
|
@ -126,16 +121,11 @@
|
||||||
{{- range $pages.ByWeight }}
|
{{- range $pages.ByWeight }}
|
||||||
{{- template "section-tree-nav" dict "sect" . "currentnode" $currentNode "showvisitedlinks" $showvisitedlinks "alwaysopen" true}}
|
{{- template "section-tree-nav" dict "sect" . "currentnode" $currentNode "showvisitedlinks" $showvisitedlinks "alwaysopen" true}}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- end }}
|
{{- end }}</ul></li>
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
{{- else }}
|
{{- else }}
|
||||||
<li data-nav-id="{{.RelPermalink}}" title="{{.Title}}" class="dd-item{{if eq .File.UniqueID $currentFileUniqueID}} active{{end}}">
|
<li data-nav-id="{{.RelPermalink}}" title="{{.Title}}" class="dd-item{{if eq .File.UniqueID $currentFileUniqueID}} active{{end}}"><a href="{{.RelPermalink}}">
|
||||||
<a href="{{.RelPermalink}}">
|
{{- partial "menu-pre.html" . }}{{ or .Params.menuTitle .LinkTitle .Title }}{{ partial "menu-post.html" . }}
|
||||||
{{ partial "menu-pre.html" . }}{{ or .Params.menuTitle .LinkTitle .Title }}{{ partial "menu-post.html" . }}
|
{{- if $showvisitedlinks }}<i class="fas fa-check read-icon"></i>{{ end }}</a></li>
|
||||||
{{ if $showvisitedlinks }}<i class="fas fa-check read-icon"></i>{{ end }}
|
|
||||||
</a>
|
|
||||||
</li>
|
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- end }}
|
{{- end }}
|
|
@ -6,11 +6,11 @@
|
||||||
{{- $assetBusting := not .Site.Params.disableAssetsBusting }}
|
{{- $assetBusting := not .Site.Params.disableAssetsBusting }}
|
||||||
<script src="{{"js/lunr.min.js" | relURL}}{{ if $assetBusting }}?{{ now.Unix }}{{ end }}"></script>
|
<script src="{{"js/lunr.min.js" | relURL}}{{ if $assetBusting }}?{{ now.Unix }}{{ end }}"></script>
|
||||||
<script src="{{"js/auto-complete.js" | relURL}}{{ if $assetBusting }}?{{ now.Unix }}{{ end }}"></script>
|
<script src="{{"js/auto-complete.js" | relURL}}{{ if $assetBusting }}?{{ now.Unix }}{{ end }}"></script>
|
||||||
|
{{ "<!-- hack to let hugo tell us how to get to the root when using relativeURLs, it needs to be called *url= for it to do its magic: -->" | safeHTML }}
|
||||||
|
{{ "<!-- https://github.com/gohugoio/hugo/blob/145b3fcce35fbac25c7033c91c1b7ae6d1179da8/transform/urlreplacers/absurlreplacer.go#L72 -->" | safeHTML }}
|
||||||
<script>
|
<script>
|
||||||
// hack to let hugo tell us how to get to the root when using relativeURLs, it needs to be called *url= for it to do its magic:
|
var index_url={{ "index.json" | relLangURL }};
|
||||||
// https://github.com/gohugoio/hugo/blob/145b3fcce35fbac25c7033c91c1b7ae6d1179da8/transform/urlreplacers/absurlreplacer.go#L72
|
|
||||||
var index_url={{"index.json" | relLangURL}};
|
|
||||||
var root_url="/";
|
var root_url="/";
|
||||||
var baseUri=root_url.replace(/\/$/, '');
|
var baseUri=root_url.replace(/\/$/, '');
|
||||||
</script>
|
</script>
|
||||||
<script src="{{"js/search.js" | relURL}}{{ if $assetBusting }}?{{ now.Unix }}{{ end }}"></script>
|
<script src="{{ "js/search.js" | relURL }}{{ if $assetBusting }}?{{ now.Unix }}{{ end }}"></script>
|
Loading…
Reference in a new issue