From 88bdf671588fbfff1acd3e561e66accc1652492b Mon Sep 17 00:00:00 2001 From: PCloud Date: Sat, 14 Dec 2024 23:37:38 +0000 Subject: [PATCH 1/2] initial commit --- assets/css/main.css | 2 +- exampleSite/content/posts/tests/bluesky-tests.md | 14 ++++++++++++++ layouts/shortcodes/bluesky.html | 8 ++++++++ 3 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 exampleSite/content/posts/tests/bluesky-tests.md create mode 100644 layouts/shortcodes/bluesky.html 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/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 From a609a06a383e0df5d5dcabbfe41081372314cd34 Mon Sep 17 00:00:00 2001 From: PCloud Date: Sat, 14 Dec 2024 23:47:26 +0000 Subject: [PATCH 2/2] feat: add documentation --- .../index.en.md | 20 +++++++++++++++++++ .../index.zh-cn.md | 20 ++++++++++++++++++- 2 files changed, 39 insertions(+), 1 deletion(-) 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" >}}