mirror of
https://github.com/McShelby/hugo-theme-relearn.git
synced 2025-02-17 09:10:08 +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>
|
||||||
|
@ -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,9 +6,9 @@
|
||||||
{{- $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:
|
|
||||||
// https://github.com/gohugoio/hugo/blob/145b3fcce35fbac25c7033c91c1b7ae6d1179da8/transform/urlreplacers/absurlreplacer.go#L72
|
|
||||||
var index_url={{ "index.json" | relLangURL }};
|
var index_url={{ "index.json" | relLangURL }};
|
||||||
var root_url="/";
|
var root_url="/";
|
||||||
var baseUri=root_url.replace(/\/$/, '');
|
var baseUri=root_url.replace(/\/$/, '');
|
||||||
|
|
Loading…
Add table
Reference in a new issue