Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/thegeeklab/hugo-geekblog.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Kaussow <mail@thegeeklab.de>2022-04-30 15:32:07 +0300
committerGitHub <noreply@github.com>2022-04-30 15:32:07 +0300
commit7ce82f7b6d375c88a688dacdee4ee0853ccb7ebb (patch)
tree926a5fa0252bb6ed098409dca8bd65295b30f316 /layouts
parent90cfc27c3c8b34ca568c20bce9b9c08ac27a9e7d (diff)
feat: add optional hint/admonition icons (#233)v0.18.0
Diffstat (limited to 'layouts')
-rw-r--r--layouts/shortcodes/hint.html17
1 files changed, 15 insertions, 2 deletions
diff --git a/layouts/shortcodes/hint.html b/layouts/shortcodes/hint.html
index e93cbc1..2c8195f 100644
--- a/layouts/shortcodes/hint.html
+++ b/layouts/shortcodes/hint.html
@@ -1,3 +1,16 @@
-<blockquote class="gblog-hint {{ .Get 0 }}">
- {{ .Inner | $.Page.RenderString }}
+{{ $type := default "note" (.Get "type") }}
+{{ $icon := .Get "icon" }}
+{{ $title := default ($type | title) (.Get "title") }}
+
+
+<blockquote class="gblog-hint {{ $type | lower }}">
+ <div class="gblog-hint__title flex align-center">
+ {{- with $icon -}}
+ <svg class="gblog-icon {{ . }}"><use xlink:href="#{{ . }}"></use></svg>
+ <span>{{ $title }}</span>
+ {{- else -}}
+ <i class="fa {{ $type | lower }}" title="{{ $title }}"></i>
+ {{- end -}}
+ </div>
+ <div class="gblog-hint__text">{{ .Inner | $.Page.RenderString }}</div>
</blockquote>