Close #93,#36 Add music short code.

This commit is contained in:
elkan1788
2025-01-06 13:26:27 +08:00
parent 351d6728d0
commit 088da43913
106 changed files with 119 additions and 4 deletions

View File

@@ -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) }}

View File

@@ -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 }}

View 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>