Skip to content

Commit 5b4cbe3

Browse files
committed
shortcode: add highlight options support to code_sample
1 parent c6e941d commit 5b4cbe3

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

layouts/shortcodes/code_sample.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{{ $p := .Page }}
22
{{ $file := .Get "file" }}
3+
{{ $opts := .Get "options" | default "" }}
34
{{ $codelang := .Get "language" | default (path.Ext $file | strings.TrimPrefix ".") }}
45
{{ $fileDir := path.Split $file }}
56
{{ $bundlePath := path.Join .Page.File.Dir $fileDir.Dir }}
@@ -34,7 +35,7 @@
3435
{{- end -}}
3536
</div>
3637
<div class="includecode" id="{{ $file | anchorize }}">
37-
{{- highlight . $codelang "" -}}
38+
{{- highlight . $codelang $opts -}}
3839
</div>
3940
</div>
4041
{{- end -}}

0 commit comments

Comments
 (0)