Skip to content

Commit 37518f3

Browse files
committed
feat: port 'cite' shortcode from Bootstrap module
Close #3226
1 parent 0c41b51 commit 37518f3

File tree

2 files changed

+35
-0
lines changed
  • modules/blox-tailwind/layouts/_shortcodes
  • starters/academic-cv/content/post/teach-courses

2 files changed

+35
-0
lines changed
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{{/*
2+
Docs: https://docs.hugoblox.com/content/writing-markdown-latex/#cite
3+
4+
Cite shortcode for Hugo Blox Builder.
5+
6+
Parameters
7+
----------
8+
page : required
9+
Path to Markdown page to be referenced.
10+
view : optional, default "citation"
11+
A built-in Hugo Blox Builder view or an installed community view.
12+
13+
*/}}
14+
15+
{{ $page := .Page }}
16+
{{ $item := .Get "page" }}
17+
18+
{{/* Default to citation view for Tailwind module */}}
19+
{{ $view := (.Get "view") | default "citation" }}
20+
21+
{{ with site.GetPage $item }}
22+
{{ partial "functions/render_view" (dict "page" $page "item" . "view" $view "index" 0) }}
23+
{{ else }}
24+
{{ warnf "Failed to find page for cite shortcode: %s" $item }}
25+
{{ end }}

starters/academic-cv/content/post/teach-courses/index.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,16 @@ image:
1919

2020
On this page, you'll find some examples of the types of technical content that can be rendered with Hugo Blox.
2121

22+
## Citation
23+
24+
Here's an example of citing a publication using the cite shortcode:
25+
26+
{{< cite page="/publication/preprint" view="citation" >}}
27+
28+
You can also use the default view by omitting the view parameter:
29+
30+
{{< cite page="/publication/conference-paper" >}}
31+
2232
## Video
2333

2434
Teach your course by sharing videos with your students. Choose from one of the following approaches:

0 commit comments

Comments
 (0)