From 56b54a5e18dd5601ad6f57e6ff180ca0773d17f6 Mon Sep 17 00:00:00 2001 From: Agriya Khetarpal <74401230+agriyakhetarpal@users.noreply.github.com> Date: Tue, 29 Apr 2025 19:46:53 +0530 Subject: [PATCH 01/15] Use a new Unsplash link for cute puppies' image --- layouts/shortcodes/figure.html | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/layouts/shortcodes/figure.html b/layouts/shortcodes/figure.html index f071ce07..19566284 100644 --- a/layouts/shortcodes/figure.html +++ b/layouts/shortcodes/figure.html @@ -3,13 +3,13 @@ doc: Figures {{< figure >}} -src = 'https://source.unsplash.com/200x200/daily?cute+puppy' +src = 'https://images.unsplash.com/photo-1546238232-20216dec9f72' alt = 'Cute puppies' height = 200 width = 200 title = 'Figure title' -attribution = 'Figure Credits: Daily cute puppy image from unslash.com' -attributionlink = 'https://source.unsplash.com/200x200/daily?cute+puppy' +attribution = 'Figure Credits: Cute puppies image from unsplash.com' +attributionlink = 'https://images.unsplash.com/photo-1546238232-20216dec9f72' caption = ''' A figure is an image with a caption. Figures may also include a tile, legend, and/or attribution. ''' @@ -21,10 +21,10 @@ {{< /figure >}} {{< figure >}} -src = 'https://source.unsplash.com/200x200/daily?cute+puppy' +src = 'https://images.unsplash.com/photo-1546238232-20216dec9f72' alt = 'Cute puppies' -attribution = 'from unslash.com' -attributionlink = 'https://source.unsplash.com/200x200/daily?cute+puppy' +attribution = 'Figure Credits: Cute puppies image from unsplash.com' +attributionlink = 'https://images.unsplash.com/photo-1546238232-20216dec9f72' align = 'left' height = 150 width = 150 From 52adf59ae939fc9ade31b8e4288bfb77b47044aa Mon Sep 17 00:00:00 2001 From: Agriya Khetarpal <74401230+agriyakhetarpal@users.noreply.github.com> Date: Tue, 29 Apr 2025 19:52:28 +0530 Subject: [PATCH 02/15] Allow parameters inside the shortcode --- layouts/shortcodes/figure.html | 27 ++++++++++++++++++++++----- 1 file changed, 22 insertions(+), 5 deletions(-) diff --git a/layouts/shortcodes/figure.html b/layouts/shortcodes/figure.html index 19566284..dc7e494d 100644 --- a/layouts/shortcodes/figure.html +++ b/layouts/shortcodes/figure.html @@ -39,14 +39,31 @@ */}} -{{- $figure := .Inner | transform.Unmarshal -}} +{{- $useParams := true -}} +{{- $figure := dict -}} + +{{- if strings.TrimSpace .Inner -}} + {{- if not .IsNamedParams -}} + {{- $useParams = false -}} + {{- $figure = .Inner | transform.Unmarshal -}} + {{- end -}} +{{- end -}} + +{{/* If we're using params, collect them. */}} +{{- if $useParams -}} + {{- range $key, $value := .Params -}} + {{- $figure = merge $figure (dict $key $value) -}} + {{- end -}} +{{- end -}} + {{- $align := default "default" $figure.align -}} {{- $id := printf "id%03d" $.Ordinal -}} +
-{{- $m := newScratch -}} -{{- $m.Set "image" $figure -}} -{{- $m.SetInMap "image" "align" "center" -}} -{{ partial "_elements/image.html" (dict "data" $m.Values.image) }} +{{/* Create a clean copy of figure data with align center for image */}} +{{- $image := merge $figure (dict "align" "center") -}} +{{ partial "_elements/image.html" (dict "data" $image) }} +
{{- with $figure.title -}} {{ . }}#
From f7d4bc0dd71fca34baa23c1b76e06f60bbdbc066 Mon Sep 17 00:00:00 2001 From: Agriya Khetarpal <74401230+agriyakhetarpal@users.noreply.github.com> Date: Tue, 29 Apr 2025 19:55:56 +0530 Subject: [PATCH 03/15] Add docs on named parameters usage --- layouts/shortcodes/figure.html | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/layouts/shortcodes/figure.html b/layouts/shortcodes/figure.html index dc7e494d..baed3be0 100644 --- a/layouts/shortcodes/figure.html +++ b/layouts/shortcodes/figure.html @@ -37,6 +37,24 @@ Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. +This shortcode can also be used with named parameters. The following example shows how to do so: + +{{< figure +src = "https://images.unsplash.com/photo-1546238232-20216dec9f72" +alt = "Cute puppies" +attribution = "Figure Credits: Cute puppies image from unsplash.com" +attributionlink = 'https://images.unsplash.com/photo-1546238232-20216dec9f72' +align = "right" +height = "150" +width = "150" +caption = "A figure with right alignment." >}} + +{{< /figure >}} + +Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. + +Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. + */}} {{- $useParams := true -}} From 25d1decf27275aaddb60e616c7e3e8728ea8429b Mon Sep 17 00:00:00 2001 From: Agriya Khetarpal <74401230+agriyakhetarpal@users.noreply.github.com> Date: Tue, 29 Apr 2025 19:59:00 +0530 Subject: [PATCH 04/15] Use double quotes everywhere --- layouts/shortcodes/figure.html | 37 +++++++++++++++++----------------- 1 file changed, 19 insertions(+), 18 deletions(-) diff --git a/layouts/shortcodes/figure.html b/layouts/shortcodes/figure.html index baed3be0..9156ba4d 100644 --- a/layouts/shortcodes/figure.html +++ b/layouts/shortcodes/figure.html @@ -3,13 +3,13 @@ doc: Figures {{< figure >}} -src = 'https://images.unsplash.com/photo-1546238232-20216dec9f72' -alt = 'Cute puppies' +src = "https://images.unsplash.com/photo-1546238232-20216dec9f72" +alt = "Cute puppies" height = 200 width = 200 -title = 'Figure title' -attribution = 'Figure Credits: Cute puppies image from unsplash.com' -attributionlink = 'https://images.unsplash.com/photo-1546238232-20216dec9f72' +title = "Figure title" +attribution = "Figure Credits: Cute puppies image from unsplash.com" +attributionlink = "https://images.unsplash.com/photo-1546238232-20216dec9f72" caption = ''' A figure is an image with a caption. Figures may also include a tile, legend, and/or attribution. ''' @@ -21,11 +21,11 @@ {{< /figure >}} {{< figure >}} -src = 'https://images.unsplash.com/photo-1546238232-20216dec9f72' -alt = 'Cute puppies' -attribution = 'Figure Credits: Cute puppies image from unsplash.com' -attributionlink = 'https://images.unsplash.com/photo-1546238232-20216dec9f72' -align = 'left' +src = "https://images.unsplash.com/photo-1546238232-20216dec9f72" +alt = "Cute puppies" +attribution = "Figure Credits: Cute puppies image from unsplash.com" +attributionlink = "https://images.unsplash.com/photo-1546238232-20216dec9f72" +align = "left" height = 150 width = 150 caption = ''' @@ -40,14 +40,15 @@ This shortcode can also be used with named parameters. The following example shows how to do so: {{< figure -src = "https://images.unsplash.com/photo-1546238232-20216dec9f72" -alt = "Cute puppies" -attribution = "Figure Credits: Cute puppies image from unsplash.com" -attributionlink = 'https://images.unsplash.com/photo-1546238232-20216dec9f72' -align = "right" -height = "150" -width = "150" -caption = "A figure with right alignment." >}} + src = "https://images.unsplash.com/photo-1546238232-20216dec9f72" + alt = "Cute puppies" + attribution = "Figure Credits: Cute puppies image from unsplash.com" + attributionlink = "https://images.unsplash.com/photo-1546238232-20216dec9f72" + align = "right" + height = 150 + width = 150 + caption = "A figure with right alignment." +>}} {{< /figure >}} From 3a5fac738a2261883197843ad58edbf6d226bc56 Mon Sep 17 00:00:00 2001 From: Agriya Khetarpal <74401230+agriyakhetarpal@users.noreply.github.com> Date: Wed, 30 Apr 2025 08:07:59 +0530 Subject: [PATCH 05/15] Replace more broken images with new cute puppies --- layouts/shortcodes/figure.html | 16 ++++++++-------- layouts/shortcodes/grid.html | 6 +++--- layouts/shortcodes/image.html | 12 +++++++----- layouts/shortcodes/sidebar.html | 2 +- 4 files changed, 19 insertions(+), 17 deletions(-) diff --git a/layouts/shortcodes/figure.html b/layouts/shortcodes/figure.html index 9156ba4d..a4431473 100644 --- a/layouts/shortcodes/figure.html +++ b/layouts/shortcodes/figure.html @@ -3,13 +3,13 @@ doc: Figures {{< figure >}} -src = "https://images.unsplash.com/photo-1546238232-20216dec9f72" -alt = "Cute puppies" +src = 'https://images.unsplash.com/photo-1546238232-20216dec9f72' +alt = 'Cute puppies' height = 200 -width = 200 -title = "Figure title" -attribution = "Figure Credits: Cute puppies image from unsplash.com" -attributionlink = "https://images.unsplash.com/photo-1546238232-20216dec9f72" +width = 400 +title = 'Figure title' +attribution = 'Figure Credits: Cute puppies image from unsplash.com' +attributionlink = 'https://images.unsplash.com/photo-1546238232-20216dec9f72' caption = ''' A figure is an image with a caption. Figures may also include a tile, legend, and/or attribution. ''' @@ -27,7 +27,7 @@ attributionlink = "https://images.unsplash.com/photo-1546238232-20216dec9f72" align = "left" height = 150 -width = 150 +width = 300 caption = ''' A figure with left alignment. ''' @@ -46,7 +46,7 @@ attributionlink = "https://images.unsplash.com/photo-1546238232-20216dec9f72" align = "right" height = 150 - width = 150 + width = 300 caption = "A figure with right alignment." >}} diff --git a/layouts/shortcodes/grid.html b/layouts/shortcodes/grid.html index 5f1b2cb6..f94dac80 100644 --- a/layouts/shortcodes/grid.html +++ b/layouts/shortcodes/grid.html @@ -68,7 +68,7 @@ header = 'A clickable image card' link = 'https://example.com' body = '''{{< image >}} -src = 'https://source.unsplash.com/200x200/daily?cute+puppy' +src = 'https://images.unsplash.com/photo-1546238232-20216dec9f72' alt = 'Cute puppies' {{< /image >}}''' @@ -77,7 +77,7 @@ classcard = 'text-center' link = 'https://example.com' body = '''{{< image >}} -src = 'https://source.unsplash.com/200x200/daily?cute+puppy' +src = 'https://images.unsplash.com/photo-1546238232-20216dec9f72' alt = 'Cute puppies' {{< /image >}} @@ -87,7 +87,7 @@ type = 'card' link = 'https://example.com' body = '''{{< image >}} -src = 'https://source.unsplash.com/200x200/daily?cute+puppy' +src = 'https://images.unsplash.com/photo-1546238232-20216dec9f72' alt = 'Cute puppies' {{< /image >}}''' footer = 'A clickable figure card' diff --git a/layouts/shortcodes/image.html b/layouts/shortcodes/image.html index 150cde29..96676034 100644 --- a/layouts/shortcodes/image.html +++ b/layouts/shortcodes/image.html @@ -3,28 +3,30 @@ doc: Images {{< image >}} -src = 'https://source.unsplash.com/200x200/daily?cute+puppy' +src = 'https://images.unsplash.com/photo-1546238232-20216dec9f72' alt = 'Cute puppies' +height = 200 +width = 400 {{< /image >}} A clickable image: {{< image >}} -src = 'https://source.unsplash.com/200x200/daily?cute+puppy' +src = 'https://images.unsplash.com/photo-1546238232-20216dec9f72' alt = 'Cute puppies' target = 'https://unsplash.com/' height = 200 -width = 200 +width = 400 {{< /image >}} Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. {{< image >}} -src = 'https://source.unsplash.com/200x200/daily?cute+puppy' +src = 'https://images.unsplash.com/photo-1546238232-20216dec9f72' alt = 'Cute puppies' align = 'right' height = 200 -width = 200 +width = 400 loading = 'lazy' {{< /image >}} diff --git a/layouts/shortcodes/sidebar.html b/layouts/shortcodes/sidebar.html index 85e1949c..9952c767 100644 --- a/layouts/shortcodes/sidebar.html +++ b/layouts/shortcodes/sidebar.html @@ -5,7 +5,7 @@ {{< sidebar title="Ch’ien / The Creative" >}} Lorem ipsum dolor sit amet, consectetur adipisicing elit. {{< image >}} -src = 'https://source.unsplash.com/200x200/daily?cute+puppy' +src = 'https://images.unsplash.com/photo-1546238232-20216dec9f72' alt = 'Cute puppies' align = 'center' {{< /image >}} From 45be580725982a312eb4cb0671a0d000bdf600fa Mon Sep 17 00:00:00 2001 From: Agriya Khetarpal <74401230+agriyakhetarpal@users.noreply.github.com> Date: Wed, 30 Apr 2025 10:41:50 +0530 Subject: [PATCH 06/15] Plainify, fix bug with rendered content --- layouts/shortcodes/figure.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/layouts/shortcodes/figure.html b/layouts/shortcodes/figure.html index a4431473..737400ab 100644 --- a/layouts/shortcodes/figure.html +++ b/layouts/shortcodes/figure.html @@ -91,7 +91,7 @@ {{- with $figure.attributionlink -}}{{- end -}}{{- $figure.attribution -}}{{- if $figure.attributionlink -}}{{- end -}} {{- end }}

-{{- $figure.caption | markdownify -}} +{{- $figure.caption | markdownify | plainify -}} {{- with $figure.legend }}

From ac7705960fc68177988a6dedcc2249bbd0a276de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gonzalo=20Pe=C3=B1a-Castellanos?= Date: Mon, 12 May 2025 19:48:37 -0500 Subject: [PATCH 07/15] Move figure, image, dropdown and button to be inline shortcodes only --- .gitignore | 2 + doc/content/about/theme-team.toml | 42 +++---- doc/content/user_guide/web-components.md | 110 ++++++++--------- layouts/shortcodes/button.html | 146 +++++++++++------------ layouts/shortcodes/card.html | 9 +- layouts/shortcodes/dropdown.html | 65 +++++----- layouts/shortcodes/figure.html | 83 +++++-------- layouts/shortcodes/grid.html | 36 +++--- layouts/shortcodes/image.html | 46 +++---- layouts/shortcodes/sidebar.html | 12 +- tools/team_query.py | 8 +- 11 files changed, 265 insertions(+), 294 deletions(-) diff --git a/.gitignore b/.gitignore index e0d12fb7..0d1c931c 100644 --- a/.gitignore +++ b/.gitignore @@ -9,3 +9,5 @@ public # vim droppings .*.swp + +.DS_Store diff --git a/doc/content/about/theme-team.toml b/doc/content/about/theme-team.toml index 2c377af9..baf17602 100644 --- a/doc/content/about/theme-team.toml +++ b/doc/content/about/theme-team.toml @@ -1,49 +1,49 @@ [[item]] type = 'card' classcard = 'text-center' -body = '''{{< image >}} -src = 'https://avatars.githubusercontent.com/u/601365?v=4"' -alt = 'Avatar of Adam Porter' -{{< /image >}} -Adam Porter''' +body = ''' +{{< image + src='https://avatars.githubusercontent.com/u/601365?v=4"' + alt="Avatar of Adam Porter" >}} +Adam Porter +''' link = 'https://github.com/alphapapa' [[item]] type = 'card' classcard = 'text-center' -body = '''{{< image >}} -src = 'https://avatars.githubusercontent.com/u/352264?u=1fd523aa28b0451454989400579d97a8c1bc1b9a&v=4"' -alt = 'Avatar of Brian Hawthorne' -{{< /image >}} +body = ''' +{{< image + src='https://avatars.githubusercontent.com/u/352264?u=1fd523aa28b0451454989400579d97a8c1bc1b9a&v=4"' + alt="Avatar of Brian Hawthorne" >}} Brian Hawthorne''' link = 'https://github.com/brianhawthorne' [[item]] type = 'card' classcard = 'text-center' -body = '''{{< image >}} -src = 'https://avatars.githubusercontent.com/u/123428?v=4"' -alt = 'Avatar of Jarrod Millman' -{{< /image >}} +body = ''' +{{< image + src='https://avatars.githubusercontent.com/u/123428?v=4"' + alt="Avatar of Jarrod Millman" >}} Jarrod Millman''' link = 'https://github.com/jarrodmillman' [[item]] type = 'card' classcard = 'text-center' -body = '''{{< image >}} -src = 'https://avatars.githubusercontent.com/u/45071?u=c779b5e06448fbc638bc987cdfe305c7f9a7175e&v=4"' -alt = 'Avatar of Stefan van der Walt' -{{< /image >}} +body = ''' +{{< image + src='https://avatars.githubusercontent.com/u/45071?u=c779b5e06448fbc638bc987cdfe305c7f9a7175e&v=4"' + alt="Avatar of Stefan van der Walt" >}} Stefan van der Walt''' link = 'https://github.com/stefanv' [[item]] type = 'card' classcard = 'text-center' -body = '''{{< image >}} -src = 'https://avatars.githubusercontent.com/u/23188539?u=64445b52dbf3f75de8006ed4264fdd2afaed97a3&v=4"' -alt = 'Avatar of Pamphile Roy' -{{< /image >}} +body = '''{{< image + src='https://avatars.githubusercontent.com/u/23188539?u=64445b52dbf3f75de8006ed4264fdd2afaed97a3&v=4"' + alt="Avatar of Pamphile Roy" >}} Pamphile Roy''' link = 'https://github.com/tupui' diff --git a/doc/content/user_guide/web-components.md b/doc/content/user_guide/web-components.md index 25d5ca23..4b931538 100644 --- a/doc/content/user_guide/web-components.md +++ b/doc/content/user_guide/web-components.md @@ -50,40 +50,40 @@ success outline Here are some of the available button-style links, also using semantic colors: -{{< button info >}} -label: Info -link: http://example.com/ -{{< /button >}} - -{{< button success >}} -label: Success -link: http://example.com/ -{{< /button >}} - -{{< button warning >}} -label: Warning -link: http://example.com/ -{{< /button >}} - -{{< button danger >}} -label: Danger -link: http://example.com/ -{{< /button >}} - -{{< button muted >}} -label: Muted -link: http://example.com/ -{{< /button >}} - -{{< button light >}} -label: Light -link: http://example.com/ -{{< /button >}} - -{{< button dark >}} -label: Dark -link: http://example.com/ -{{< /button >}} +{{< button + style="info" + label="Info" + link="http://example.com/" >}} + +{{< button + style="success" + label="Success" + link="http://example.com/" >}} + +{{< button + style="warning" + label="Warning" + link="http://example.com/" >}} + +{{< button + style="danger" + label="Danger" + link="http://example.com/" >}} + +{{< button + style="muted" + label="Muted" + link="http://example.com/" >}} + +{{< button + style="light" + label="Light" + link="http://example.com/" >}} + +{{< button + style="dark" + label="Dark" + link="http://example.com/" >}} {{< admonition note >}} [Sphinx Design @@ -134,11 +134,10 @@ Content of the third card. {{< card >}} title = 'A card with a dropdown menu' body = ''' -{{< dropdown >}} -title = 'Click to expand dropdown' -icon = 'fa-solid fa-eye' -body = 'Hidden content' -{{< /dropdown >}} +{{< dropdown + title="Click to expand dropdown" + icon="fa-solid fa-eye" + body="Hidden content" >}} ''' {{< /card >}} @@ -284,32 +283,27 @@ And some admonition content. {{< dropdown >}} body = 'And with no title and some content!' -{{< /dropdown >}} -{{< dropdown >}} -title = 'With a title' -body = 'And some content!' -{{< /dropdown >}} +{{< dropdown + title="With a title" + body="And some content!" >}} {{< dropdown >}} -title = 'With a title and icon' -icon = 'fa-solid fa-lock-open' -body = 'And some content and an icon!' -{{< /dropdown >}} +title="With a title and icon" +icon="fa-solid fa-lock-open" +body="And some content and an icon!" >}} {{< dropdown >}} -title = 'A primary color dropdown' -icon = 'fa-solid fa-lock-open' -color = 'primary' -body = 'And some content and an icon!' -{{< /dropdown >}} +title="A primary color dropdown" +icon="fa-solid fa-lock-open" +color="primary" +body="And some content and an icon!" >}} {{< dropdown >}} -title = 'A secondary color dropdown' -icon = 'fa-solid fa-eye' -color = 'secondary' -body = 'And some content and an icon!' -{{< /dropdown >}} +title="A secondary color dropdown" +icon="fa-solid fa-eye" +color="secondary" +body="And some content and an icon!" >}} ## Copybuttons diff --git a/layouts/shortcodes/button.html b/layouts/shortcodes/button.html index e8d03713..bec6d05b 100644 --- a/layouts/shortcodes/button.html +++ b/layouts/shortcodes/button.html @@ -2,83 +2,83 @@ doc: Create button links in various styles. -{{< button info >}} -label: Info -link: http://example.com/ -{{< /button >}} - -{{< button success >}} -label: Success -link: http://example.com/ -{{< /button >}} - -{{< button warning >}} -label: Warning -link: http://example.com/ -{{< /button >}} - -{{< button danger >}} -label: Danger -link: http://example.com/ -{{< /button >}} - -{{< button muted >}} -label: Muted -link: http://example.com/ -{{< /button >}} - -{{< button light >}} -label: Light -link: http://example.com/ -{{< /button >}} - -{{< button dark >}} -label: Dark -link: http://example.com/ -{{< /button >}} +{{< button + style="info" + label="Info" + link="http://example.com/" >}} + +{{< button + style="success" + label="Success" + link="http://example.com/" >}} + +{{< button + style="warning" + label="Warning" + link="http://example.com/" >}} + +{{< button + style="danger" + label="Danger" + link="http://example.com/" >}} + +{{< button + style="muted" + label="Muted" + link="http://example.com/" >}} + +{{< button + style="light" + label="Light" + link="http://example.com/" >}} + +{{< button + style="dark" + label="Dark" + link="http://example.com/" >}}

-{{< button outline-info >}} -label: Info -link: http://example.com/ -{{< /button >}} - -{{< button outline-success >}} -label: Success -link: http://example.com/ -{{< /button >}} - -{{< button outline-warning >}} -label: Warning -link: http://example.com/ -{{< /button >}} - -{{< button outline-danger >}} -label: Danger -link: http://example.com/ -{{< /button >}} - -{{< button outline-muted >}} -label: Muted -link: http://example.com/ -{{< /button >}} - -{{< button outline-light >}} -label: Light -link: http://example.com/ -{{< /button >}} - -{{< button outline-dark >}} -label: Dark -link: http://example.com/ -{{< /button >}} +{{< button + style="outline-info" + label="Info" + link="http://example.com/" >}} + +{{< button + style="outline-success" + label="Success" + link="http://example.com/" >}} + +{{< button + style="outline-warning" + label="Warning" + link="http://example.com/" >}} + +{{< button + style="outline-danger" + label="Danger" + link="http://example.com/" >}} + +{{< button + style="outline-muted" + label="Muted" + link="http://example.com/" >}} + +{{< button + style="outline-light" + label="Light" + link="http://example.com/" >}} + +{{< button + style="outline-dark" + label="Dark" + link="http://example.com/" >}} */}} -{{ $button_style := .Get 0 }} -{{ $button_data := transform.Unmarshal .Inner }} -{{ $button_label := $button_data.label }} -{{ $button_link := $button_data.link }} +{{- $button := dict -}} +{{- range $key, $value := .Params -}} +{{- $button = merge $button (dict $key $value) -}} +{{- end -}} -{{$button_label}} +{{$button.label}} diff --git a/layouts/shortcodes/card.html b/layouts/shortcodes/card.html index 6f655fac..63a5eebf 100644 --- a/layouts/shortcodes/card.html +++ b/layouts/shortcodes/card.html @@ -26,11 +26,10 @@ {{< card >}} title = 'A card with a dropdown menu' body = ''' -{{< dropdown >}} -title = 'Click to expand dropdown' -icon = 'fa-solid fa-eye' -body = 'Hidden content' -{{< /dropdown >}} +{{< dropdown + title="Click to expand dropdown" + icon="fa-solid fa-eye" + body="Hidden content" >}} ''' {{< /card >}} diff --git a/layouts/shortcodes/dropdown.html b/layouts/shortcodes/dropdown.html index 645aab89..3f2e81ef 100644 --- a/layouts/shortcodes/dropdown.html +++ b/layouts/shortcodes/dropdown.html @@ -2,55 +2,54 @@ doc: Dropdowns -{{< dropdown >}} -body = 'And with no title and some content!' -{{< /dropdown >}} - -{{< dropdown >}} -title = 'With a title' -body = 'And some content!' -{{< /dropdown >}} - -{{< dropdown >}} -title = 'With a title and icon' -icon = 'fa-solid fa-lock-open' -body = 'And some content and an icon!' -{{< /dropdown >}} - -{{< dropdown >}} -title = 'A primary color dropdown' -icon = 'fa-solid fa-lock-open' -color = 'primary' -body = 'And some content and an icon!' -{{< /dropdown >}} - -{{< dropdown >}} -title = 'A secondary color dropdown' -icon = 'fa-solid fa-eye' -color = 'secondary' -body = 'And some content and an icon!' -{{< /dropdown >}} +{{< dropdown + body="And with no title and some content!" >}} + +{{< dropdown + title="With a title" + body="And some content!" >}} + +{{< dropdown + title="With a title and icon" + icon="fa-solid fa-lock-open" + body="And some content and an icon!" >}} + +{{< dropdown + title="A primary color dropdown" + icon="fa-solid fa-lock-open" + color="primary" + body="And some content and an icon!" >}} + +{{< dropdown + title="A secondary color dropdown" + icon="fa-solid fa-eye" + color="secondary" + body="And some content and an icon!" >}} */}} -{{- $data := .Inner | transform.Unmarshal -}} +{{- $dropdown := dict -}} +{{- range $key, $value := .Params -}} +{{- $dropdown = merge $dropdown (dict $key $value) -}} +{{- end -}} +

