feat(image): add image lightgallery

This commit is contained in:
Dillon
2020-02-24 17:00:39 +08:00
parent fbfcbaebca
commit 72a2e9bdcf
50 changed files with 478 additions and 353 deletions

View File

@@ -1,4 +1,6 @@
<!-- shuffle md5 as id -->
{{- $scratch := .Page.Scratch.Get "scratch" -}}
{{- /* shuffle md5 as id */ -}}
{{- $id := delimit (split (md5 .Inner) "" | shuffle) "" | printf "echarts-%s" -}}
<div class="echarts" id="{{ $id }}"></div>
{{- .Page.Scratch.SetInMap "echartsMap" $id (printf "{%s}" .Inner) -}}
{{- $scratch.SetInMap "echartsMap" $id (printf "{%s}" .Inner) -}}

View File

@@ -1,4 +1,6 @@
{{- $scratch := .Page.Scratch.Get "scratch" -}}
{{- /* shuffle md5 as id */ -}}
{{- $id := delimit (split (md5 .Inner) "" | shuffle) "" | printf "mermaid-%s" -}}
<div class="mermaid" id="{{ $id }}"></div>
{{- .Page.Scratch.SetInMap "mermaidMap" $id (trim .Inner "\n") -}}
{{- $scratch.SetInMap "mermaidMap" $id (trim .Inner "\n") -}}

View File

@@ -1,3 +1,5 @@
{{- $scratch := .Page.Scratch.Get "scratch" -}}
{{- if .IsNamedParams -}}
<meting-js server="{{ .Get "server" }}" type="{{ .Get "type" }}" id="{{ .Get "id" }}" theme="#A9A9B3"
{{- with .Get "autoplay" }} autoplay="{{ . }}"{{ end -}}
@@ -9,4 +11,4 @@
{{- else -}}
<meting-js server="{{ .Get 0 }}" type="{{ .Get 1 }}" id="{{ .Get 2 }}" theme="#A9A9B3"></meting-js>
{{- end -}}
{{- .Page.Scratch.Set "music" true -}}
{{- $scratch.Set "music" true -}}

View File

@@ -1,3 +1,5 @@
{{- $scratch := .Page.Scratch.Get "scratch" -}}
{{- /* only the trailing newline is retained */ -}}
{{- $content := replaceRE `(?s)^\n*(.*?)\n*$` "$1\n" .Inner | .Page.RenderString -}}
{{- /* shuffle md5 as id */ -}}
@@ -35,7 +37,7 @@
{{- end -}}
{{- $key := .Get "group" | default $id -}}
{{- $group := index (.Page.Scratch.Get "typeitMap" | default dict) $key -}}
{{- $group := index ($scratch.Get "typeitMap" | default dict) $key -}}
{{- $group = $group | default slice | append $id -}}
{{- .Page.Scratch.SetInMap "typeitMap" $key $group -}}
{{- $scratch.SetInMap "typeitMap" $key $group -}}
</div>