mirror of
https://github.com/gcushen/hugo-academic.git
synced 2025-07-23 18:10:52 +02:00
feat(tailwind): add include shortcode for re-usable Markdown blocks
This commit is contained in:
parent
776e5c09c0
commit
6b70757505
1 changed files with 23 additions and 0 deletions
23
modules/blox-tailwind/layouts/shortcodes/include.html
Normal file
23
modules/blox-tailwind/layouts/shortcodes/include.html
Normal file
|
@ -0,0 +1,23 @@
|
|||
{{- /*
|
||||
Docs: https://docs.hugoblox.com/reference/markdown/#include
|
||||
|
||||
Parameters
|
||||
----------
|
||||
postional parameter 0 :
|
||||
Path to the Markdown file to include, relative to the `content` folder.
|
||||
|
||||
Example
|
||||
----------
|
||||
{{% include "snippet/intro" %}}
|
||||
*/ -}}
|
||||
|
||||
{{- with .Get 0 }}
|
||||
{{- $page := . -}}
|
||||
{{- with site.GetPage $page }}
|
||||
{{- .RenderShortcodes }}
|
||||
{{- else }}
|
||||
{{- errorf "The %q shortcode at %s could not locate %q" $.Name $.Position (printf "content/%s.md" .) }}
|
||||
{{- end }}
|
||||
{{- else }}
|
||||
{{- errorf "Call the %q shortcode in %s with the path of the Markdown file to include." .Name .Position }}
|
||||
{{- end }}
|
Loading…
Add table
Add a link
Reference in a new issue