mirror of
https://github.com/BBaoVanC/bobatheme.git
synced 2024-12-22 04:13:17 -06:00
Add include shortcode
This commit is contained in:
parent
60ed1c0264
commit
1f8a82228e
17
layouts/shortcodes/include.html
Normal file
17
layouts/shortcodes/include.html
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
{{ $path := "" }}
|
||||||
|
{{ $markdown := false }}
|
||||||
|
{{ if .IsNamedParams }}
|
||||||
|
{{ $path = .Get "path" }}
|
||||||
|
{{ with .Get "markdown" }}
|
||||||
|
{{ $markdown = . }}
|
||||||
|
{{ end }}
|
||||||
|
{{ else }}
|
||||||
|
{{ $path = .Get 0 }}
|
||||||
|
{{ end }}
|
||||||
|
|
||||||
|
|
||||||
|
{{ if $markdown }}
|
||||||
|
{{ $path | readFile | markdownify }}
|
||||||
|
{{ else }}
|
||||||
|
{{ $path | readFile }}
|
||||||
|
{{ end }}
|
Loading…
Reference in New Issue
Block a user