mirror of
https://github.com/davegallant/davegallant.github.io.git
synced 2025-08-06 08:43:40 +00:00
14 lines
451 B
HTML
14 lines
451 B
HTML
{{- if gt ( len .Params ) 1 -}}
|
|
{{- $.Scratch.Set "format" ( .Get 1 ) -}}
|
|
{{- else -}}
|
|
{{- $splits := ( split ( .Get 0 ) "." ) -}}
|
|
{{- $splitsLength := ( len $splits ) -}}
|
|
{{- $format := ( index $splits ( sub $splitsLength 1 ) ) -}}
|
|
{{- $.Scratch.Set "format" $format -}}
|
|
{{- end -}}
|
|
|
|
{{- $file := ( .Get 0 ) -}}
|
|
{{- $format := ( $.Scratch.Get "format" ) -}}
|
|
|
|
{{- ( print "```" $format "\n" ( readFile $file ) "\n" "```" ) | markdownify -}}
|