hugo-fixit / FixIt

🔧 A clean, elegant but advanced blog theme for Hugo 一个简洁、优雅且高效的 Hugo 主题
https://fixit.lruihao.cn
MIT License
816 stars 110 forks source link

[FEATURE] add spotify shortcode support #450

Closed Kindle-deep closed 5 months ago

Kindle-deep commented 5 months ago

Describe the feature you want 描述你的功能需求

spotify分享shortcode

Useful reference 有价值的参考

{{- if .IsNamedParams -}} <iframe src="https://open.spotify.com/embed/{{ .Get "type" }}/{{ .Get "id" }}" width="{{ default "100%" (.Get "width") }}" height="{{ default "380" (.Get "height") }}" frameborder="0" allowtransparency="true" allow="encrypted-media"></iframe> {{- else -}} <iframe src="https://open.spotify.com/embed/{{ .Get 0 }}/{{ .Get 1 }}" width="{{ default "100%" (.Get 2) }}" height="{{ default "380" (.Get 3) }}" frameborder="0" allowtransparency="true" allow="encrypted-media"></iframe> {{- end -}}

type(必选项): album,trick,playlist,artist id(必选项):分享链接中获取 height:(非必选) weight:(非必选)

示例: {{< spotify type="artist" id="74ASZWbe4lXaubB36ztrGX" >}}

Lruihao commented 5 months ago

sppported Extended Shortcode - Spotify