summaryrefslogtreecommitdiff
path: root/themes/blowfish/layouts/shortcodes/codeimporter.html
diff options
context:
space:
mode:
authorChristoph Cullmann <christoph@cullmann.io>2024-06-26 21:44:28 +0200
committerChristoph Cullmann <christoph@cullmann.io>2024-06-26 21:44:28 +0200
commit58e2c9ae87f09dac79ecf962331ae2c51f4ba7f1 (patch)
treed819d1747427f81d1883a715ec60d13d575053e4 /themes/blowfish/layouts/shortcodes/codeimporter.html
parentb1a7697b03cfb0143af78993387f758836e842bf (diff)
update the theme
Diffstat (limited to 'themes/blowfish/layouts/shortcodes/codeimporter.html')
-rw-r--r--themes/blowfish/layouts/shortcodes/codeimporter.html8
1 files changed, 8 insertions, 0 deletions
diff --git a/themes/blowfish/layouts/shortcodes/codeimporter.html b/themes/blowfish/layouts/shortcodes/codeimporter.html
new file mode 100644
index 0000000..493f444
--- /dev/null
+++ b/themes/blowfish/layouts/shortcodes/codeimporter.html
@@ -0,0 +1,8 @@
+{{ $url := .Get "url" }}
+{{ $type := .Get "type" }}
+{{ with resources.GetRemote (urls.Parse $url) }}
+{{ $codeBlock := printf "```%s\n%s\n```" $type .Content }}
+{{ $codeBlock | markdownify }}
+{{ else }}
+{{ errorf "Code Importer Shortcode - Unable to get remote resource" . }}
+{{ end }}