diff --git a/assets/css/main.css b/assets/css/main.css index 4f01beecb..af6bf3169 100644 --- a/assets/css/main.css +++ b/assets/css/main.css @@ -107,7 +107,7 @@ } /* -! tailwindcss v3.4.15 | MIT License | https://tailwindcss.com +! tailwindcss v3.4.16 | MIT License | https://tailwindcss.com */ /* diff --git a/exampleSite/content/posts/tests/bluesky-tests.md b/exampleSite/content/posts/tests/bluesky-tests.md new file mode 100644 index 000000000..e94969780 --- /dev/null +++ b/exampleSite/content/posts/tests/bluesky-tests.md @@ -0,0 +1,14 @@ +--- +title: "Bluesky Tests" +date: 2024-12-14T23:35:20+00:00 +lastmod: 2024-12-14T23:35:20+00:00 +draft: true +description: "Bluesky Shortcode Tests" +categories: [Tests] +hiddenFromHomePage: true +hiddenFromSearch: true +--- + + + +{{< bluesky link="https://bsky.app/profile/bsky.app/post/3latotljnec2h" >}} \ No newline at end of file diff --git a/exampleSite/content/posts/theme-documentation-extended-shortcodes/index.en.md b/exampleSite/content/posts/theme-documentation-extended-shortcodes/index.en.md index f0555902c..2e39730c9 100644 --- a/exampleSite/content/posts/theme-documentation-extended-shortcodes/index.en.md +++ b/exampleSite/content/posts/theme-documentation-extended-shortcodes/index.en.md @@ -1598,3 +1598,23 @@ Without an explicitly given picture, a generic icon is used. This input: ``` This renders as {{< person "https://dillonzq.com/" Dillon "author of the LoveIt theme" >}}. + +## bluesky + +`bluesky` is a shortcode to embed a post from [Bluesky](https://bsky.app). + +The `bluesky` shortcode has the following named parameters: + +* **link** *[required]* + + URL of the Bluesky post. + +Example `bluesky` input: + +```markdown +{{}} +``` + +The rendered output looks like this: + +{{< bluesky link="https://bsky.app/profile/bsky.app/post/3latotljnec2h" >}} \ No newline at end of file diff --git a/exampleSite/content/posts/theme-documentation-extended-shortcodes/index.zh-cn.md b/exampleSite/content/posts/theme-documentation-extended-shortcodes/index.zh-cn.md index e4b361855..9f0a5037b 100644 --- a/exampleSite/content/posts/theme-documentation-extended-shortcodes/index.zh-cn.md +++ b/exampleSite/content/posts/theme-documentation-extended-shortcodes/index.zh-cn.md @@ -1600,4 +1600,22 @@ print("Hello world!") {{}} ``` -呈现的输出效果为 {{< person "https://dillonzq.com/" Dillon "author of the LoveIt theme" >}}. \ No newline at end of file +呈现的输出效果为 {{< person "https://dillonzq.com/" Dillon "author of the LoveIt theme" >}}. + +## bluesky + +`bluesky` shortcode 用于嵌入 [Bluesky](https://bsky.app) 的帖子。 + +`bluesky` shortcode 有以下命名参数: + +* **link** *[必需]* + + Bluesky 帖子的 URL。 + +一个 `bluesky` 示例: + +```markdown +{{}} +``` + +呈现的输出效果为 {{< bluesky link="https://bsky.app/profile/bsky.app/post/3latotljnec2h" >}} diff --git a/layouts/shortcodes/bluesky.html b/layouts/shortcodes/bluesky.html new file mode 100644 index 000000000..2f77d7571 --- /dev/null +++ b/layouts/shortcodes/bluesky.html @@ -0,0 +1,8 @@ +{{- $link := .Get "link" -}} +{{- $query := querify "url" $link -}} +{{- $request := printf "https://embed.bsky.app/oembed?%s" $query -}} + +{{- $jsonOembed := resources.GetRemote $request -}} +{{- $jsonOembed = $jsonOembed | transform.Unmarshal -}} +{{- $jsonOHTML := $jsonOembed.html -}} +{{- $jsonOHTML | safeHTML -}} \ No newline at end of file