feat: port 'cite' shortcode from Bootstrap module

Close #3226
This commit is contained in:
George Cushen committed 2025-08-17 22:40:37 +01:00
1 parent 0c41b518dc
commit 37518f31f5
2 files changed
+35

No files matched your search

@@ -0,0 +1,25 @@
{{/*
Docs: https://docs.hugoblox.com/content/writing-markdown-latex/#cite
Cite shortcode for Hugo Blox Builder.
Parameters
----------
page : required
Path to Markdown page to be referenced.
view : optional, default "citation"
A built-in Hugo Blox Builder view or an installed community view.
*/}}
{{ $page := .Page }}
{{ $item := .Get "page" }}
{{/* Default to citation view for Tailwind module */}}
{{ $view := (.Get "view") | default "citation" }}
{{ with site.GetPage $item }}
{{ partial "functions/render_view" (dict "page" $page "item" . "view" $view "index" 0) }}
{{ else }}
{{ warnf "Failed to find page for cite shortcode: %s" $item }}
{{ end }}
@@ -19,6 +19,16 @@ image:
On this page, you'll find some examples of the types of technical content that can be rendered with Hugo Blox.
## Citation
Here's an example of citing a publication using the cite shortcode:
{{< cite page="/publication/preprint" view="citation" >}}
You can also use the default view by omitting the view parameter:
{{< cite page="/publication/conference-paper" >}}
## Video
Teach your course by sharing videos with your students. Choose from one of the following approaches: