Added shortcodes, lots of improvements and content dump

This commit is contained in:
2022-06-07 13:54:07 +00:00
parent 6c98fcf57a
commit 9859c9e5ba
34 changed files with 448 additions and 59 deletions

View File

@@ -0,0 +1 @@
{{ with resources.Get (.Get 0) }}{{ .Content }}{{ end }}

View File

@@ -0,0 +1,5 @@
{{ $opts := slice "lineNos=table" "tabWidth=2" "noClasses=false" "style=fruity" }}
{{ if .Get 1 }}
{{ $opts = $opts | append (split (.Get 1) ",") }}
{{ end }}
{{ transform.Highlight (htmlUnescape .Inner) (.Get 0) (delimit $opts ",") }}

View File

@@ -0,0 +1,20 @@
<figure {{ with .Get "class" }}class='{{.}}'{{ end }}>
{{ with resources.Get (.Get "src") | fingerprint }}
<a href='{{ with $.Get "link" }}{{ . }}{{ else }}{{ .RelPermalink }}{{ end }}' target='_blank'>
<img src='{{ .RelPermalink }}' integrity='{{ .Data.Integrity }}'
{{ if or ($.Get "alt") ($.Get "caption") }}alt='{{ with $.Get "alt" }}{{ . }}
{{ else }}{{ $.Get "caption" }}{{ end }}'{{ end }} />
</a>
{{ end }}
{{ if or (or (.Get "title") (.Get "caption")) (.Get "attr") }}
<figcaption>{{ if isset .Params "title" }}
<h4>{{ .Get "title" }}</h4>{{ end }}
{{ if or (.Get "caption") (.Get "attr") }}<p>
{{ .Get "caption" }}
{{ with .Get "attrlink" }}<a href="{{ . }}"> {{ end }}
{{ .Get "attr" }}
{{ if .Get "attrlink" }}</a> {{ end }}
</p> {{ end }}
</figcaption>
{{ end }}
</figure>

View File

@@ -0,0 +1 @@
{{ .Inner }}

View File

@@ -0,0 +1,3 @@
{{ with resources.Get (.Get 0) | fingerprint }}
<script src='{{ .RelPermalink }}' integrity='{{ .Data.Integrity }}'></script>
{{ end }}