summaryrefslogtreecommitdiff
path: root/layouts/shortcodes/links.html
diff options
context:
space:
mode:
Diffstat (limited to 'layouts/shortcodes/links.html')
-rw-r--r--layouts/shortcodes/links.html45
1 files changed, 45 insertions, 0 deletions
diff --git a/layouts/shortcodes/links.html b/layouts/shortcodes/links.html
new file mode 100644
index 0000000..5acde5d
--- /dev/null
+++ b/layouts/shortcodes/links.html
@@ -0,0 +1,45 @@
+{{- $caption := .Inner }}
+{{ $lastLetter := "Dupa" }}
+{{ with resources.Get "more/links.yml"}}
+{{ with . | transform.Unmarshal }}
+<table class="links">
+
+ {{ range (sort .links "Title") }}
+ {{ $letter := slicestr .Title 0 1 }}
+ {{ if not (eq $letter $lastLetter) }}
+ <tr>
+ <td colspan="2">
+ <hr>
+ <h2>{{ $letter}}</h2>
+ </td>
+ </tr>
+ {{ end }}
+{{ $lastLetter = $letter }}
+ <tr>
+ <td class="button">
+ {{ if .Button }}
+ <a href="{{.Url}}">
+ {{- $path := printf "webbuttons_31/%s" .Button}}
+ {{- $img := resources.Get $path }}
+ <img
+ loading="lazy"
+ class="webbutton"
+ alt="{{ .Name }}"
+ src="{{ $img.Permalink }}"
+ width="{{ $img.Width }}"
+ height="{{ $img.Height }}">
+ </a>
+ {{ end }}
+ </td>
+ <td style="padding-bottom: 10px">
+ <a href="{{.Url}}">
+ <b>{{ .Title }}</b><br>
+ {{ .Description }}
+ </a>
+ </td>
+ </tr>
+
+ {{ end }}
+</links>
+{{ end }}
+{{ end }}