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 }} +