wip
This commit is contained in:
13
layouts/_shortcodes/file.html
Normal file
13
layouts/_shortcodes/file.html
Normal file
@@ -0,0 +1,13 @@
|
||||
{{- 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 -}}
|
||||
7
layouts/_shortcodes/icon.html
Normal file
7
layouts/_shortcodes/icon.html
Normal file
@@ -0,0 +1,7 @@
|
||||
<span class="icon">
|
||||
{{- $fname:=print "assets/icons/" ( .Get 0 ) ".svg" -}}
|
||||
{{- $path:="<path" -}}
|
||||
{{- $fill:="<path fill=\"currentColor\"" -}}
|
||||
{{- replace (readFile $fname) $path $fill | safeHTML -}}
|
||||
</span>
|
||||
{{- /**/ -}}
|
||||
5
layouts/_shortcodes/js.html
Normal file
5
layouts/_shortcodes/js.html
Normal file
@@ -0,0 +1,5 @@
|
||||
<div class="js-block">
|
||||
<pre class="source">source</div>
|
||||
<div class="in"><textarea onchange="js_block_run" style="width:100%"></textarea></div>
|
||||
<pre class="out">aaa</div>
|
||||
</div>
|
||||
Reference in New Issue
Block a user