feat: add bilibili diagram echarts and improve style
This commit is contained in:
7
layouts/shortcodes/bilibili.html
Normal file
7
layouts/shortcodes/bilibili.html
Normal file
@@ -0,0 +1,7 @@
|
||||
<div class="bilibili">
|
||||
{{- if .IsNamedParams -}}
|
||||
<iframe src="//player.bilibili.com/player.html?aid={{ .Get "aid" }}&cid={{ .Get "cid" }}&page=1" scrolling="no" border="0" frameborder="no" framespacing="0" allowfullscreen="true"></iframe>
|
||||
{{- else -}}
|
||||
<iframe src="//player.bilibili.com/player.html?aid={{ .Get 0 }}&cid={{ .Get 1 }}&page=1" scrolling="no" border="0" frameborder="no" framespacing="0" allowfullscreen="true"></iframe>
|
||||
{{- end -}}
|
||||
</div>
|
||||
5
layouts/shortcodes/diagram.html
Normal file
5
layouts/shortcodes/diagram.html
Normal file
@@ -0,0 +1,5 @@
|
||||
{{ $_hugo_config := `{ "version": 1 }` -}}
|
||||
{{ .Page.Scratch.Set "diagram" "true" }}
|
||||
<div class="mermaid">
|
||||
{{- .Inner -}}
|
||||
</div>
|
||||
14
layouts/shortcodes/echarts.html
Normal file
14
layouts/shortcodes/echarts.html
Normal file
@@ -0,0 +1,14 @@
|
||||
<!-- shuffle md5 as id -->
|
||||
{{ $id := delimit (split (md5 .Inner) "" | shuffle) "" | printf "ec-%s" -}}
|
||||
{{ $echartsMap := .Page.Scratch.Get "echartsMap" -}}
|
||||
{{ if $echartsMap -}}
|
||||
{{ $echartsMap = dict $id .Inner | merge $echartsMap -}}
|
||||
{{ else -}}
|
||||
{{ $echartsMap = dict $id .Inner -}}
|
||||
{{ end -}}
|
||||
{{ .Page.Scratch.Set "echartsMap" $echartsMap -}}
|
||||
{{ if .IsNamedParams }}
|
||||
<div class="echarts" id="{{ $id }}" style="width: {{ .Get "width" }}; height: {{ .Get "height" }};"></div>
|
||||
{{ else }}
|
||||
<div class="echarts" id="{{ $id }}" style="width: {{ .Get 0 }}; height: {{ .Get 1 }};"></div>
|
||||
{{ end }}
|
||||
@@ -1,4 +1,4 @@
|
||||
{{ .Page.Scratch.Set "music" "true" }}
|
||||
{{ .Page.Scratch.Set "music" "true" -}}
|
||||
{{ if .IsNamedParams }}
|
||||
<meting-js server={{ .Get "server" }} type={{ .Get "type" }} id={{ .Get "id" }}
|
||||
{{ with .Get "autoplay" }}
|
||||
|
||||
Reference in New Issue
Block a user