- {{- with $data.color }} + {{- with $dropdown.color }} {{- else }} {{- end }} - {{- with $data.icon }} + {{- with $dropdown.icon }} {{- end }} - {{- with $data.title }} + {{- with $dropdown.title }} {{- . }} {{- else }}   {{- end }}
- {{- with (trim $data.body "\n") }} + {{- with (trim $dropdown.body "\n") }} {{- . | markdownify }} {{- end }}
diff --git a/layouts/shortcodes/figure.html b/layouts/shortcodes/figure.html index 737400ab..2dce10bb 100644 --- a/layouts/shortcodes/figure.html +++ b/layouts/shortcodes/figure.html @@ -2,36 +2,26 @@ doc: Figures -{{< figure >}} -src = 'https://images.unsplash.com/photo-1546238232-20216dec9f72' -alt = 'Cute puppies' -height = 200 -width = 400 -title = 'Figure title' -attribution = 'Figure Credits: Cute puppies image from unsplash.com' -attributionlink = 'https://images.unsplash.com/photo-1546238232-20216dec9f72' -caption = ''' -A figure is an image with a caption. Figures may also include a tile, legend, and/or attribution. -''' -legend = ''' -**TODO: use tomltotable (https://github.com/scientific-python/scientific-python-hugo-theme/pull/548)** - -This paragraph is also part of the legend. -''' -{{< /figure >}} +{{< figure + src="https://images.unsplash.com/photo-1546238232-20216dec9f72" + alt="Cute puppies" + height=200 + width=400 + title="Figure title" + attribution="Figure Credits: Cute puppies image from unsplash.com" + attributionlink="https://images.unsplash.com/photo-1546238232-20216dec9f72" + caption="A figure is an image with a caption. Figures may also include a tile, legend, and/or attribution." + legend="**TODO: use tomltotable (https://github.com/scientific-python/scientific-python-hugo-theme/pull/548)**
This paragraph is also part of the legend." >}} -{{< figure >}} -src = "https://images.unsplash.com/photo-1546238232-20216dec9f72" -alt = "Cute puppies" -attribution = "Figure Credits: Cute puppies image from unsplash.com" -attributionlink = "https://images.unsplash.com/photo-1546238232-20216dec9f72" -align = "left" -height = 150 -width = 300 -caption = ''' -A figure with left alignment. -''' -{{< /figure >}} +{{< figure + src="https://images.unsplash.com/photo-1546238232-20216dec9f72" + alt="Cute puppies" + attribution="Figure Credits: Cute puppies image from unsplash.com" + attributionlink="https://images.unsplash.com/photo-1546238232-20216dec9f72" + align="left" + height=150 + width=300 + caption="A figure with left alignment." >}} Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. @@ -40,17 +30,14 @@ This shortcode can also be used with named parameters. The following example shows how to do so: {{< figure - src = "https://images.unsplash.com/photo-1546238232-20216dec9f72" - alt = "Cute puppies" - attribution = "Figure Credits: Cute puppies image from unsplash.com" - attributionlink = "https://images.unsplash.com/photo-1546238232-20216dec9f72" - align = "right" - height = 150 - width = 300 - caption = "A figure with right alignment." ->}} - -{{< /figure >}} + src="https://images.unsplash.com/photo-1546238232-20216dec9f72" + alt="Cute puppies" + attribution="Figure Credits: Cute puppies image from unsplash.com" + attributionlink="https://images.unsplash.com/photo-1546238232-20216dec9f72" + align="right" + height=150 + width=300 + caption="A figure with right alignment." >}} Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. @@ -58,21 +45,10 @@ */}} -{{- $useParams := true -}} {{- $figure := dict -}} -{{- if strings.TrimSpace .Inner -}} - {{- if not .IsNamedParams -}} - {{- $useParams = false -}} - {{- $figure = .Inner | transform.Unmarshal -}} - {{- end -}} -{{- end -}} - -{{/* If we're using params, collect them. */}} -{{- if $useParams -}} - {{- range $key, $value := .Params -}} - {{- $figure = merge $figure (dict $key $value) -}} - {{- end -}} +{{- range $key, $value := .Params -}} +{{- $figure = merge $figure (dict $key $value) -}} {{- end -}} {{- $align := default "default" $figure.align -}} @@ -82,7 +58,6 @@ {{/* Create a clean copy of figure data with align center for image */}} {{- $image := merge $figure (dict "align" "center") -}} {{ partial "_elements/image.html" (dict "data" $image) }} -
{{- with $figure.title -}} {{ . }}#
diff --git a/layouts/shortcodes/grid.html b/layouts/shortcodes/grid.html index f94dac80..bfa18cf4 100644 --- a/layouts/shortcodes/grid.html +++ b/layouts/shortcodes/grid.html @@ -49,11 +49,10 @@ type = 'card' title = 'A card with a dropdown menu' body = ''' -{{< dropdown >}} -title = 'Click to expand dropdown' -icon = 'fa-solid fa-eye' -body = 'Hidden content' -{{< /dropdown >}} +{{< dropdown + title="Click to expand dropdown" + icon="fa-solid fa-eye" + body="Hidden content" >}} ''' [[item]] @@ -66,30 +65,31 @@ [[item]] type = 'card' header = 'A clickable image card' -link = 'https://example.com' -body = '''{{< image >}} -src = 'https://images.unsplash.com/photo-1546238232-20216dec9f72' -alt = 'Cute puppies' -{{< /image >}}''' +link='https://example.com' +body=''' +{{< image + src="https://images.unsplash.com/photo-1546238232-20216dec9f72" + alt="Cute puppies" >}} +''' [[item]] type = 'card' classcard = 'text-center' link = 'https://example.com' -body = '''{{< image >}} -src = 'https://images.unsplash.com/photo-1546238232-20216dec9f72' -alt = 'Cute puppies' -{{< /image >}} +body = ''' +{{< image + src="https://images.unsplash.com/photo-1546238232-20216dec9f72" + alt="Cute puppies" >}} A clickable figure card''' [[item]] type = 'card' link = 'https://example.com' -body = '''{{< image >}} -src = 'https://images.unsplash.com/photo-1546238232-20216dec9f72' -alt = 'Cute puppies' -{{< /image >}}''' +body = ''' +{{< image + src="https://images.unsplash.com/photo-1546238232-20216dec9f72" + alt="Cute puppies" >}}''' footer = 'A clickable figure card' {{< /grid >}} diff --git a/layouts/shortcodes/image.html b/layouts/shortcodes/image.html index 96676034..2dd91319 100644 --- a/layouts/shortcodes/image.html +++ b/layouts/shortcodes/image.html @@ -2,33 +2,30 @@ doc: Images -{{< image >}} -src = 'https://images.unsplash.com/photo-1546238232-20216dec9f72' -alt = 'Cute puppies' -height = 200 -width = 400 -{{< /image >}} +{{< image + src="https://images.unsplash.com/photo-1546238232-20216dec9f72" + alt="Cute puppies" + height=200 + width=400 >}} A clickable image: -{{< image >}} -src = 'https://images.unsplash.com/photo-1546238232-20216dec9f72' -alt = 'Cute puppies' -target = 'https://unsplash.com/' -height = 200 -width = 400 -{{< /image >}} +{{< image + src="https://images.unsplash.com/photo-1546238232-20216dec9f72" + alt="Cute puppies" + target="https://unsplash.com/" + height=200 + width=400 >}} Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. -{{< image >}} -src = 'https://images.unsplash.com/photo-1546238232-20216dec9f72' -alt = 'Cute puppies' -align = 'right' -height = 200 -width = 400 -loading = 'lazy' -{{< /image >}} +{{< image + src="https://images.unsplash.com/photo-1546238232-20216dec9f72" + alt="Cute puppies" + align="right" + height=200 + width=400 + loading="lazy" >}} Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. @@ -36,5 +33,8 @@ */}} -{{- $data := .Inner | transform.Unmarshal -}} -{{- partial "_elements/image.html" (dict "data" $data) -}} +{{- $image := dict -}} +{{- range $key, $value := .Params -}} +{{- $image = merge $image (dict $key $value) -}} +{{- end -}} +{{- partial "_elements/image.html" (dict "data" $image) -}} diff --git a/layouts/shortcodes/sidebar.html b/layouts/shortcodes/sidebar.html index 9952c767..f707cc1d 100644 --- a/layouts/shortcodes/sidebar.html +++ b/layouts/shortcodes/sidebar.html @@ -3,14 +3,16 @@ doc: Create sidebars {{< sidebar title="Ch’ien / The Creative" >}} + Lorem ipsum dolor sit amet, consectetur adipisicing elit. -{{< image >}} -src = 'https://images.unsplash.com/photo-1546238232-20216dec9f72' -alt = 'Cute puppies' -align = 'center' -{{< /image >}} + +{{< image + src="https://images.unsplash.com/photo-1546238232-20216dec9f72" + alt="Cute puppies" + align="center" >}} Lorem ipsum dolor sit amet, consectetur adipisicing elit. + {{< /sidebar >}} Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor diff --git a/tools/team_query.py b/tools/team_query.py index 10c86aaa..7a366c17 100644 --- a/tools/team_query.py +++ b/tools/team_query.py @@ -66,10 +66,10 @@ def api(query): [[item]] type = 'card' classcard = 'text-center' -body = '''{{< image >}} -src = '${avatarUrl}"' -alt = 'Avatar of ${name}' -{{< /image >}} +body = ''' +{{< image + src="${avatarUrl}" + alt="Avatar of ${name}" >}} ${name}''' link = '${url}' """ From cd16575aa4b1aab7e91b1f2d2ee6c9b6b385c383 Mon Sep 17 00:00:00 2001 From: Agriya Khetarpal <74401230+agriyakhetarpal@users.noreply.github.com> Date: Tue, 13 May 2025 22:22:13 +0530 Subject: [PATCH 08/15] Fix incorrect conversion of closing tags to blockquotes --- tools/render_shortcode_docs.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/render_shortcode_docs.py b/tools/render_shortcode_docs.py index 5f8e03a7..f1522636 100644 --- a/tools/render_shortcode_docs.py +++ b/tools/render_shortcode_docs.py @@ -47,8 +47,10 @@ def shortcode_doc(fn): example = ( code.replace("{{< ", "{{}}", " */>}}") + .replace("\n>}}", "\n*/>}}") .replace("{{% ", "{{%/* ") .replace(" %}}", " */%}}") + .replace("\n%}}", "\n*/%}}") ) # Process rendering options. From 5d1d79b9bbdb57422c4d3a001da5d67408ffcf70 Mon Sep 17 00:00:00 2001 From: Agriya Khetarpal <74401230+agriyakhetarpal@users.noreply.github.com> Date: Tue, 13 May 2025 22:25:40 +0530 Subject: [PATCH 09/15] Add closing tags on a new line --- doc/content/about/theme-team.toml | 30 ++++++++++++++++++++---------- 1 file changed, 20 insertions(+), 10 deletions(-) diff --git a/doc/content/about/theme-team.toml b/doc/content/about/theme-team.toml index baf17602..97023360 100644 --- a/doc/content/about/theme-team.toml +++ b/doc/content/about/theme-team.toml @@ -4,7 +4,8 @@ classcard = 'text-center' body = ''' {{< image src='https://avatars.githubusercontent.com/u/601365?v=4"' - alt="Avatar of Adam Porter" >}} + alt="Avatar of Adam Porter" +>}} Adam Porter ''' link = 'https://github.com/alphapapa' @@ -15,8 +16,10 @@ classcard = 'text-center' body = ''' {{< image src='https://avatars.githubusercontent.com/u/352264?u=1fd523aa28b0451454989400579d97a8c1bc1b9a&v=4"' - alt="Avatar of Brian Hawthorne" >}} -Brian Hawthorne''' + alt="Avatar of Brian Hawthorne" +>}} +Brian Hawthorne +''' link = 'https://github.com/brianhawthorne' [[item]] @@ -25,8 +28,10 @@ classcard = 'text-center' body = ''' {{< image src='https://avatars.githubusercontent.com/u/123428?v=4"' - alt="Avatar of Jarrod Millman" >}} -Jarrod Millman''' + alt="Avatar of Jarrod Millman" +>}} +Jarrod Millman +''' link = 'https://github.com/jarrodmillman' [[item]] @@ -35,15 +40,20 @@ classcard = 'text-center' body = ''' {{< image src='https://avatars.githubusercontent.com/u/45071?u=c779b5e06448fbc638bc987cdfe305c7f9a7175e&v=4"' - alt="Avatar of Stefan van der Walt" >}} -Stefan van der Walt''' + alt="Avatar of Stefan van der Walt" +>}} +Stefan van der Walt +''' link = 'https://github.com/stefanv' [[item]] type = 'card' classcard = 'text-center' -body = '''{{< image +body = ''' +{{< image src='https://avatars.githubusercontent.com/u/23188539?u=64445b52dbf3f75de8006ed4264fdd2afaed97a3&v=4"' - alt="Avatar of Pamphile Roy" >}} -Pamphile Roy''' + alt="Avatar of Pamphile Roy" +>}} +Pamphile Roy +''' link = 'https://github.com/tupui' From 18ff5c5edb8ba8ea658994fcd9733fea095072b6 Mon Sep 17 00:00:00 2001 From: Agriya Khetarpal <74401230+agriyakhetarpal@users.noreply.github.com> Date: Tue, 13 May 2025 22:26:04 +0530 Subject: [PATCH 10/15] Fix broken dropdowns --- doc/content/user_guide/web-components.md | 95 +++++++++++++++--------- 1 file changed, 59 insertions(+), 36 deletions(-) diff --git a/doc/content/user_guide/web-components.md b/doc/content/user_guide/web-components.md index 4b931538..67454064 100644 --- a/doc/content/user_guide/web-components.md +++ b/doc/content/user_guide/web-components.md @@ -51,39 +51,53 @@ Here are some of the available button-style links, also using semantic colors: {{< button - style="info" - label="Info" - link="http://example.com/" >}} +style="info" +label="Info" +link="http://example.com/" + +> }} {{< button - style="success" - label="Success" - link="http://example.com/" >}} +style="success" +label="Success" +link="http://example.com/" + +> }} {{< button - style="warning" - label="Warning" - link="http://example.com/" >}} +style="warning" +label="Warning" +link="http://example.com/" + +> }} {{< button - style="danger" - label="Danger" - link="http://example.com/" >}} +style="danger" +label="Danger" +link="http://example.com/" + +> }} {{< button - style="muted" - label="Muted" - link="http://example.com/" >}} +style="muted" +label="Muted" +link="http://example.com/" + +> }} {{< button - style="light" - label="Light" - link="http://example.com/" >}} +style="light" +label="Light" +link="http://example.com/" + +> }} {{< button - style="dark" - label="Dark" - link="http://example.com/" >}} +style="dark" +label="Dark" +link="http://example.com/" + +> }} {{< admonition note >}} [Sphinx Design @@ -135,11 +149,13 @@ Content of the third card. title = 'A card with a dropdown menu' body = ''' {{< dropdown - title="Click to expand dropdown" - icon="fa-solid fa-eye" - body="Hidden content" >}} -''' -{{< /card >}} +title="Click to expand dropdown" +icon="fa-solid fa-eye" +body="Hidden content" + +> }} +> ''' +> {{< /card >}} {{< card >}} title = 'A clickable card' @@ -281,29 +297,36 @@ An admonition for reference. And some admonition content. ::: -{{< dropdown >}} -body = 'And with no title and some content!' +{{< dropdown body="And with no title and some content!" >}} {{< dropdown - title="With a title" - body="And some content!" >}} +title="With a title" +body="And some content!" + +> }} -{{< dropdown >}} +{{< dropdown title="With a title and icon" icon="fa-solid fa-lock-open" -body="And some content and an icon!" >}} +body="And some content and an icon!" + +> }} -{{< dropdown >}} +{{< dropdown title="A primary color dropdown" icon="fa-solid fa-lock-open" color="primary" -body="And some content and an icon!" >}} +body="And some content and an icon!" + +> }} -{{< dropdown >}} +{{< dropdown title="A secondary color dropdown" icon="fa-solid fa-eye" color="secondary" -body="And some content and an icon!" >}} +body="And some content and an icon!" + +> }} ## Copybuttons From ada930136860d83d2ee33ea6340b73e731e0db19 Mon Sep 17 00:00:00 2001 From: Agriya Khetarpal <74401230+agriyakhetarpal@users.noreply.github.com> Date: Tue, 13 May 2025 22:26:35 +0530 Subject: [PATCH 11/15] Add more closing tags on a new line --- layouts/shortcodes/button.html | 42 +++++++++++++++++++++----------- layouts/shortcodes/card.html | 3 ++- layouts/shortcodes/dropdown.html | 15 ++++++++---- layouts/shortcodes/figure.html | 9 ++++--- layouts/shortcodes/grid.html | 13 +++++++--- layouts/shortcodes/image.html | 9 ++++--- layouts/shortcodes/sidebar.html | 3 ++- 7 files changed, 63 insertions(+), 31 deletions(-) diff --git a/layouts/shortcodes/button.html b/layouts/shortcodes/button.html index bec6d05b..a35507f9 100644 --- a/layouts/shortcodes/button.html +++ b/layouts/shortcodes/button.html @@ -5,74 +5,88 @@ {{< button style="info" label="Info" - link="http://example.com/" >}} + link="http://example.com/" +>}} {{< button style="success" label="Success" - link="http://example.com/" >}} + link="http://example.com/" +>}} {{< button style="warning" label="Warning" - link="http://example.com/" >}} + link="http://example.com/" +>}} {{< button style="danger" label="Danger" - link="http://example.com/" >}} + link="http://example.com/" +>}} {{< button style="muted" label="Muted" - link="http://example.com/" >}} + link="http://example.com/" +>}} {{< button style="light" label="Light" - link="http://example.com/" >}} + link="http://example.com/" +>}} {{< button style="dark" label="Dark" - link="http://example.com/" >}} + link="http://example.com/" +>}}

{{< button style="outline-info" label="Info" - link="http://example.com/" >}} + link="http://example.com/" +>}} {{< button style="outline-success" label="Success" - link="http://example.com/" >}} + link="http://example.com/" +>}} {{< button style="outline-warning" label="Warning" - link="http://example.com/" >}} + link="http://example.com/" +>}} {{< button style="outline-danger" label="Danger" - link="http://example.com/" >}} + link="http://example.com/" +>}} {{< button style="outline-muted" label="Muted" - link="http://example.com/" >}} + link="http://example.com/" +>}} {{< button style="outline-light" label="Light" - link="http://example.com/" >}} + link="http://example.com/" +>}} {{< button style="outline-dark" label="Dark" - link="http://example.com/" >}} + link="http://example.com/" +>}} */}} diff --git a/layouts/shortcodes/card.html b/layouts/shortcodes/card.html index 63a5eebf..72297cdb 100644 --- a/layouts/shortcodes/card.html +++ b/layouts/shortcodes/card.html @@ -29,7 +29,8 @@ {{< dropdown title="Click to expand dropdown" icon="fa-solid fa-eye" - body="Hidden content" >}} + body="Hidden content" +>}} ''' {{< /card >}} diff --git a/layouts/shortcodes/dropdown.html b/layouts/shortcodes/dropdown.html index 3f2e81ef..5286946c 100644 --- a/layouts/shortcodes/dropdown.html +++ b/layouts/shortcodes/dropdown.html @@ -3,28 +3,33 @@ doc: Dropdowns {{< dropdown - body="And with no title and some content!" >}} + body="And with no title and some content!" +>}} {{< dropdown title="With a title" - body="And some content!" >}} + body="And some content!" +>}} {{< dropdown title="With a title and icon" icon="fa-solid fa-lock-open" - body="And some content and an icon!" >}} + body="And some content and an icon!" +>}} {{< dropdown title="A primary color dropdown" icon="fa-solid fa-lock-open" color="primary" - body="And some content and an icon!" >}} + body="And some content and an icon!" +>}} {{< dropdown title="A secondary color dropdown" icon="fa-solid fa-eye" color="secondary" - body="And some content and an icon!" >}} + body="And some content and an icon!" +>}} */}} diff --git a/layouts/shortcodes/figure.html b/layouts/shortcodes/figure.html index 2dce10bb..040d7d0f 100644 --- a/layouts/shortcodes/figure.html +++ b/layouts/shortcodes/figure.html @@ -11,7 +11,8 @@ attribution="Figure Credits: Cute puppies image from unsplash.com" attributionlink="https://images.unsplash.com/photo-1546238232-20216dec9f72" caption="A figure is an image with a caption. Figures may also include a tile, legend, and/or attribution." - legend="**TODO: use tomltotable (https://github.com/scientific-python/scientific-python-hugo-theme/pull/548)**
This paragraph is also part of the legend." >}} + legend="**TODO: use tomltotable (https://github.com/scientific-python/scientific-python-hugo-theme/pull/548)**
This paragraph is also part of the legend." +>}} {{< figure src="https://images.unsplash.com/photo-1546238232-20216dec9f72" @@ -21,7 +22,8 @@ align="left" height=150 width=300 - caption="A figure with left alignment." >}} + caption="A figure with left alignment." +>}} Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. @@ -37,7 +39,8 @@ align="right" height=150 width=300 - caption="A figure with right alignment." >}} + caption="A figure with right alignment." +>}} Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. diff --git a/layouts/shortcodes/grid.html b/layouts/shortcodes/grid.html index bfa18cf4..9e41010d 100644 --- a/layouts/shortcodes/grid.html +++ b/layouts/shortcodes/grid.html @@ -52,7 +52,8 @@ {{< dropdown title="Click to expand dropdown" icon="fa-solid fa-eye" - body="Hidden content" >}} + body="Hidden content" +>}} ''' [[item]] @@ -69,7 +70,8 @@ body=''' {{< image src="https://images.unsplash.com/photo-1546238232-20216dec9f72" - alt="Cute puppies" >}} + alt="Cute puppies" +>}} ''' [[item]] @@ -79,7 +81,8 @@ body = ''' {{< image src="https://images.unsplash.com/photo-1546238232-20216dec9f72" - alt="Cute puppies" >}} + alt="Cute puppies" +>}} A clickable figure card''' @@ -89,7 +92,9 @@ body = ''' {{< image src="https://images.unsplash.com/photo-1546238232-20216dec9f72" - alt="Cute puppies" >}}''' + alt="Cute puppies" +>}} +''' footer = 'A clickable figure card' {{< /grid >}} diff --git a/layouts/shortcodes/image.html b/layouts/shortcodes/image.html index 2dd91319..9117810b 100644 --- a/layouts/shortcodes/image.html +++ b/layouts/shortcodes/image.html @@ -6,7 +6,8 @@ src="https://images.unsplash.com/photo-1546238232-20216dec9f72" alt="Cute puppies" height=200 - width=400 >}} + width=400 +>}} A clickable image: @@ -15,7 +16,8 @@ alt="Cute puppies" target="https://unsplash.com/" height=200 - width=400 >}} + width=400 +>}} Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. @@ -25,7 +27,8 @@ align="right" height=200 width=400 - loading="lazy" >}} + loading="lazy" +>}} Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. diff --git a/layouts/shortcodes/sidebar.html b/layouts/shortcodes/sidebar.html index f707cc1d..b358227f 100644 --- a/layouts/shortcodes/sidebar.html +++ b/layouts/shortcodes/sidebar.html @@ -9,7 +9,8 @@ {{< image src="https://images.unsplash.com/photo-1546238232-20216dec9f72" alt="Cute puppies" - align="center" >}} + align="center" +>}} Lorem ipsum dolor sit amet, consectetur adipisicing elit. From 176b89fcc69b0e0e549b7d30979cbe780fc4bdee Mon Sep 17 00:00:00 2001 From: Agriya Khetarpal <74401230+agriyakhetarpal@users.noreply.github.com> Date: Tue, 13 May 2025 22:26:52 +0530 Subject: [PATCH 12/15] Fix teams generation script --- tools/team_query.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/team_query.py b/tools/team_query.py index 7a366c17..70eb5be0 100644 --- a/tools/team_query.py +++ b/tools/team_query.py @@ -69,7 +69,8 @@ def api(query): body = ''' {{< image src="${avatarUrl}" - alt="Avatar of ${name}" >}} + alt="Avatar of ${name}" +>}} ${name}''' link = '${url}' """ From ea7bed5747cd97d4f96a320416b2bb21b1826d06 Mon Sep 17 00:00:00 2001 From: Agriya Khetarpal <74401230+agriyakhetarpal@users.noreply.github.com> Date: Tue, 13 May 2025 22:33:47 +0530 Subject: [PATCH 13/15] Fix broken build --- doc/content/user_guide/web-components.md | 90 ++++++++++++------------ 1 file changed, 45 insertions(+), 45 deletions(-) diff --git a/doc/content/user_guide/web-components.md b/doc/content/user_guide/web-components.md index 67454064..534b9101 100644 --- a/doc/content/user_guide/web-components.md +++ b/doc/content/user_guide/web-components.md @@ -50,54 +50,51 @@ success outline Here are some of the available button-style links, also using semantic colors: -{{< button -style="info" -label="Info" -link="http://example.com/" - -> }} + {{< button -style="success" -label="Success" -link="http://example.com/" - -> }} + style="info" + label="Info" + link="http://example.com/" +>}} {{< button -style="warning" -label="Warning" -link="http://example.com/" - -> }} + style="success" + label="Success" + link="http://example.com/" +>}} {{< button -style="danger" -label="Danger" -link="http://example.com/" - -> }} + style="warning" + label="Warning" + link="http://example.com/" +>}} {{< button -style="muted" -label="Muted" -link="http://example.com/" - -> }} + style="danger" + label="Danger" + link="http://example.com/" +>}} {{< button -style="light" -label="Light" -link="http://example.com/" + style="muted" + label="Muted" + link="http://example.com/" +>}} -> }} +{{< button + style="light" + label="Light" + link="http://example.com/" +>}} {{< button -style="dark" -label="Dark" -link="http://example.com/" + style="dark" + label="Dark" + link="http://example.com/" +>}} -> }} + {{< admonition note >}} [Sphinx Design @@ -118,6 +115,8 @@ buttons will automatically use the custom color. ## Cards + + {{< grid >}} {{< card >}} @@ -152,10 +151,9 @@ body = ''' title="Click to expand dropdown" icon="fa-solid fa-eye" body="Hidden content" - -> }} -> ''' -> {{< /card >}} +>}} +''' +{{< /card >}} {{< card >}} title = 'A clickable card' @@ -182,6 +180,8 @@ footer = 'Footer' {{< /grid >}} + + ## Tabs Code example from the PyData Sphinx Theme's kitchen sink: @@ -299,34 +299,34 @@ And some admonition content. {{< dropdown body="And with no title and some content!" >}} + + {{< dropdown title="With a title" body="And some content!" - -> }} +>}} {{< dropdown title="With a title and icon" icon="fa-solid fa-lock-open" body="And some content and an icon!" - -> }} +>}} {{< dropdown title="A primary color dropdown" icon="fa-solid fa-lock-open" color="primary" body="And some content and an icon!" - -> }} +>}} {{< dropdown title="A secondary color dropdown" icon="fa-solid fa-eye" color="secondary" body="And some content and an icon!" +>}} -> }} + ## Copybuttons From ea2b7760857962760cbceeea722f06a03fa041f4 Mon Sep 17 00:00:00 2001 From: Agriya Khetarpal <74401230+agriyakhetarpal@users.noreply.github.com> Date: Tue, 13 May 2025 22:58:47 +0530 Subject: [PATCH 14/15] Remove outdated docs --- layouts/shortcodes/figure.html | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/layouts/shortcodes/figure.html b/layouts/shortcodes/figure.html index 040d7d0f..a515dd70 100644 --- a/layouts/shortcodes/figure.html +++ b/layouts/shortcodes/figure.html @@ -29,23 +29,6 @@ Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. -This shortcode can also be used with named parameters. The following example shows how to do so: - -{{< figure - src="https://images.unsplash.com/photo-1546238232-20216dec9f72" - alt="Cute puppies" - attribution="Figure Credits: Cute puppies image from unsplash.com" - attributionlink="https://images.unsplash.com/photo-1546238232-20216dec9f72" - align="right" - height=150 - width=300 - caption="A figure with right alignment." ->}} - -Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. - -Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. - */}} {{- $figure := dict -}} From bb0d0904e566a8a57ef4e5cb78cf45d303e9c4de Mon Sep 17 00:00:00 2001 From: Agriya Khetarpal <74401230+agriyakhetarpal@users.noreply.github.com> Date: Wed, 14 May 2025 11:18:50 +0530 Subject: [PATCH 15/15] Undo all changes to the dropdown shortcode --- doc/content/user_guide/web-components.md | 68 +++++++++++------------ layouts/shortcodes/card.html | 10 ++-- layouts/shortcodes/dropdown.html | 70 +++++++++++------------- layouts/shortcodes/grid.html | 10 ++-- 4 files changed, 76 insertions(+), 82 deletions(-) diff --git a/doc/content/user_guide/web-components.md b/doc/content/user_guide/web-components.md index 534b9101..8001b679 100644 --- a/doc/content/user_guide/web-components.md +++ b/doc/content/user_guide/web-components.md @@ -147,11 +147,11 @@ Content of the third card. {{< card >}} title = 'A card with a dropdown menu' body = ''' -{{< dropdown -title="Click to expand dropdown" -icon="fa-solid fa-eye" -body="Hidden content" ->}} +{{< dropdown >}} +title = 'Click to expand dropdown' +icon = 'fa-solid fa-eye' +body = 'Hidden content' +{{< /dropdown >}} ''' {{< /card >}} @@ -297,36 +297,34 @@ An admonition for reference. And some admonition content. ::: -{{< dropdown body="And with no title and some content!" >}} - - - -{{< dropdown -title="With a title" -body="And some content!" ->}} - -{{< dropdown -title="With a title and icon" -icon="fa-solid fa-lock-open" -body="And some content and an icon!" ->}} - -{{< dropdown -title="A primary color dropdown" -icon="fa-solid fa-lock-open" -color="primary" -body="And some content and an icon!" ->}} - -{{< dropdown -title="A secondary color dropdown" -icon="fa-solid fa-eye" -color="secondary" -body="And some content and an icon!" ->}} - - +{{< dropdown >}} +body = 'And with no title and some content!' +{{< /dropdown >}} + +{{< dropdown >}} +title = 'With a title' +body = 'And some content!' +{{< /dropdown >}} + +{{< dropdown >}} +title = 'With a title and icon' +icon = 'fa-solid fa-lock-open' +body = 'And some content and an icon!' +{{< /dropdown >}} + +{{< dropdown >}} +title = 'A primary color dropdown' +icon = 'fa-solid fa-lock-open' +color = 'primary' +body = 'And some content and an icon!' +{{< /dropdown >}} + +{{< dropdown >}} +title = 'A secondary color dropdown' +icon = 'fa-solid fa-eye' +color = 'secondary' +body = 'And some content and an icon!' +{{< /dropdown >}} ## Copybuttons diff --git a/layouts/shortcodes/card.html b/layouts/shortcodes/card.html index 72297cdb..6f655fac 100644 --- a/layouts/shortcodes/card.html +++ b/layouts/shortcodes/card.html @@ -26,11 +26,11 @@ {{< card >}} title = 'A card with a dropdown menu' body = ''' -{{< dropdown - title="Click to expand dropdown" - icon="fa-solid fa-eye" - body="Hidden content" ->}} +{{< dropdown >}} +title = 'Click to expand dropdown' +icon = 'fa-solid fa-eye' +body = 'Hidden content' +{{< /dropdown >}} ''' {{< /card >}} diff --git a/layouts/shortcodes/dropdown.html b/layouts/shortcodes/dropdown.html index 5286946c..645aab89 100644 --- a/layouts/shortcodes/dropdown.html +++ b/layouts/shortcodes/dropdown.html @@ -2,59 +2,55 @@ doc: Dropdowns -{{< dropdown - body="And with no title and some content!" ->}} - -{{< dropdown - title="With a title" - body="And some content!" ->}} - -{{< dropdown - title="With a title and icon" - icon="fa-solid fa-lock-open" - body="And some content and an icon!" ->}} - -{{< dropdown - title="A primary color dropdown" - icon="fa-solid fa-lock-open" - color="primary" - body="And some content and an icon!" ->}} - -{{< dropdown - title="A secondary color dropdown" - icon="fa-solid fa-eye" - color="secondary" - body="And some content and an icon!" ->}} +{{< dropdown >}} +body = 'And with no title and some content!' +{{< /dropdown >}} + +{{< dropdown >}} +title = 'With a title' +body = 'And some content!' +{{< /dropdown >}} + +{{< dropdown >}} +title = 'With a title and icon' +icon = 'fa-solid fa-lock-open' +body = 'And some content and an icon!' +{{< /dropdown >}} + +{{< dropdown >}} +title = 'A primary color dropdown' +icon = 'fa-solid fa-lock-open' +color = 'primary' +body = 'And some content and an icon!' +{{< /dropdown >}} + +{{< dropdown >}} +title = 'A secondary color dropdown' +icon = 'fa-solid fa-eye' +color = 'secondary' +body = 'And some content and an icon!' +{{< /dropdown >}} */}} -{{- $dropdown := dict -}} -{{- range $key, $value := .Params -}} -{{- $dropdown = merge $dropdown (dict $key $value) -}} -{{- end -}} - +{{- $data := .Inner | transform.Unmarshal -}}

- {{- with $dropdown.color }} + {{- with $data.color }} {{- else }} {{- end }} - {{- with $dropdown.icon }} + {{- with $data.icon }} {{- end }} - {{- with $dropdown.title }} + {{- with $data.title }} {{- . }} {{- else }}   {{- end }}
- {{- with (trim $dropdown.body "\n") }} + {{- with (trim $data.body "\n") }} {{- . | markdownify }} {{- end }}
diff --git a/layouts/shortcodes/grid.html b/layouts/shortcodes/grid.html index 9e41010d..0468c4c5 100644 --- a/layouts/shortcodes/grid.html +++ b/layouts/shortcodes/grid.html @@ -49,11 +49,11 @@ type = 'card' title = 'A card with a dropdown menu' body = ''' -{{< dropdown - title="Click to expand dropdown" - icon="fa-solid fa-eye" - body="Hidden content" ->}} +{{< dropdown >}} +title = 'Click to expand dropdown' +icon = 'fa-solid fa-eye' +body = 'Hidden content' +{{< /dropdown >}} ''' [[item]]