Auflistung der Links in widget ausgelagert und auf Index-Seite mit angezeigt

This commit is contained in:
mdn 2023-01-14 21:02:03 +01:00
parent 14a466e315
commit 2a1daf1f52
4 changed files with 36 additions and 16 deletions

View file

@ -19,4 +19,15 @@
{{ end }}
</div>
</div>
{{ end }}
{{ define "sidebar" }}
{{ if isset .Site.Author "linkdata" }}
{{ with (index .Site.Data .Site.Author.linkdata) }}
<div class="position-sticky">
{{- partial "widget/header.html" (dict "title" "Links") -}}
{{- partial "widget/links.html" . -}}
</div>
{{ end }}
{{ end }}
{{ end }}

View file

@ -0,0 +1,16 @@
<ul>
{{ range (where . "visible" 1) }}
<li>
{{ .name }}
<ul>
{{ range (where .urls "visible" 1) }}
<li>
<a href="{{ .url }}" target="{{- .target -}}" alt="{{- .description }}">{{ .name }}</a>
<br/>
{{ .description }}
</li>
{{ end }}
</ul>
</li>
{{ end }}
</ul>

View file

@ -1,18 +1,5 @@
{{ $dataName := .Get "data" }}
<ul>
{{ range (where (index .Site.Data (split $dataName "/")) "visible" 1) }}
<li>
{{ .name }}
<ul>
{{ range (where .urls "visible" 1) }}
<li>
<a href="{{ .url }}" target="{{- .target -}}" alt="{{- .description }}">{{ .name }}</a>
<br/>
{{ .description }}
</li>
{{ end }}
</ul>
</li>
{{ end }}
</ul>
{{ with (index .Site.Data (split $dataName "/")) }}
{{- partial "widget/links.html" . -}}
{{ end }}