diff --git a/content/en/documentation/content-management/shortcodes/extended/spotify/featured-image.webp b/content/en/documentation/content-management/shortcodes/extended/spotify/featured-image.webp new file mode 100644 index 0000000..3984524 Binary files /dev/null and b/content/en/documentation/content-management/shortcodes/extended/spotify/featured-image.webp differ diff --git a/content/en/documentation/content-management/shortcodes/extended/spotify/index.md b/content/en/documentation/content-management/shortcodes/extended/spotify/index.md new file mode 100644 index 0000000..60f33c6 --- /dev/null +++ b/content/en/documentation/content-management/shortcodes/extended/spotify/index.md @@ -0,0 +1,55 @@ +--- +title: Extended Shortcode - spotify +date: 2024-05-20T11:06:24+08:00 +type: posts +author: + name: Lruihao + link: https://lruihao.cn +description: The spotify shortcode embeds a responsive music player for Spotify music. +resources: + - name: featured-image + src: featured-image.webp +tags: + - Shortcodes + - Content +categories: + - Documentation +--- + +The `spotify` shortcode embeds a responsive music player for Spotify music. + + + +## Usages + +Example `spotify` input: + +```go-html-template +{{}} +Or +{{}} +``` + +The rendered output looks like this: + +{{< spotify artist 74ASZWbe4lXaubB36ztrGX >}} + +## Options + +The `spotify` shortcode has the following named parameters: + +- **type** _[required]_ (**first** positional parameter) + + The `type` of the Spotify music, which can be `artist`, `album`, `track`, or `playlist`. + +- **id** _[required]_ (**second** positional parameter) + + The `id` of the Spotify music, which can be found in the Spotify URL. + +- **width** _[optional]_ (**third** positional parameter) + + The `width` of the Spotify music player. + +- **height** _[optional]_ (**fourth** positional parameter) + + The `height` of the Spotify music player. diff --git a/content/zh-cn/documentation/content-management/shortcodes/extended/spotify/index.md b/content/zh-cn/documentation/content-management/shortcodes/extended/spotify/index.md new file mode 100644 index 0000000..57c52f7 --- /dev/null +++ b/content/zh-cn/documentation/content-management/shortcodes/extended/spotify/index.md @@ -0,0 +1,55 @@ +--- +title: 扩展 Shortcode - spotify +date: 2024-05-20T11:06:24+08:00 +type: posts +author: + name: Lruihao + link: https://lruihao.cn +description: spotify shortcode 提供了一个内嵌的响应式音乐播放器。 +resources: + - name: featured-image + src: featured-image.webp +tags: + - Shortcodes + - Content +categories: + - Documentation +--- + +`spotify` shortcode 提供了一个内嵌的响应式音乐播放器。 + + + +## 快速使用 + +一个 `spotify` 示例: + +```go-html-template +{{}} +Or +{{}} +``` + +呈现的输出效果如下: + +{{< spotify artist 74ASZWbe4lXaubB36ztrGX >}} + +## 详细参数 + +`spotify` shortcode 有以下命名参数: + +- **type** _[必需]_ (**第一个**位置参数) + + Spotify 音乐的 `type`,可以是 `艺术家`、`专辑`、`曲目` 或 `播放列表`。 + +- **id** _[必需]_ (**第二个**位置参数) + + Spotify 音乐的 `id`,可以在 Spotify URL 中找到。 + +- **width** _[optional]_ (**第三个**位置参数) + + Spotify 音乐播放器的宽度。 + +- **height** _[optional]_ (**第四个**位置参数) + + Spotify 音乐播放器的高度。 diff --git a/go.mod b/go.mod index 10db1de..1b4b3f5 100644 --- a/go.mod +++ b/go.mod @@ -4,6 +4,6 @@ go 1.20 require ( github.com/Lruihao/hugo-shortcode-sponsor-log v1.0.0 // indirect - github.com/hugo-fixit/FixIt v0.3.8-0.20240606030604-6eaae7470851 // indirect + github.com/hugo-fixit/FixIt v0.3.8-0.20240608042704-678e2c0053c6 // indirect github.com/hugo-fixit/component-projects v1.1.1 // indirect ) diff --git a/go.sum b/go.sum index 96b304c..552834b 100644 --- a/go.sum +++ b/go.sum @@ -1,6 +1,6 @@ github.com/Lruihao/hugo-shortcode-sponsor-log v1.0.0 h1:HN1tKv3xYVZRSz+xt2Wr3hLbqxi5yK6OZRecYj22yyU= github.com/Lruihao/hugo-shortcode-sponsor-log v1.0.0/go.mod h1:B0v1x6BWWp5g6w82hBfZkJNPTyTw8Cvt6ccZ7BllA20= -github.com/hugo-fixit/FixIt v0.3.8-0.20240606030604-6eaae7470851 h1:5T1RJoZ3+f6Y1mtyNmCfnH3acpcgGbYrG8EwVU2nRGk= -github.com/hugo-fixit/FixIt v0.3.8-0.20240606030604-6eaae7470851/go.mod h1:3XIRedrqakO7/a4ZnhE46haMRF8HgsT0N0B5j5D2iRU= +github.com/hugo-fixit/FixIt v0.3.8-0.20240608042704-678e2c0053c6 h1:OFmX9EfcudAUxIyD2ij8vAaSC3gN8LyO7OUm1SfA9lc= +github.com/hugo-fixit/FixIt v0.3.8-0.20240608042704-678e2c0053c6/go.mod h1:3XIRedrqakO7/a4ZnhE46haMRF8HgsT0N0B5j5D2iRU= github.com/hugo-fixit/component-projects v1.1.1 h1:iFwd/pWCSQ5LQoyb82Fsi21YP8Xrv4A5YDOYPXbpP/U= github.com/hugo-fixit/component-projects v1.1.1/go.mod h1:nXW0R37REwpfwUD1I4RtB5QW71vw66nRyB9uEpYxr+c=