Merge pull request #1461 from mnjm/code-importer-shortcode

 codeimporter shortcode
This commit is contained in:
Nuno Coração
2024-05-13 21:58:18 +01:00
committed by GitHub
2 changed files with 33 additions and 0 deletions
+8
View File
@@ -0,0 +1,8 @@
{{ $url := .Get "url" }}
{{ $type := .Get "type" }}
{{ with resources.GetRemote (printf $url) }}
{{ $codeBlock := printf "```%s\n%s\n```" $type .Content }}
{{ $codeBlock | markdownify }}
{{ else }}
{{ errorf "Code Importer Shortcode - Unable to get remote resource" . }}
{{ end }}