From 6cb20929c062c20ba8122b95c08dbd73e9db1343 Mon Sep 17 00:00:00 2001 From: Lam Nguyen Date: Mon, 14 Apr 2025 09:32:41 -0700 Subject: [PATCH] fix: Added styling to ghcode shortcode --- layouts/shortcodes/ghcode.html | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/layouts/shortcodes/ghcode.html b/layouts/shortcodes/ghcode.html index 7cfe48ba..3aed9ec2 100644 --- a/layouts/shortcodes/ghcode.html +++ b/layouts/shortcodes/ghcode.html @@ -1,11 +1,26 @@ {{ $file := .Get 0 }} {{ $params := .Get 1 }} +{{ $codeBlockId := printf "id-%x" (now.UnixNano) }} {{ with resources.GetRemote $file }} {{ with .Err }} {{ errorf "%s" . }} {{ else }} {{ $lang := path.Ext $file | strings.TrimPrefix "." }} - {{ highlight .Content $lang $params }} +
+ {{ highlight .Content $lang $params }} +
+ + {{ end }} {{ else }} {{ errorf "Unable to load github content from %s from %q" $file .Position}}