Skip to content

Commit

Permalink
Merge pull request #1375 from gethinode/develop
Browse files Browse the repository at this point in the history
Apply title case to sections and sidebar menus
  • Loading branch information
markdumay authored Jan 20, 2025
2 parents c057b11 + a620900 commit 5e41fdd
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 5 deletions.
1 change: 1 addition & 0 deletions layouts/partials/assets/section-header.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
{{- $title := .title -}}
{{- $description := .description -}}
{{- $content := .content -}}
{{ if site.Params.main.titleCase }}{{ $title = title $title }}{{ end }}

<!-- 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 }}
Expand Down
5 changes: 4 additions & 1 deletion layouts/partials/assets/sidebar.html
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@
<li class="mb-1">
<div class="d-flex w-100 p-0 sidebar-item-group">
<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 }}
{{ $target := "" }}
{{ if or $current (not $ref) }}
Expand All @@ -45,7 +48,7 @@
<a {{ with $dest }} href="{{ . }}"{{ else }}
data-bs-toggle="collapse"
data-bs-target="#sidebar-collapse-{{ $index }}-{{ $level }}"
{{ end }}>{{ $group.title }}</a>
{{ end }}>{{ $groupTitle }}</a>
</div>

<button
Expand Down
5 changes: 4 additions & 1 deletion layouts/partials/list/featured.html
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,10 @@
{{- $align := .align | default "center" -}}

<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>

{{ if $actions }}
Expand Down
2 changes: 2 additions & 0 deletions layouts/partials/utilities/GetSections.html
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@
{{- with index . "title" }}{{ $title = or . $title }}{{ end -}}
{{- end -}}

{{ if site.Params.main.titleCase }}{{ $title = title $title }}{{ end }}

{{- $thumbnail := "" -}}
{{ if reflect.IsMap $sectionPage.Params.Thumbnail }}{{ $thumbnail = $sectionPage.Params.Thumbnail.url }}{{ else }}{{ $thumbnail = $sectionPage.Params.Thumbnail }}{{ end }}
{{- $icon := $sectionPage.Params.Icon -}}
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"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",
"keywords": [
"hugo",
Expand Down

0 comments on commit 5e41fdd

Please sign in to comment.