diff --git a/layouts/shortcodes/highlightWithTitle.html b/layouts/shortcodes/highlightWithTitle.html new file mode 100644 index 0000000..5cf49e9 --- /dev/null +++ b/layouts/shortcodes/highlightWithTitle.html @@ -0,0 +1,7 @@ + +
+{{- with .Get 0 -}} +
{{ . | safeHTML }}
+{{- end -}} +{{- highlight (trim .Inner "\n") (.Get 1) (.Get 2) -}} +
\ No newline at end of file diff --git a/layouts/shortcodes/internalLink.html b/layouts/shortcodes/internalLink.html new file mode 100644 index 0000000..2d60bea --- /dev/null +++ b/layouts/shortcodes/internalLink.html @@ -0,0 +1,18 @@ + +{{ $path := .Get "path" }} +{{ $lang := .Get "lang" }} +{{ $currentLang := .Page.Lang }} +{{ range .Page.Sites }} +{{ if eq .Language.Lang $lang }} +{{ with .GetPage $path }} + +{{ .Title }} + +{{ if ne $currentLang $lang }} +{{- partial "icons/en.svg" . -}} +{{ end }} +{{ else }} +{{ errorf "shortcode internalLink: Cannot find page %q with lang %q" $path $lang }} +{{ end }} +{{ end }} +{{ end }}