From f05d9aff82a325e9038dd8c0f801c17228a04362 Mon Sep 17 00:00:00 2001 From: Engin Diri Date: Thu, 2 Jan 2025 14:06:23 +0100 Subject: [PATCH] feat: support GH style alert blockquotes --- .github/workflows/scheduled-test.yml | 2 +- .../workflows/scheduled-upgrade-programs.yml | 2 +- config/_default/config.yml | 2 +- .../_markup/render-blockquote-alert.html | 19 +++++++++++++++++++ .../_markup/render-blockquote-regular.html | 3 +++ 5 files changed, 25 insertions(+), 3 deletions(-) create mode 100644 layouts/_default/_markup/render-blockquote-alert.html create mode 100644 layouts/_default/_markup/render-blockquote-regular.html diff --git a/.github/workflows/scheduled-test.yml b/.github/workflows/scheduled-test.yml index ff8536f852b5..059825179eb4 100644 --- a/.github/workflows/scheduled-test.yml +++ b/.github/workflows/scheduled-test.yml @@ -69,7 +69,7 @@ jobs: - name: Install Hugo uses: peaceiris/actions-hugo@v2 with: - hugo-version: "0.126.0" + hugo-version: "0.135.0" extended: true - name: Install Pulumi diff --git a/.github/workflows/scheduled-upgrade-programs.yml b/.github/workflows/scheduled-upgrade-programs.yml index c7733451b030..762c1baf8729 100644 --- a/.github/workflows/scheduled-upgrade-programs.yml +++ b/.github/workflows/scheduled-upgrade-programs.yml @@ -57,7 +57,7 @@ jobs: - name: Install Hugo uses: peaceiris/actions-hugo@v2 with: - hugo-version: "0.126.0" + hugo-version: "0.135.0" extended: true - name: Install Pulumi diff --git a/config/_default/config.yml b/config/_default/config.yml index 8e71987d7b3f..8f1f1baf1a2d 100644 --- a/config/_default/config.yml +++ b/config/_default/config.yml @@ -74,7 +74,7 @@ markup: autoHeadingID: true autoHeadingIDType: "github" attribute: - block: false + block: true title: true renderer: hardWraps: false diff --git a/layouts/_default/_markup/render-blockquote-alert.html b/layouts/_default/_markup/render-blockquote-alert.html new file mode 100644 index 000000000000..e9ab9ba0233f --- /dev/null +++ b/layouts/_default/_markup/render-blockquote-alert.html @@ -0,0 +1,19 @@ +{{ $emojis := dict +"caution" ":exclamation:" +"important" ":zap:" +"note" ":information_source:" +"tip" ":bulb:" +"warning" ":warning:" +}} + +
+

+ {{ transform.Emojify (index $emojis .AlertType) }} + {{ with .AlertTitle }} + {{ . }} + {{ else }} + {{ or (i18n .AlertType) (title .AlertType) }} + {{ end }} +

+ {{ .Text }} +
diff --git a/layouts/_default/_markup/render-blockquote-regular.html b/layouts/_default/_markup/render-blockquote-regular.html new file mode 100644 index 000000000000..8b64eee0a1a1 --- /dev/null +++ b/layouts/_default/_markup/render-blockquote-regular.html @@ -0,0 +1,3 @@ +
+ {{ .Text }} +