Compare commits

...

3 Commits

Author SHA1 Message Date
Mark Dumay
4e6aad33d6 Merge pull request #1458 from gethinode/develop
FIx rendering of inner nav-item content
2025-06-10 17:24:04 +02:00
Mark Dumay
8c3989e4f1 Merge branch 'main' into develop 2025-06-10 17:12:37 +02:00
Mark Dumay
42a81bab5f FIx rendering of inner nav-item content 2025-06-10 17:10:36 +02:00
9 changed files with 26 additions and 20 deletions

View File

@@ -1,6 +1,8 @@
comment: >-
Defines an individual item.
arguments:
page:
group: partial
id:
group: partial
parent-id:

View File

@@ -33,8 +33,9 @@ As an example, the following shortcode displays an accordion with three elements
{{< example lang="hugo" >}}
{{</* accordion */>}}
{{</* accordion-item title="Accordion Item #1" show="true" */>}}
This is the first item's accordion body. It supports HTML content, if enabled in the goldmark
renderer. The item is shown by adding the value `show` to the `class` argument.
This is the first item's accordion body.
It supports Markdown content. The item
is shown by adding the value `show` to the `class` argument.
{{</* /accordion-item */>}}
{{</* accordion-item title="Accordion Item #2" */>}}
This is the second item's accordion body.
@@ -352,8 +353,8 @@ As an example, the following shortcode displays a tab group with vertically alig
{{< example lang="hugo" >}}
{{</* nav tab-type="pills" vertical="true" */>}}
{{</* nav-item title="Nav Item #1" show="true" */>}}
This is the first item's nav body. It supports HTML content, if enabled in the goldmark
renderer. The item is shown by adding the value `show` to the `class` argument.
This is the first item's nav body. It supports Markdown content.
The item is shown by adding the value `show` to the `class` argument.
{{</* /nav-item */>}}
{{</* nav-item title="Nav Item #2" */>}}
This is the second item's nav body.

View File

@@ -603,11 +603,11 @@
"fab-medium",
"fab-whatsapp",
"fab-x-twitter",
"faq-422100b13f9388f5e5d9733a89582b72",
"faq-422100b13f9388f5e5d9733a89582b72-heading-faq-422100b13f9388f5e5d9733a89582b72",
"faq-422100b13f9388f5e5d9733a89582b72-item-0",
"faq-422100b13f9388f5e5d9733a89582b72-item-1",
"faq-422100b13f9388f5e5d9733a89582b72-item-2",
"faq-d60f86697e8e822c14f81bde047a063e",
"faq-d60f86697e8e822c14f81bde047a063e-heading-faq-d60f86697e8e822c14f81bde047a063e",
"faq-d60f86697e8e822c14f81bde047a063e-item-0",
"faq-d60f86697e8e822c14f81bde047a063e-item-1",
"faq-d60f86697e8e822c14f81bde047a063e-item-2",
"fas-1",
"fas-2",
"fas-3",

View File

@@ -72,7 +72,7 @@
aria-labelledby="{{ $parentID }}-heading-{{ $args.id }}"
data-bs-parent="#accordion-{{ $parentID }}"
>
<div class="accordion-body">{{- $args.body | safeHTML -}}</div>
<div class="accordion-body">{{ $args.body | $args.page.RenderString | safeHTML }}</div>
</div>
</div>
{{ else }}
@@ -87,7 +87,7 @@
data-has-content="{{ gt (len $args.body) 0 }}"
{{ if $args.disabled }} data-disabled-id="{{ $args.id }}"{{ end }}
>
{{ $args.body }}
{{ $args.body | $args.page.RenderString | safeHTML }}
</div>
{{ end }}
{{ end }}

View File

@@ -33,7 +33,8 @@
<div class="d-lg-none">
<div id="accordion-{{ $id }}" class="accordion mb-3{{ with $args.class }} {{ . }}{{ end }} nav-callout">
{{- range $index, $item := $args.list -}}
{{ partial "assets/nav-item.html" (dict
{{ partial "assets/nav-item.html" (dict
"page" $args.page
"id" $index
"parentID" $id
"fade" false

View File

@@ -30,11 +30,12 @@
{{- if isset .Parent.Params "fade" }}{{ $parentFade = partial "utilities/CastBool.html" (.Parent.Get "fade") }}{{ end -}}
{{- $fade = or $fade $parentFade -}}
{{- $title := or $args.title $args.header -}}
{{- $body := trim .Inner " \r\n" | .Page.RenderString -}}
{{- $body := trim .Inner " \r\n" -}}
{{- $current := "" -}}
{{/* Main code */}}
{{- $output := partial "assets/nav-item.html" (dict
"page" .Page
"id" $id
"parent-id" $parent
"fade" $fade
@@ -57,6 +58,7 @@
{{- end }}
{{- $alternative := partial "assets/nav-item" (dict
"page" .Page
"id" $id
"parent-id" $parent
"fade" $fade

View File

@@ -21,9 +21,9 @@
{{- $innerTitles := .Scratch.Get "inner-title" -}}
{{- $input := trim .Inner " \r\n" -}}
{{- if $input -}}
{{ $input = replace $input "\n" "\n " -}}
{{ warnf "Unexpected inner content: %s\r\n %s" .Position $input -}}
{{ end }}
{{- $input = replace $input "\n" "\n " -}}
{{- warnf "Unexpected inner content: %s\r\n %s" .Position $input -}}
{{- end -}}
{{/* Main code */}}
{{- if not $args.err -}}
@@ -41,4 +41,4 @@
"width" $args.width
)
-}}
{{ end }}
{{- end -}}

4
package-lock.json generated
View File

@@ -1,12 +1,12 @@
{
"name": "@gethinode/hinode",
"version": "1.0.0-alpha5",
"version": "1.0.0-alpha6",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "@gethinode/hinode",
"version": "1.0.0-alpha5",
"version": "1.0.0-alpha6",
"license": "MIT",
"dependencies": {
"@fullhuman/postcss-purgecss": "^7.0.2",

View File

@@ -1,6 +1,6 @@
{
"name": "@gethinode/hinode",
"version": "1.0.0-alpha5",
"version": "1.0.0-alpha6",
"description": "Hinode is a clean documentation and blog theme for Hugo, an open-source static site generator",
"keywords": [
"hugo",