From f595aaa287c3871c293e62f0f52c86b92a0b5682 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6ren=20Weber?= Date: Wed, 25 May 2022 23:37:44 +0200 Subject: [PATCH] attachments: adjust implementation to doc #252 --- exampleSite/content/shortcodes/attachments.en.md | 6 +++--- layouts/shortcodes/attachments.html | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/exampleSite/content/shortcodes/attachments.en.md b/exampleSite/content/shortcodes/attachments.en.md index 4f3bea6ac9..ce9d1a2e24 100644 --- a/exampleSite/content/shortcodes/attachments.en.md +++ b/exampleSite/content/shortcodes/attachments.en.md @@ -62,14 +62,14 @@ Be aware that if you use a multilingual website, you will need to have as many f {{% /expand %}} -### Colored styled box, descending sort order +### Info styled box, descending sort order -{{% attachments style="orange" sort="desc" /%}} +{{% attachments style="info" sort="desc" /%}} {{% expand "Show markup" %}} ````go -{{%/* attachments style="orange" sort="desc" /*/%}} +{{%/* attachments style="info" sort="desc" /*/%}} ```` {{% /expand %}} diff --git a/layouts/shortcodes/attachments.html b/layouts/shortcodes/attachments.html index 7bba7c4aeb..b4ba313bf9 100644 --- a/layouts/shortcodes/attachments.html +++ b/layouts/shortcodes/attachments.html @@ -1,6 +1,6 @@ {{- $_hugo_config := `{ "version": 1 }` }} {{- $style := .Get "style" | default "transparent" }} -{{- $title := .Get "title" | default ("Attachments-label" | T) }} +{{- $title := .Get "title" | default ($style | T) | default ("Attachments-label" | T) }} {{- $icon := .Get "icon" | default "" }} {{- if and (not $icon) (eq (len $icon) 0) }} {{- $icon = "paperclip" }} @@ -11,6 +11,7 @@ {{- end }} {{- $icon = trim $icon " " }} {{- $sort := .Get "sort" | default "asc" }} +{{- $pattern := .Get "pattern" | default "" }}
{{ if $icon }} {{ end }}{{ $title }}