feat: add optional hint/admonition icons (#383)

BREAKING CHANGE: The types of the `hint` short code have been renamed to `[note|tip|important|caution|warning]` the old types `[info|ok|warning|danger]` are still working, but should be considered as deprecated.

BREAKING CHANGE: The `hint` short code is using named arguments now. You have to change, e.g. `{{< hint warning >}}` to `{{< hint type=warning >}}`.
This commit is contained in:
Robert Kaussow 2022-04-23 15:14:42 +02:00 committed by GitHub
parent 1563cd228b
commit f6966b8513
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
24 changed files with 310 additions and 35 deletions

View file

@ -1,3 +1,16 @@
<blockquote class="gdoc-hint {{ .Get 0 }}">
{{ .Inner | $.Page.RenderString }}
{{ $type := default "note" (.Get "type") }}
{{ $icon := .Get "icon" }}
{{ $title := default ($type | title) (.Get "title") }}
<blockquote class="gdoc-hint {{ $type | lower }}">
<div class="gdoc-hint__title flex align-center">
{{ with $icon }}
<svg class="gdoc-icon {{ . }}"><use xlink:href="#{{ . }}"></use></svg>
<span>{{ $title }}</span>
{{ else }}
<i class="fa {{ $type | lower }}" title="{{ $title }}"></i>
{{ end }}
</div>
<div class="gdoc-hint__text">{{ .Inner | $.Page.RenderString }}</div>
</blockquote>