template installiert

This commit is contained in:
2026-10-17 08:45:08 +02:00
parent ec2da90945
commit 7532843b67
378 changed files with 13317 additions and 8 deletions
+22
View File
@@ -0,0 +1,22 @@
{{- $user := "" -}}
{{- $id := "" -}}
{{- $file := "" -}}
{{- if .IsNamedParams -}}
{{- $user = .Get "user" -}}
{{- $id = .Get "id" -}}
{{- $file = .Get "file" -}}
{{- else -}}
{{- $user = .Get 0 -}}
{{- $id = .Get 1 -}}
{{- if ge (len .Params) 3 -}}
{{- $file = .Get 2 -}}
{{- end -}}
{{- end -}}
{{- if or (not $user) (not $id) -}}
{{- errorf "The gist shortcode requires a GitHub user and gist ID in %q" .Page.File.Path -}}
{{- end -}}
{{- $src := printf "https://gist.github.com/%s/%s.js" $user $id -}}
{{- with $file -}}
{{- $src = printf "%s?file=%s" $src (. | urlquery) -}}
{{- end -}}
<script src="{{ $src | safeURL }}"></script>