From eb8614af4dd74d9ad3b2cadcc24e2fe4871b9622 Mon Sep 17 00:00:00 2001 From: David Karlsson <35727626+dvdksn@users.noreply.github.com> Date: Thu, 15 Aug 2024 21:41:27 +0200 Subject: [PATCH] hugo: refactor include shortcode mechanics Instead of inserting the raw file contents, use the page object. Signed-off-by: David Karlsson <35727626+dvdksn@users.noreply.github.com> --- content/includes/_index.md | 7 +++++++ content/includes/admin-early-access.md | 3 +++ content/includes/compose-bridge-early-access.md | 3 +++ content/includes/dockerfile-labs-channel.md | 3 +++ content/includes/index.md | 0 hugo_stats.json | 4 ++++ layouts/shortcodes/include.html | 4 +++- 7 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 content/includes/_index.md delete mode 100644 content/includes/index.md diff --git a/content/includes/_index.md b/content/includes/_index.md new file mode 100644 index 0000000000..53ee6a2b05 --- /dev/null +++ b/content/includes/_index.md @@ -0,0 +1,7 @@ +--- +cascade: +- build: + list: local + publishResources: false + render: never +--- diff --git a/content/includes/admin-early-access.md b/content/includes/admin-early-access.md index bb14389335..7fd75ffd5b 100644 --- a/content/includes/admin-early-access.md +++ b/content/includes/admin-early-access.md @@ -1,3 +1,6 @@ +--- +--- + {{% restricted title="Early Access" %}} The Docker Admin Console is an [early access](/release-lifecycle#early-access-ea) product. diff --git a/content/includes/compose-bridge-early-access.md b/content/includes/compose-bridge-early-access.md index 740d9798eb..396ffeb3d3 100644 --- a/content/includes/compose-bridge-early-access.md +++ b/content/includes/compose-bridge-early-access.md @@ -1,3 +1,6 @@ +--- +--- + {{% restricted title="Early Access" %}} Compose Bridge is an [Early Access](/release-lifecycle#early-access-ea) product. diff --git a/content/includes/dockerfile-labs-channel.md b/content/includes/dockerfile-labs-channel.md index ef4232bf62..029b25a635 100644 --- a/content/includes/dockerfile-labs-channel.md +++ b/content/includes/dockerfile-labs-channel.md @@ -1,3 +1,6 @@ +--- +--- + {{% experimental %}} The "labs" channel provides early access to Dockerfile features that are not yet available in the stable channel. diff --git a/content/includes/index.md b/content/includes/index.md deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/hugo_stats.json b/hugo_stats.json index 187416e7d7..5514e88364 100644 --- a/hugo_stats.json +++ b/hugo_stats.json @@ -175,6 +175,7 @@ "border-l-2", "border-l-4", "border-l-magenta-light", + "border-red-light", "border-violet-light", "bottom-0", "box-content", @@ -212,6 +213,7 @@ "dark:border-gray-dark-400", "dark:border-green-dark", "dark:border-l-magenta-dark", + "dark:border-red-dark", "dark:border-violet-dark", "dark:decoration-blue-dark", "dark:fill-blue-dark", @@ -237,6 +239,7 @@ "dark:text-gray-dark-800", "dark:text-green-dark", "dark:text-magenta-dark", + "dark:text-red-dark", "dark:text-violet-dark", "dark:text-white", "dark:to-blue-dark-100", @@ -463,6 +466,7 @@ "text-left", "text-lg", "text-magenta-light", + "text-red-light", "text-sm", "text-violet-light", "text-white", diff --git a/layouts/shortcodes/include.html b/layouts/shortcodes/include.html index 4d7f13421e..4730fcb0ff 100644 --- a/layouts/shortcodes/include.html +++ b/layouts/shortcodes/include.html @@ -1,2 +1,4 @@ {{ $fileToInclude := .Get 0 }} -{{ os.ReadFile (printf "includes/%s" $fileToInclude) | page.RenderString }} +{{ with (site.GetPage (printf "includes/%s" $fileToInclude)) }} + {{ page.RenderString (dict "display" "block") .RenderShortcodes }} +{{ end }}