✨ Close #93,#36 Add music short code.
This commit is contained in:
@@ -3,11 +3,21 @@
|
||||
"isPage" .IsPage
|
||||
"comments" (.Scratch.Get "isComment")
|
||||
"toc" (default .Site.Params.toc.enable .Params.Toc)
|
||||
"music" .Params.music
|
||||
"permalink" (.Page.Permalink | absURL)
|
||||
"path" (.Page.Permalink | path.Base)
|
||||
"title" .Page.Title
|
||||
}}
|
||||
|
||||
{{/** Append APlayer plugin */}}
|
||||
{{ if .Params.music }}
|
||||
{{ $aplayer := dict
|
||||
"js" $.Site.Data.resources.plugins.music.js
|
||||
"css" $.Site.Data.resources.plugins.music.css
|
||||
}}
|
||||
{{ $pageCfg = merge $pageCfg (dict "aplayer" $aplayer) }}
|
||||
{{ end }}
|
||||
|
||||
{{/* Append post expired config */}}
|
||||
{{ $expired := default .Site.Params.PostMeta.expired .Params.Expired }}
|
||||
{{ $pageCfg = merge $pageCfg (dict "expired" $expired) }}
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
{{ $router := dict }}
|
||||
|
||||
{{ if eq $vendor "local" }}
|
||||
{{ $router = dict "url" (printf "%s3rd" .Site.BaseURL) "name" $vendor "type" "modern" }}
|
||||
{{ $router = dict "url" (printf "%sjs/3rd" .Site.BaseURL) "name" $vendor "type" "modern" }}
|
||||
{{ else }}
|
||||
{{ range .Site.Data.resources.vendors }}
|
||||
{{ if eq .name $vendor }}
|
||||
|
||||
22
layouts/shortcodes/music.html
Normal file
22
layouts/shortcodes/music.html
Normal file
@@ -0,0 +1,22 @@
|
||||
{{- $theme := "#448aff" -}}
|
||||
{{- $theme = .Get "theme" | default $theme -}}
|
||||
|
||||
<meting-js theme="{{ $theme }}"
|
||||
{{ with .Get "id" }} id="{{ . }}" {{ end }}
|
||||
{{ with .Get "server" }} server="{{ . }}" {{ end }}
|
||||
{{ with .Get "type" }} type="{{ . }}" {{ end }}
|
||||
{{ with .Get "auto" }} auto="{{ . }}" {{ end }}
|
||||
{{ with .Get "url" }} url="{{ . }}" {{ end }}
|
||||
{{ with .Get "name" }} name="{{ . }}" {{ end }}
|
||||
{{ with .Get "artist" }} artist="{{ . }}" {{ end }}
|
||||
{{ with .Get "cover" }} cover="{{ . }}" {{ end }}
|
||||
{{ with .Get "fixed" }} fixed="{{ . }}" {{ end }}
|
||||
{{ with .Get "mini" }} mini="{{ . }}" {{ end }}
|
||||
{{ with .Get "autoplay" }} autoplay="{{ . }}" {{ end }}
|
||||
{{ with .Get "loop" }} loop="{{ . }}" {{ end }}
|
||||
{{ with .Get "order" }} order="{{ . }}" {{ end }}
|
||||
{{ with .Get "volume" }} volume="{{ . }}" {{ end }}
|
||||
{{ with .Get "mutex" }} mutex="{{ . }}" {{ end }}
|
||||
{{ with .Get "list-folded" }} list-folded="{{ . }}" {{ end }}
|
||||
{{ with .Get "list-max-height" }} list-max-height="{{ . }}" {{ end }}
|
||||
></meting-js>
|
||||
Reference in New Issue
Block a user