From 72cd93c0fedb2d494d98f68ea340bc2cdf706e68 Mon Sep 17 00:00:00 2001 From: Trifonova Antonia Date: Mon, 4 Jul 2022 15:09:21 +0300 Subject: [PATCH] Open relref link in a new tab Add a new shortcode that opens relative links to another page. Signed-off-by: Trifonova Antonia --- web/site/layouts/shortcodes/relrefn.html | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 web/site/layouts/shortcodes/relrefn.html diff --git a/web/site/layouts/shortcodes/relrefn.html b/web/site/layouts/shortcodes/relrefn.html new file mode 100644 index 00000000..fd7383c8 --- /dev/null +++ b/web/site/layouts/shortcodes/relrefn.html @@ -0,0 +1,4 @@ +{{ $_hugo_config := `{ "version": 1 }` }} +{{ $ref := index .Params 0 }} +{{ $page := .Page.GetPage $ref }} +{{- "" -}}{{if eq .Page.File.Ext "md"}}{{.Inner|markdownify}}{{else}}{{.Inner|htmlUnescape|safeHTML}}{{end}}{{- "" -}}