You've already forked no-js-hugo-theme
Move from static -> assets
This commit is contained in:
22
layouts/_shortcodes/asciinema.html
Normal file
22
layouts/_shortcodes/asciinema.html
Normal file
@ -0,0 +1,22 @@
|
||||
<div id='{{ with .Get "key" }}{{ . }}{{ end }}'></div>
|
||||
{{ with resources.Get "vendor/asciinema/asciinema-player.min.js" | resources.Fingerprint }}
|
||||
<script src="{{ .RelPermalink }}"></script>
|
||||
{{ end }}
|
||||
<script>
|
||||
AsciinemaPlayer.create('/casts/{{ with .Get "key" }}{{ . }}{{ end }}.cast', document.getElementById('{{ with .Get "key" }}{{ . }}{{ end }}'), {
|
||||
{{ if .Get "cols" }}cols: "{{ .Get "cols" }}",{{ end }}
|
||||
{{ if .Get "rows" }}rows: "{{ .Get "rows" }}",{{ end }}
|
||||
{{ if .Get "autoPlay" }}autoPlay: "{{ .Get "autoPlay" }}",{{ end }}
|
||||
{{ if .Get "preload" }}preload: "{{ .Get "preload" }}",{{ end }}
|
||||
{{ if .Get "loop" }}loop: "{{ .Get "loop" }}",{{ end }}
|
||||
{{ if .Get "startAt" }}startAt: "{{ .Get "startAt" }}",{{ end }}
|
||||
{{ if .Get "speed" }}speed: "{{ .Get "speed" }}",{{ end }}
|
||||
{{ if .Get "idleTimeLimit" }}idleTimeLimit: "{{ .Get "idleTimeLimit" }}",{{ end }}
|
||||
{{ if .Get "theme" }}theme: "{{ .Get "theme" }}",{{ end }}
|
||||
{{ if .Get "poster" }}poster: "{{ .Get "poster" }}",{{ end }}
|
||||
{{ if .Get "fit" }}fit: "{{ .Get "fit" }}",{{ end }}
|
||||
{{ if .Get "terminalFontSize" }}terminalFontSize: "{{ .Get "terminalFontSize" }}",{{ end }}
|
||||
{{ if .Get "terminalFontFamily" }}terminalFontFamily: "{{ .Get "terminalFontFamily" }}",{{ end }}
|
||||
{{ if .Get "terminalLineHeight" }}terminalLineHeight: "{{ .Get "terminalLineHeight" }}",{{ end }}
|
||||
});
|
||||
</script>
|
9
layouts/_shortcodes/details.html
Normal file
9
layouts/_shortcodes/details.html
Normal file
@ -0,0 +1,9 @@
|
||||
{{- /*
|
||||
Template comment syntax: https://hugo.d.balki.me/templates/introduction/#comments
|
||||
collapsable section ref: https://stackoverflow.com/a/78475534
|
||||
*/ -}}
|
||||
|
||||
<details>
|
||||
<summary>{{ .Get "title" | default "Click to expand" | markdownify }}</summary>
|
||||
<div>{{ .Inner | markdownify }}</div>
|
||||
</details>
|
11
layouts/_shortcodes/notice.html
Normal file
11
layouts/_shortcodes/notice.html
Normal file
@ -0,0 +1,11 @@
|
||||
{{- .Scratch.Set "type" "note" -}}
|
||||
{{- with .Get 0 }}{{ $.Scratch.Set "type" . }}{{ end -}}
|
||||
<aside class="notice {{ .Scratch.Get "type" }}">
|
||||
<hr>
|
||||
<div class="notice-title">
|
||||
<img class="notice-title-icon" src="{{ "images/exclamation.svg" | relURL }}" height="15">
|
||||
<span>{{ with .Get 1 }}{{ . }}{{ else }}{{ .Scratch.Get "type" | humanize }}{{ end }}</span>
|
||||
</div>
|
||||
<div class="notice-body">{{ .Inner | markdownify }}</div>
|
||||
<hr>
|
||||
</aside>
|
Reference in New Issue
Block a user