Initial Commit
This commit is contained in:
3
themes/hugo-coder/layouts/shortcodes/mermaid.html
Normal file
3
themes/hugo-coder/layouts/shortcodes/mermaid.html
Normal file
@ -0,0 +1,3 @@
|
||||
<div class="mermaid">
|
||||
{{- .Inner | safeHTML }}
|
||||
</div>
|
12
themes/hugo-coder/layouts/shortcodes/notice.html
Normal file
12
themes/hugo-coder/layouts/shortcodes/notice.html
Normal file
@ -0,0 +1,12 @@
|
||||
{{- $type := .Get 0 -}}
|
||||
{{- $title := .Get 1 | default $type -}}
|
||||
{{- $inner := .Inner | .Page.RenderString | chomp -}}
|
||||
{{- $icon := dict "note" "fa-sticky-note" "tip" "fa-lightbulb-o" "example" "fa-file-text" "question" "fa-question" "info" "fa-exclamation-circle" "warning" "fa-exclamation-triangle" "error" "fa-times-circle" -}}
|
||||
<div class="notice {{ $type }}">
|
||||
<div class="notice-title">
|
||||
<i class="fa {{ index $icon $type }}" aria-hidden="true"></i>{{ i18n $title | default $title | humanize }}
|
||||
</div>
|
||||
<div class="notice-content">
|
||||
{{- $inner -}}
|
||||
</div>
|
||||
</div>
|
17
themes/hugo-coder/layouts/shortcodes/tab.html
Normal file
17
themes/hugo-coder/layouts/shortcodes/tab.html
Normal file
@ -0,0 +1,17 @@
|
||||
{{ $group := .Page.Scratch.Get "tabGroupIndex" | default 0 }}
|
||||
{{ $index := .Page.Scratch.Get "tabElementIndex" | default 0 }}
|
||||
{{ $name := .Get "name" | default "Name Me!" }}
|
||||
|
||||
<style>
|
||||
.tabs input#tab-{{ $group }}-{{ $index }}:checked ~ .tab-content-{{ $group }}-{{ $index }} {
|
||||
display: block;
|
||||
}
|
||||
</style>
|
||||
|
||||
<input type="radio" class="tab-input" name="tab-select-{{ $group }}" id="tab-{{ $group }}-{{ $index }}" {{ if eq $index 0 }}checked{{ end }}/>
|
||||
<label for="tab-{{ $group }}-{{ $index }}" class="tab-label">{{ $name }}</label>
|
||||
<div class="tab-content tab-content-{{ $group }}-{{ $index }}">
|
||||
{{ .Inner | markdownify }}
|
||||
</div>
|
||||
|
||||
{{ .Page.Scratch.Set "tabElementIndex" (add 1 $index) }}
|
10
themes/hugo-coder/layouts/shortcodes/tabgroup.html
Normal file
10
themes/hugo-coder/layouts/shortcodes/tabgroup.html
Normal file
@ -0,0 +1,10 @@
|
||||
{{ $align := .Get "align" | default "left" }}
|
||||
{{ $style := .Get "style" | default "markdown" }}
|
||||
{{ $group := .Page.Scratch.Get "tabGroupIndex" | default 0 }}
|
||||
{{ $index := .Page.Scratch.Set "tabElementIndex" 0 }}
|
||||
|
||||
<div class="tabs {{ if eq $style "code" }}tabs-code {{ end }}tabs-{{ $align }}">
|
||||
{{ .Inner }}
|
||||
</div>
|
||||
|
||||
{{ .Page.Scratch.Set "tabGroupIndex" (add 1 $group) }}
|
Reference in New Issue
Block a user