Skip to content

Commit 0641175

Browse files
committed
feat: add maxHeight parameter for emgithub shortcode
Closes #84
1 parent fb24d64 commit 0641175

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

layouts/shortcodes/emgithub.html

+5
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
{{- $copyButton := default true site.Params.emgithub.copy_button }}
1111
{{- $fileMeta := default true site.Params.emgithub.file_meta }}
1212
{{- $jsDelivr := default false site.Params.emgithub.js_delivr }}
13+
{{- $maxHeight := 0 }}
1314
{{- if .IsNamedParams }}
1415
{{- $owner = .Get "owner" }}
1516
{{- $repo = .Get "repo" }}
@@ -27,6 +28,7 @@
2728
{{- end }}
2829
{{- if isset .Params "fileMeta" }}{{ $fileMeta = .Get "fileMeta" }}{{ end }}
2930
{{- if isset .Params "jsDelivr" }}{{ $jsDelivr = .Get "jsDelivr" }}{{ end }}
31+
{{- with .Get "maxHeight"}}{{ $maxHeight = . }}{{ end }}
3032
{{- else }}
3133
{{- $owner = .Get 0 }}
3234
{{- $repo = .Get 1 }}
@@ -45,5 +47,8 @@
4547
{{- if $jsDelivr }}
4648
{{- $params = $params | append "fetchFromJsDelivr" "on" }}
4749
{{- end }}
50+
{{- with $maxHeight }}
51+
{{- $params = $params | append "maxHeight" . }}
52+
{{- end }}
4853
{{- $endpoint := default "https://emgithub.com/embed-v2.js" site.Params.emgithub.endpoint }}
4954
<script src="{{ printf `%s?%s` $endpoint ($params | querify) }}"></script>

0 commit comments

Comments
 (0)