Compare commits

...

3 Commits

Author SHA1 Message Date
Mark Dumay
5e41fddef3 Merge pull request #1375 from gethinode/develop
Apply title case to sections and sidebar menus
2025-01-20 13:22:00 +01:00
Mark Dumay
a620900c18 Merge branch 'main' into develop 2025-01-20 12:31:09 +01:00
Mark Dumay
cc25fe311d Apply title case to sections and sidebar menus 2025-01-20 12:30:39 +01:00
6 changed files with 14 additions and 5 deletions

View File

@@ -16,6 +16,7 @@
{{- $title := .title -}} {{- $title := .title -}}
{{- $description := .description -}} {{- $description := .description -}}
{{- $content := .content -}} {{- $content := .content -}}
{{ if site.Params.main.titleCase }}{{ $title = title $title }}{{ end }}
<!-- Main code --> <!-- Main code -->
{{ with $title }}<p id="{{ anchorize . }}" class="display-4 py-5{{ if and page.IsHome site.Params.home.centerHeadline }} text-center{{ end }}">{{ . }}</p>{{ end }} {{ with $title }}<p id="{{ anchorize . }}" class="display-4 py-5{{ if and page.IsHome site.Params.home.centerHeadline }} text-center{{ end }}">{{ . }}</p>{{ end }}

View File

@@ -37,6 +37,9 @@
<li class="mb-1"> <li class="mb-1">
<div class="d-flex w-100 p-0 sidebar-item-group"> <div class="d-flex w-100 p-0 sidebar-item-group">
<div class="text-start flex-grow-1 {{ if $current }}fw-bold{{ end }}"> <div class="text-start flex-grow-1 {{ if $current }}fw-bold{{ end }}">
{{- $groupTitle := $group.title -}}
{{ if site.Params.main.titleCase }}{{ $groupTitle = title $groupTitle }}{{ end }}
{{ $dest := $href }} {{ $dest := $href }}
{{ $target := "" }} {{ $target := "" }}
{{ if or $current (not $ref) }} {{ if or $current (not $ref) }}
@@ -45,7 +48,7 @@
<a {{ with $dest }} href="{{ . }}"{{ else }} <a {{ with $dest }} href="{{ . }}"{{ else }}
data-bs-toggle="collapse" data-bs-toggle="collapse"
data-bs-target="#sidebar-collapse-{{ $index }}-{{ $level }}" data-bs-target="#sidebar-collapse-{{ $index }}-{{ $level }}"
{{ end }}>{{ $group.title }}</a> {{ end }}>{{ $groupTitle }}</a>
</div> </div>
<button <button

View File

@@ -33,7 +33,10 @@
{{- $align := .align | default "center" -}} {{- $align := .align | default "center" -}}
<div class="text-{{ $align }}"> <div class="text-{{ $align }}">
{{ with $page.Title }}<p class="display-4">{{ . }}</p>{{ end }} {{ $title := $page.Title }}
{{ if site.Params.main.titleCase }}{{ $title = title $title }}{{ end }}
{{ with $title }}<p class="display-4">{{ . }}</p>{{ end }}
<span class="fs-5 text-muted">{{ $page.Description }}</span> <span class="fs-5 text-muted">{{ $page.Description }}</span>
{{ if $actions }} {{ if $actions }}

View File

@@ -46,6 +46,8 @@
{{- with index . "title" }}{{ $title = or . $title }}{{ end -}} {{- with index . "title" }}{{ $title = or . $title }}{{ end -}}
{{- end -}} {{- end -}}
{{ if site.Params.main.titleCase }}{{ $title = title $title }}{{ end }}
{{- $thumbnail := "" -}} {{- $thumbnail := "" -}}
{{ if reflect.IsMap $sectionPage.Params.Thumbnail }}{{ $thumbnail = $sectionPage.Params.Thumbnail.url }}{{ else }}{{ $thumbnail = $sectionPage.Params.Thumbnail }}{{ end }} {{ if reflect.IsMap $sectionPage.Params.Thumbnail }}{{ $thumbnail = $sectionPage.Params.Thumbnail.url }}{{ else }}{{ $thumbnail = $sectionPage.Params.Thumbnail }}{{ end }}
{{- $icon := $sectionPage.Params.Icon -}} {{- $icon := $sectionPage.Params.Icon -}}

4
package-lock.json generated
View File

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

View File

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