From e20a28ce0526aab61d602b9280076c24f28d1abf Mon Sep 17 00:00:00 2001 From: Travis Martin Date: Tue, 15 Sep 2026 08:26:31 -0700 Subject: [PATCH] Add renamed-notice shortcode for stub pages --- layouts/shortcodes/renamed-notice.html | 27 ++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 layouts/shortcodes/renamed-notice.html diff --git a/layouts/shortcodes/renamed-notice.html b/layouts/shortcodes/renamed-notice.html new file mode 100644 index 000000000..c47b565ec --- /dev/null +++ b/layouts/shortcodes/renamed-notice.html @@ -0,0 +1,27 @@ +{{/* layouts/shortcodes/renamed-notice.html */}} +{{ $newURL := index .Page.Params "f5-moved-to" }} +{{ $newName := index .Page.Params "f5-product" }} +{{ $oldName := index .Page.Params "f5-product-former" }} + +{{ if not $newURL }} + {{ errorf "renamed-notice: f5-moved-to front matter is required (used in %q)" .Page.File.Path }} +{{ end }} +{{ if not $newName }} + {{ errorf "renamed-notice: f5-product front matter is required (used in %q)" .Page.File.Path }} +{{ end }} +{{ if not $oldName }} + {{ errorf "renamed-notice: f5-product-former front matter is required (used in %q)" .Page.File.Path }} +{{ end }} +{{ if not (.Site.GetPage $newURL) }} + {{ errorf "renamed-notice: no page found at f5-moved-to %q (used in %q)" $newURL .Page.File.Path }} +{{ end }} + +{{ $content := printf "%s is now **%s**. [View the current page →](%s)" $oldName $newName $newURL }} + +{{ partial "callout.html" (dict + "class" "warning call-out" + "title" "This page has moved" + "icon" "" + "sideline" "false" + "content" $content +) }} \ No newline at end of file