Compare commits

...

26 Commits

Author SHA1 Message Date
Mark Dumay
e0e694cda4 Merge pull request #134 from gethinode/develop
Refinement
2023-02-05 16:30:14 +01:00
mark
40b36ef34b Fix linting issues 2023-02-05 16:25:12 +01:00
mark
d47adb99a2 Suppress more button when max is reached 2023-02-05 16:21:53 +01:00
mark
32b86d1183 Suppress empty lines from Go template 2023-02-05 16:20:58 +01:00
mark
c17ac02c13 Add icon support 2023-02-05 16:20:47 +01:00
mark
ea6623349c Add background param 2023-02-05 16:18:49 +01:00
mark
0d1b08e770 Ass support for base paths for file references 2023-02-05 16:15:27 +01:00
mark
868430b726 Replace feature params with _index content 2023-02-05 16:09:27 +01:00
mark
d3330716ee Suppress empty lines from Go template 2023-02-05 15:59:45 +01:00
mark
9799b9d6eb Reuse icon partial 2023-02-05 15:54:13 +01:00
mark
092ee2f4a7 Add icon for external links 2023-02-05 15:53:43 +01:00
mark
9c0fca16bf Fix class recognition 2023-02-05 15:53:12 +01:00
mark
ac5521bffa Refactor icon code 2023-02-05 15:36:37 +01:00
mark
8634b1ecce Bump package version 2023-02-05 15:22:03 +01:00
mark
258040c345 Remove default title 2023-02-05 15:19:35 +01:00
mark
1cd93c131e Add theme style placeholder 2023-02-05 15:11:19 +01:00
Mark Dumay
cba64fccfe Merge pull request #132 from gethinode/develop
Refinement
2023-02-04 15:08:50 +01:00
mark
bd6743acc6 Bump package version 2023-02-04 14:57:28 +01:00
mark
1d30b45c2b Fix #131 2023-02-04 14:57:10 +01:00
mark
8d8a6918b6 Clarify homepage setting 2023-02-04 14:55:17 +01:00
mark
58ba98f180 Add Dutch projects to main navbar 2023-02-04 14:55:02 +01:00
mark
736d93774a Update codebase names in license statement 2023-02-04 06:37:51 +01:00
Mark Dumay
7a0b0f318d Merge pull request #130 from gethinode/develop
Develop
2023-02-04 06:05:11 +01:00
mark
d65bea328f Bump package version 2023-02-04 05:57:27 +01:00
mark
4e84e97146 Update homepage 2023-02-04 05:56:45 +01:00
mark
29f8016ebc Adjust base url 2023-02-04 05:53:50 +01:00
24 changed files with 271 additions and 210 deletions

View File

@@ -138,7 +138,7 @@ Hinode is inspired by the following themes:
## License
The `hugo-theme-hinode` and `hugo-theme-hinode-child` codebase is released under the [MIT license][license]. The documentation (including the "README") is licensed under the Creative Commons ([CC BY-NC 4.0)][cc-by-nc-4.0] license.
The `hinode` and `child` codebase is released under the [MIT license][license]. The documentation (including the "README" and `docs` codebase) is licensed under the Creative Commons ([CC BY-NC 4.0)][cc-by-nc-4.0] license.
<!-- MARKDOWN PUBLIC LINKS -->
[blist]: https://github.com/apvarun/blist-hugo-theme

View File

@@ -96,3 +96,6 @@ $navbar-offset: {{ if site.Params.navigation.fixed }}{{ site.Par
@import "layouts/type.scss";
@import "common/export.scss";
@import "helpers/colored-links.scss";
// Import theme placeholder
@import "theme.scss";

2
assets/scss/theme.scss Normal file
View File

@@ -0,0 +1,2 @@
// Placeholder to quickly add your own styles
// The file is included last in the build pipeline

View File

@@ -6,7 +6,7 @@ enableGitInfo = true
# toml-docs-end main
# additional settings
baseURL = "https://gethinode.com/"
baseURL = "https://demo.gethinode.com/"
canonifyURLs = false
enableEmoji = true
enableRobotsTXT = true

View File

@@ -8,8 +8,6 @@
[en.params.head]
tagline = "A Hugo Theme"
[en.params.feature]
message = "Welcome to Hinode!"
tagline = "A clean documentation and blog theme for your Hugo site based on Bootstrap 5."
link = "/en/about"
caption = "About"
[en.params.footer]
@@ -25,8 +23,6 @@
[nl.params.head]
tagline = "Een Hugo Thema"
[nl.params.feature]
message = "Welkom bij Hinode!"
tagline = "Een documentatie en blog thema voor Hugo gebaseerd op Bootstrap 5."
link = "/nl/over-mij"
caption = "Over mij"
[nl.params.footer]

View File

@@ -13,6 +13,18 @@
url = "/projecten/"
weight = 30
[[main]]
name = "Voorbeeldproject"
url = "/nl/projecten/voorbeeldproject/"
parent = "Projecten"
weight = 1
[[main]]
name = "Ander project"
url = "/nl/projecten/ander-project/"
parent = "Projecten"
weight = 2
[[main]]
name = "Tags"
url = "/tags/"

View File

@@ -7,6 +7,7 @@
# toml-docs-start docs
[docs]
version = "0.8"
basePath = ""
# toml-docs-end docs
# toml-docs-start home

View File

@@ -1,4 +1,6 @@
---
author: Mark Dumay
title: A Clean Theme for Hugo
title: Welcome to Hinode!
---
A clean documentation and blog theme for your Hugo site based on Bootstrap 5.

View File

@@ -77,8 +77,6 @@ Hinode supports [multilingual content]({{< param "links.hugo_lang_config" >}}).
| Section | Setting | Default | Description |
|---------|---------------|---------|-------------|
| head | tagline | - | Tagline used on the site's title for the home page. |
| feature | message | - | Welcome message used in the featured section on the home page. |
| feature | tagline | - | Tagline used below the welcome message in the featured section on the home page. |
| feature | link | - | Call to action link in the featured section on the home page. |
| feature | caption | "About" | Call to action title in the featured section on the home page. |
| footer | license | - | License displayed on the site's footer. |
@@ -216,7 +214,7 @@ The configuration of the list pages is set in the `list` section of the `site pa
| footer | "none" | Footer components of the card, displayed in small caps. Supported values are "full", "publication", "tags", and "none" (default). |
| orientation | "stacked" | Placecement of the thumbnail, either "stacked" (default), "horizontal", or "none". |
| style | - | Optional styling attributes added to card class, e.g. "border-0" to remove the borders. |
| homepage | 3 | Number of items to display on the home page (if defined in the [configuration](#configuration-1)), defaults to 3. |
| homepage | 3 | Maximum number of items to display on the home page (if defined in the [configuration](#configuration-1)), defaults to 3. |
{.table}
The below configuration shows the default configuration set in `config/_default/params.toml`.

View File

@@ -1,3 +1,6 @@
---
author: "Hugo Authors"
author: Mark Dumay
title: Welkom bij Hinode!
---
Een documentatie en blog thema voor Hugo gebaseerd op Bootstrap 5.

View File

@@ -11,14 +11,12 @@
{{- $sectionURL = $page.Parent.RelPermalink -}}
{{- end -}}
{{- $title := (T (printf "recent%s" (strings.FirstUpper $section))) -}}
{{- $moreTitle := (T (printf "more%s" (strings.FirstUpper $section))) -}}
{{- partial "assets/section-list.html" (dict
"page" $page
"section" $section
"home" true
"title" $title
"moreTitle" $moreTitle
"sectionURL" $sectionURL)
-}}

View File

@@ -128,6 +128,8 @@
{{- end -}}
{{ end }}
</div>
<a class="btn btn-outline-primary" href="{{ $moreURL| safeURL }}" role="button">{{ $moreTitle }}</a>
{{ if gt $count $max }}
<a class="btn btn-outline-primary" href="{{ $moreURL| safeURL }}" role="button">{{ $moreTitle }}</a>
{{ end }}
{{ end }}
</div>

View File

@@ -16,148 +16,163 @@
"publication", "tags", and "none" (default).
"description" Optional description of the card.
"thumbnail" Optional thumbnail image url, displayed on top or the left of the card.
"icon" Optional Font Awesome icon, displayed on top or the left of the card.
"orientation" Optional placecement of the thumbnail, either "stacked" (default), "horizontal", or "none".
-->
<!-- Inline partial to render the card's body -->
{{ define "partials/card-body.html" -}}
{{ $title := .title -}}
{{ $href := .href -}}
{{ $color := .color -}}
{{ $description := .description -}}
{{- define "partials/card-body.html" -}}
{{- $title := .title -}}
{{- $href := .href -}}
{{- $color := .color -}}
{{- $description := .description -}}
<a href="{{ $href }}" class="{{ if $color }}link-bg-{{ $color }}{{ else }}link-dark{{ end }}">
<p class="card-title fs-5 fw-bold">{{ $title }}</p>
{{ with $description }}<p class="card-text mb-4 {{ if $color }}link-bg-{{ $color }}{{ else }}link-dark{{ end }}">{{ . }}</p>{{ end -}}
</a>
{{ end -}}
{{- end -}}
<!-- Inline partial to render the card's header or footer -->
{{ define "partials/card-caption.html" -}}
{{ $page := .page -}}
{{ $keywords := .keywords -}}
{{ $color := .color -}}
{{ $maxTags := 0 -}}
{{ $caption := "" -}}
{{- define "partials/card-caption.html" -}}
{{- $page := .page -}}
{{- $keywords := .keywords -}}
{{- $color := .color -}}
{{- $maxTags := 0 -}}
{{- $caption := "" -}}
{{- if eq $keywords "full" }}{{ $maxTags = 1 -}}
{{ else if eq $keywords "tags" }}{{ $maxTags = 3 }}{{ end -}}
{{- else if eq $keywords "tags" }}{{ $maxTags = 3 }}{{ end -}}
<p class="card-text"><small class="{{ if $color }}text-bg-{{ $color }}{{ else }}text-muted{{ end }} text-uppercase">
{{ if in (slice "full" "publication") $keywords -}}
{{ partial "utilities/date.html" (dict "date" $page.Date "format" "long") -}}&nbsp;&bull;
{{ $page.ReadingTime | lang.FormatNumber 0 }} {{ i18n "minutesShort" }} {{ i18n "read" -}}
{{ end -}}
{{- if in (slice "full" "publication") $keywords -}}
{{- partial "utilities/date.html" (dict "date" $page.Date "format" "long") -}}&nbsp;&bull;
{{- $page.ReadingTime | lang.FormatNumber 0 }} {{ i18n "minutesShort" }} {{ i18n "read" -}}
{{- end -}}
{{ if eq $keywords "full" -}}
{{- if eq $keywords "full" -}}
{{ if gt (len ($page.GetTerms "tags")) 0 }}&nbsp;&bull;&nbsp;{{ end -}}
{{ end -}}
{{- end -}}
{{ $link := "text-decoration-none link-primary" -}}
{{ if $color }}{{ $link = printf "link-bg-%s" $color }}{{ end -}}
{{- $link := "text-decoration-none link-primary" -}}
{{- if $color }}{{ $link = printf "link-bg-%s" $color }}{{ end -}}
{{ range $index, $tag := first $maxTags ($page.GetTerms "tags") -}}
{{ if gt $index 0 }}&bull;&nbsp;{{ end -}}
{{- range $index, $tag := first $maxTags ($page.GetTerms "tags") -}}
{{- if gt $index 0 }}&bull;&nbsp;{{ end -}}
<a href="{{ (path.Join $tag.Page.RelPermalink) | relURL }}" class="{{ $link }}" aria-label="tag: {{ $tag.LinkTitle }}">{{ $tag.LinkTitle }}</a>
{{ end -}}
{{- end -}}
</small></p>
{{ end -}}
{{- end -}}
{{ $page := "" }}
{{ if .path }}
{{ $page = site.GetPage .path }}
{{ if not $page }}
{{ errorf "Cannot find page: %s" .path -}}
{{ end }}
{{ end }}
{{- $page := "" }}
{{- if .path }}
{{- $page = site.GetPage .path }}
{{- if not $page }}
{{- errorf "Cannot find page: %s" .path -}}
{{- end }}
{{- end }}
{{ $title := .title }}
{{ $href := .href }}
{{ $description := .description }}
{{ $thumbnail := .thumbnail }}
{{- $title := .title -}}
{{- $href := .href -}}
{{- $description := .description -}}
{{- $thumbnail := .thumbnail -}}
{{- $icon := .icon -}}
{{ $color := "" -}}
{{ with .color }}{{ $color = . }}{{ end -}}
{{ if $color -}}
{{ $supportedColors := slice "primary" "secondary" "success" "danger" "warning" "info" "light" "dark" "white" "black" -}}
{{ if not (in $supportedColors $color) -}}
{{ errorf "Invalid value for param 'color': %s" $color -}}
{{ end -}}
{{ end -}}
{{- $color := "" -}}
{{- with .color }}{{ $color = . }}{{ end -}}
{{- if $color -}}
{{- $supportedColors := slice "primary" "secondary" "success" "danger" "warning" "info" "light" "dark" "white" "black" -}}
{{- if not (in $supportedColors $color) -}}
{{- errorf "Invalid value for param 'color': %s" $color -}}
{{- end -}}
{{- end -}}
{{ $header := "full" -}}
{{ with .header }}{{ $header = . }}{{ end -}}
{{ $supportedKeywords := slice "full" "publication" "tags" "none" -}}
{{ if not (in $supportedKeywords $header) -}}
{{ errorf "Invalid value for param 'header': %s" $header -}}
{{ end -}}
{{- $header := "full" -}}
{{- with .header }}{{ $header = . }}{{ end -}}
{{- $supportedKeywords := slice "full" "publication" "tags" "none" -}}
{{- if not (in $supportedKeywords $header) -}}
{{- errorf "Invalid value for param 'header': %s" $header -}}
{{- end -}}
{{ $footer := "none" -}}
{{ with .footer }}{{ $footer = . }}{{ end -}}
{{ if not (in $supportedKeywords $footer) -}}
{{ errorf "Invalid value for param 'footer': %s" $footer -}}
{{ end -}}
{{- $footer := "none" -}}
{{- with .footer }}{{ $footer = . }}{{ end -}}
{{- if not (in $supportedKeywords $footer) -}}
{{- errorf "Invalid value for param 'footer': %s" $footer -}}
{{- end -}}
{{ with $page -}}
{{ if not $title }}{{ $title = .Title }}{{ end -}}
{{ if not $href }}{{ $href = .Permalink }}{{ end -}}
{{ if not $description }}{{ $description = .Description }}{{ end -}}
{{ if not $thumbnail }}{{ $thumbnail = .Params.thumbnail }}{{ end -}}
{{ end -}}
{{- with $page -}}
{{- if not $title }}{{ $title = .Title }}{{ end -}}
{{- if not $href }}{{ $href = .Permalink }}{{ end -}}
{{- if not $description }}{{ $description = .Description }}{{ end -}}
{{- if not $thumbnail }}{{ $thumbnail = .Params.thumbnail }}{{ end -}}
{{- if not $icon }}{{ $icon = .Params.icon }}{{ end -}}
{{- end -}}
{{ if not $href -}}
{{ errorf "Missing value for param 'href'" -}}
{{ end -}}
{{- if not $href -}}
{{- errorf "Missing value for param 'href'" -}}
{{- end -}}
{{ $class := .class -}}
{{- $class := .class -}}
{{ $padding := "auto" -}}
{{ with .padding }}{{ $padding = . }}{{ end -}}
{{ $supportedPaddings := slice "0" "1" "2" "3" "4" "5" "auto" -}}
{{ if not (in $supportedPaddings $padding) -}}
{{ errorf "Invalid value for param 'padding': %s" $padding -}}
{{ end -}}
{{- $padding := "auto" -}}
{{- with .padding }}{{ $padding = . }}{{ end -}}
{{- $supportedPaddings := slice "0" "1" "2" "3" "4" "5" "auto" -}}
{{- if not (in $supportedPaddings $padding) -}}
{{- errorf "Invalid value for param 'padding': %s" $padding -}}
{{- end -}}
{{ $orientation := "stacked" -}}
{{ with .orientation }}{{ $orientation = . }}{{ end -}}
{{ $supportedOrientations := slice "stacked" "horizontal" "none" -}}
{{ if not (in $supportedOrientations $orientation) -}}
{{ errorf "Invalid value for param 'orientation': %s" $orientation -}}
{{ end -}}
{{ if eq $orientation "none" }}{{ $thumbnail = "" }}{{ end -}}
{{- $orientation := "stacked" -}}
{{- with .orientation }}{{ $orientation = . }}{{ end -}}
{{- $supportedOrientations := slice "stacked" "horizontal" "none" -}}
{{- if not (in $supportedOrientations $orientation) -}}
{{- errorf "Invalid value for param 'orientation': %s" $orientation -}}
{{- end -}}
{{- if eq $orientation "none" }}{{ $thumbnail = "" }}{{ $icon = "" }}{{ end -}}
{{ if eq $orientation "horizontal" -}}
{{- if eq $orientation "horizontal" -}}
<div class="card mb-3 {{ with $color }}bg-{{ . }} text-bg-{{ . }}{{ end }} {{ $class }}">
<div class="row g-0">
<div class="col-4">
{{ if $thumbnail -}}
{{- if $thumbnail -}}
<a href="{{ $href }}">
{{- partial "image.html" (dict "url" $thumbnail "ratio" "1x1" "outerClass" "h-100 card-img-wrap" "innerClass" "rounded-start card-img-h100" "title" $title) -}}
</a>
{{ end }}
{{- else if $icon -}}
<div class="pt-{{ $padding }} ps-{{ $padding }} pe-{{ $padding }}">
<a href="{{ $href }}">
{{- partial "assets/icon.html" (dict "icon" (printf "%s fa-4x text-secondary" $icon)) -}}
</a>
</div>
{{- end -}}
</div>
<div class="col-8">
<div class="card-body d-flex p-{{ $padding }} flex-column h-100">
<div>{{ partial "card-caption.html" (dict "page" $page "keywords" $header "color" $color) }}</div>
<div class="h-100">
{{ partial "card-body.html" (dict "title" $title "href" $href "color" $color "description" $description) }}
{{- partial "card-body.html" (dict "title" $title "href" $href "color" $color "description" $description) -}}
</div>
<div>{{ partial "card-caption.html" (dict "page" $page "keywords" $footer "color" $color) }}</div>
</div>
</div>
</div>
</div>
{{ else -}}
{{- else -}}
<div class="card {{ with $color }}bg-{{ . }} text-bg-{{ . }}{{ end }} {{ $class }}">
{{ if $thumbnail -}}
{{- if $thumbnail -}}
<a href="{{ $href }}">
{{- partial "image.html" (dict "url" $thumbnail "ratio" "16x9" "outerClass" "card-img-wrap" "innerClass" "card-img-top" "title" $title) -}}
</a>
{{ end }}
{{- else if $icon -}}
<div class="pt-{{ $padding }} ps-{{ $padding }} pe-{{ $padding }}">
<a href="{{ $href }}">
{{- partial "assets/icon.html" (dict "icon" (printf "%s fa-4x text-secondary" $icon)) -}}
</a>
</div>
{{- end -}}
<div class="card-body d-flex flex-column p-{{ $padding }}">
{{ partial "card-caption.html" (dict "page" $page "keywords" $header "color" $color) }}
{{ partial "card-body.html" (dict "title" $title "href" $href "color" $color "description" $description) }}
{{ partial "card-caption.html" (dict "page" $page "keywords" $footer "color" $color) }}
{{- partial "card-caption.html" (dict "page" $page "keywords" $header "color" $color) -}}
{{- partial "card-body.html" (dict "title" $title "href" $href "color" $color "description" $description) -}}
{{- partial "card-caption.html" (dict "page" $page "keywords" $footer "color" $color) -}}
</div>
</div>
{{ end -}}
{{- end -}}

View File

@@ -0,0 +1,16 @@
{{- $icon := .icon -}}
{{- if not $icon -}}
{{- errorf "Expected value for param 'icon'" -}}
{{- end -}}
{{- $icon_class := split $icon " " -}}
{{- $attr := delimit (after 1 $icon_class) " " -}}
{{- if eq (index $icon_class 0) "fas" -}}
<i class="fa-solid fa-{{ $attr}}"></i>
{{- else if eq (index $icon_class 0) "fab" -}}
<i class="fa-brands fa-{{ $attr }}"></i>
{{- else if eq (index $icon_class 0) "fa" -}}
<i class="fa-regular fa-{{ $attr }}"></i>
{{- else -}}
{{- errorf "Unrecognized icon class: %s" $icon_class -}}
{{- end -}}

View File

@@ -13,96 +13,96 @@
"title" Optional brand title, displayed when the logo is not set. Defaults to the site's title.
-->
{{ $supportedFlags := slice "true" "false" -}}
{{- $supportedFlags := slice "true" "false" -}}
{{- $id := 0 -}}
{{ with .id }}{{ $id = . }}{{ end }}
{{- with .id }}{{ $id = . }}{{ end -}}
{{ $page := .page -}}
{{ if not $page -}}
{{ errorf "Missing value for param 'page'" -}}
{{ end -}}
{{- $page := .page -}}
{{- if not $page -}}
{{- errorf "Missing value for param 'page'" -}}
{{- end -}}
{{ $menuName := "main" }}
{{ with .menus }}{{ $menuName = .}}{{ end -}}
{{ $menus := index site.Menus $menuName -}}
{{ if or (ne (printf "%T" $menus) "navigation.Menu") (ne (index $menus 0).Menu $menuName) -}}
{{ errorf "Invalid value for param 'menus': %s" $menuName -}}
{{ end -}}
{{- $menuName := "main" }}
{{- with .menus }}{{ $menuName = .}}{{ end -}}
{{- $menus := index site.Menus $menuName -}}
{{- if or (ne (printf "%T" $menus) "navigation.Menu") (ne (index $menus 0).Menu $menuName) -}}
{{- errorf "Invalid value for param 'menus': %s" $menuName -}}
{{- end -}}
{{ $size := "md" -}}
{{ with .size }}{{ $size = . }}{{ end -}}
{{ $supportedSizes := slice "xs" "sm" "md" "lg" "xl" -}}
{{ if not (in $supportedSizes $size) -}}
{{ errorf "Invalid value for param 'size': %s" $size -}}
{{ end -}}
{{- $size := "md" -}}
{{- with .size }}{{ $size = . }}{{ end -}}
{{- $supportedSizes := slice "xs" "sm" "md" "lg" "xl" -}}
{{- if not (in $supportedSizes $size) -}}
{{- errorf "Invalid value for param 'size': %s" $size -}}
{{- end -}}
{{ $style := "light" -}}
{{ with .style }}{{ $style = . }}{{ end -}}
{{ $supportedStyles := slice "light" "dark" -}}
{{ if not (in $supportedStyles $style) -}}
{{ errorf "Invalid value for param 'style': %s" $style -}}
{{ end -}}
{{- $style := "light" -}}
{{- with .style }}{{ $style = . }}{{ end -}}
{{- $supportedStyles := slice "light" "dark" -}}
{{- if not (in $supportedStyles $style) -}}
{{- errorf "Invalid value for param 'style': %s" $style -}}
{{- end -}}
{{ $fixedParam := "false" -}}
{{ $fixed := false -}}
{{ with .fixed }}{{ $fixedParam = . }}{{ end -}}
{{ if in $supportedFlags $fixedParam -}}
{{ if eq $fixedParam "true" }}{{ $fixed = true }}{{ else }}{{ $fixed = false }}{{ end -}}
{{ else -}}
{{ errorf "Invalid value for param 'fixed': %s" $fixedParam -}}
{{ end -}}
{{- $fixedParam := "false" -}}
{{- $fixed := false -}}
{{- with .fixed }}{{ $fixedParam = . }}{{ end -}}
{{- if in $supportedFlags $fixedParam -}}
{{- if eq $fixedParam "true" }}{{ $fixed = true }}{{ else }}{{ $fixed = false }}{{ end -}}
{{- else -}}
{{- errorf "Invalid value for param 'fixed': %s" $fixedParam -}}
{{- end -}}
{{ $inverseStyle := "light" -}}
{{ if eq $style "light" }}{{ $inverseStyle = "dark" }}{{ end -}}
{{- $inverseStyle := "light" -}}
{{- if eq $style "light" }}{{ $inverseStyle = "dark" }}{{ end -}}
{{ $color := "" -}}
{{ with .color }}
{{ $color = . }}
{{ $supportedColors := slice "primary" "secondary" "success" "danger" "warning" "info" "light" "dark" "white" "black" -}}
{{ if not (in $supportedColors $color) -}}
{{ errorf "Invalid value for param 'color': %s" $color -}}
{{ end -}}
{{ end -}}
{{- $color := "" -}}
{{- with .color -}}
{{- $color = . -}}
{{- $supportedColors := slice "primary" "secondary" "success" "danger" "warning" "info" "light" "dark" "white" "black" -}}
{{- if not (in $supportedColors $color) -}}
{{- errorf "Invalid value for param 'color': %s" $color -}}
{{- end -}}
{{- end -}}
{{ $search := default true site.Params.navigation.search -}}
{{ with .search }}
{{ $searchParam := . }}
{{ if in $supportedFlags $searchParam -}}
{{ if eq $searchParam "true" }}{{ $search = true }}{{ else }}{{ $search = false }}{{ end -}}
{{ else -}}
{{ errorf "Invalid value for param 'search': %s" $searchParam -}}
{{ end -}}
{{ end -}}
{{- $search := default true site.Params.navigation.search -}}
{{- with .search -}}
{{- $searchParam := . -}}
{{- if in $supportedFlags $searchParam -}}
{{- if eq $searchParam "true" }}{{ $search = true }}{{ else }}{{ $search = false }}{{ end -}}
{{- else -}}
{{- errorf "Invalid value for param 'search': %s" $searchParam -}}
{{- end -}}
{{- end -}}
{{ $logo := site.Params.navigation.logo -}}
{{ with .logo }}{{ $logo = . }}{{ end -}}
{{- $logo := site.Params.navigation.logo -}}
{{- with .logo }}{{ $logo = . }}{{ end -}}
{{ $title := site.Title -}}
{{ if .title -}}
{{ $title = .title -}}
{{ if not .logo }}{{ $logo = "" }}{{ end -}}
{{ end -}}
{{- $title := site.Title -}}
{{- if .title -}}
{{- $title = .title -}}
{{- if not .logo }}{{ $logo = "" }}{{ end -}}
{{- end -}}
{{ $pre := .Pre -}}
{{ $post := .Post -}}
{{- $pre := .Pre -}}
{{- $post := .Post -}}
<nav class="navbar navbar-expand-{{ $size }} navbar-{{ $style }} {{ with $color }}bg-{{ . }}{{ end }} {{ if $fixed }}fixed-top{{ end }} p-3">
<div class="container-fluid">
<!-- Insert sidebar toggler when applicable -->
{{ if $page.Scratch.Get "sidebar" }}
{{- if $page.Scratch.Get "sidebar" -}}
<button class="navbar-toggler collapsed ms-n3" type="button" data-bs-toggle="offcanvas" data-bs-target="#offcanvass-sidebar" aria-controls="offcanvass-sidebar" aria-label="Toggle docs navigation">
<i class="fa-solid fa-ellipsis"></i>
{{- partial "assets/icon.html" (dict "icon" "fas ellipsis") -}}
</button>
{{ end }}
{{- end -}}
<!-- Insert the brand logo or name -->
<a class="navbar-brand mx-auto" href="{{ site.Home.RelPermalink }}">
{{ if $logo -}}
{{- if $logo -}}
<img src="{{ $logo }}" alt="{{ $title }} logo" height="30">
{{ else -}}
{{- else -}}
<span class="fw-bold">{{ $title }}</span>
{{ end -}}
{{- end -}}
</a>
<!-- Insert main navigation toggler -->
@@ -115,55 +115,62 @@
<div class="navbar-collapse collapse" id="navbarSupportedContent-{{ $id }}">
<!-- Insert search input -->
{{ if $search }}{{ partial "assets/search-input.html" -}}{{ end }}
{{- if $search }}{{ partial "assets/search-input.html" -}}{{ end -}}
<!-- Render top-menu items (maximum depth of 2) -->
<ul class="navbar-nav ms-auto">
{{ range $menu := $menus -}}
{{ $menu_item_url := $menu.URL | relLangURL -}}
{{ $page_url:= $page.RelPermalink | relLangURL -}}
{{ $active := hasPrefix $page_url $menu_item_url -}}
{{- range $menu := $menus -}}
{{- $menu_item_url := $menu.URL | relLangURL -}}
{{- $page_url:= $page.RelPermalink | relLangURL -}}
{{- $active := hasPrefix $page_url $menu_item_url -}}
{{ $url := urls.Parse .URL -}}
{{ $baseurl := urls.Parse $.Site.Params.Baseurl -}}
{{ if .HasChildren -}}
{{- $url := urls.Parse .URL -}}
{{- $baseurl := urls.Parse $.Site.Params.Baseurl -}}
{{- if .HasChildren -}}
<li class="nav-item dropdown">
<a class="nav-link {{ if $active }}link-dark{{ end }} dropdown-toggle" href="{{ .URL }}" role="button" data-bs-toggle="dropdown" aria-expanded="false">
{{ .Name }}
</a>
<ul class="dropdown-menu dropdown-menu-end">
{{ range .Children -}}
{{- range .Children -}}
<li><a class="dropdown-item" href="{{ .URL }}">{{ .Name }}</a></li>
{{ end -}}
{{- end -}}
</ul>
</li>
{{ else -}}
{{- else -}}
<li class="nav-item">
<a class="nav-link {{ if $active }}active{{ end }}" href="{{ with .Page }}{{ .RelPermalink }}{{ else }}{{ .URL | relLangURL }}{{ end }}" {{ if ne $url.Host $baseurl.Host }}target="_blank" {{ end }}>{{ with $pre}}{{ . }}{{ end }}<span {{if $active }} class="active"{{end}}>{{ .Name }}</span>{{ with $post}}{{ . }}{{ end }}</a>
{{- $external := ne $url.Host $baseurl.Host -}}
<a class="nav-link {{ if $active }}active{{ end }}"
href="{{ with .Page }}{{ .RelPermalink }}{{ else }}{{ .URL | relLangURL }}{{ end }}" {{ if $external }}target="_blank" {{ end }}>
{{- with $pre}}{{ . }}{{ end -}}
<span {{if $active }} class="active"{{end}}>{{ .Name }}</span>
{{- with $post}}{{ . }}{{ end -}}
{{- if $external }} {{ partial "assets/icon.html" (dict "icon" "fas up-right-from-square fa-2xs") }}{{ end -}}
</a>
</li>
{{ end }}
{{ end -}}
{{- end -}}
{{- end -}}
<!-- Insert language switcher if applicable -->
{{ if or $page.IsTranslated site.IsMultiLingual }}
{{ $currentLang := $page.Language.Lang }}
{{- if or $page.IsTranslated site.IsMultiLingual -}}
{{- $currentLang := $page.Language.Lang -}}
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="#" role="button" data-bs-toggle="dropdown" aria-expanded="false">
<i class="fa-solid fa-globe"></i> {{ T "languageSwitcherLabel" }}
{{- partial "assets/icon.html" (dict "icon" "fas globe") }} {{ T "languageSwitcherLabel" -}}
</a>
<ul class="dropdown-menu dropdown-menu-end ">
{{ if $page.IsTranslated -}}
{{ range $page.AllTranslations -}}
{{- if $page.IsTranslated -}}
{{- range $page.AllTranslations -}}
<li><a class="dropdown-item {{ if eq .Language.Lang $currentLang }}active{{ end }}" href="{{ .Permalink }}">{{ .Language.LanguageName }}</a></li>
{{ end -}}
{{ else -}}
{{ range site.Languages -}}
{{- end -}}
{{- else -}}
{{- range site.Languages -}}
<li><a class="dropdown-item" href="/{{ .Lang }}">{{ default .Lang .LanguageName }}</a></li>
{{ end -}}
{{ end -}}
{{- end -}}
{{- end -}}
</ul>
</li>
{{ end -}}
{{- end -}}
</ul>
</div>
</div>

View File

@@ -20,6 +20,7 @@
{{- $footer := "none" -}}
{{- $style := "" -}}
{{- $homepage := 3 -}}
{{- $background := "" -}}
{{- with (index site.Params $section) -}}
{{- with index . "title" }}{{ $title = . }}{{ end -}}
@@ -32,15 +33,19 @@
{{- with index . "header" }}{{ $header = . }}{{ end -}}
{{- with index . "footer" }}{{ $footer = . }}{{ end -}}
{{- with index . "style" }}{{ $style = . }}{{ end -}}
{{- with index . "homepage" }}{{ $homepage = . }}{{ end -}}
{{- with index . "background" }}{{ $background = . }}{{ end -}}
{{- end -}}
{{- $list := where site.RegularPages "Type" "in" $section -}}
{{- $max := (len $list) -}}
{{- if $home }}
{{ $paginate = false }}
{{ $max = $homepage }}
{{- if $home -}}
{{- $paginate = false -}}
{{- $max = int (math.Min $homepage $max) -}}
{{ end -}}
{{- $cols = int (math.Min $cols $max) -}}
{{- if eq $sort "weight" -}}
{{- $list = $list.ByWeight -}}
{{- else if eq $sort "publication" -}}
@@ -60,11 +65,11 @@
{{- end -}}
{{- if $reverse -}}{{- $list = $list.Reverse -}}{{ end -}}
<div class="container-fluid flex-fill p-0">
<div class="container-fluid flex-fill p-0{{ with $background }} bg-{{ . }}{{ end }}">
{{- partial "assets/card-group.html" (dict
"page" $page
"list" $list
"max" 3
"max" $max
"cols" $cols
"title" $title
"href" $sectionURL

View File

@@ -2,8 +2,8 @@
<div class="row row-cols-1 row-cols-sm-3 align-items-center pt-5 pb-5 h-100">
<div class="col col-md-2 d-none d-md-block"></div>
<div class="col col-sm-6 col-md-4 text-center text-sm-start">
<p class="fs-1 fw-bold">{{ .Site.Params.feature.message }}</p>
<p>{{ .Site.Params.feature.tagline | safeHTML }}</p>
<p class="fs-1 fw-bold">{{ .Title }}</p>
<p>{{ .Content }}</p>
{{ if .Site.Params.feature.link }}
<p><a class="btn btn-primary" href="{{ .Site.Params.feature.link | safeURL }}" role="button">{{ .Site.Params.feature.caption | default (T "about") }}</a></p>
{{ end }}

View File

@@ -8,7 +8,8 @@
*/ -}}
{{- $name := .Get "name" -}}
{{- $file := path.Clean (.Get "file") -}}
{{- $basePath := .Site.Params.docs.basePath -}}
{{- $file := path.Join $basePath (path.Clean (.Get "file")) -}}
{{- $extension := path.Ext $file -}}
{{- $capture_start := "" -}}
{{- $capture_end := "" -}}

View File

@@ -1,5 +1,5 @@
{{- if not (.Get 0) -}}
{{- errorf "Expected icon name: %s" .Position -}}
{{- else -}}
<i class="fa-regular fa-{{ (delimit .Params " ") }}"></i>
{{- partial "assets/icon.html" (dict "icon" (printf "fa %s" (delimit .Params " "))) }}
{{- end -}}

View File

@@ -1,5 +1,5 @@
{{- if not (.Get 0) -}}
{{- errorf "Expected icon name: %s" .Position -}}
{{- else -}}
<i class="fa-brands fa-{{ (delimit .Params " ") }}"></i>
{{- partial "assets/icon.html" (dict "icon" (printf "fab %s" (delimit .Params " "))) }}
{{- end -}}

View File

@@ -1,5 +1,5 @@
{{- if not (.Get 0) -}}
{{- errorf "Expected icon name: %s" .Position -}}
{{- else -}}
<i class="fa-solid fa-{{ (delimit .Params " ") }}"></i>
{{- partial "assets/icon.html" (dict "icon" (printf "fas %s" (delimit .Params " "))) }}
{{- end -}}

4
package-lock.json generated
View File

@@ -1,12 +1,12 @@
{
"name": "@gethinode/hinode",
"version": "0.8.0",
"version": "0.8.1",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "@gethinode/hinode",
"version": "0.8.0",
"version": "0.8.1",
"hasInstallScript": true,
"license": "MIT",
"devDependencies": {

View File

@@ -1,6 +1,6 @@
{
"name": "@gethinode/hinode",
"version": "0.8.0",
"version": "0.8.3",
"description": "Hinode is a clean documentation and blog theme for Hugo, an open-source static site generator",
"keywords": [
"hugo",
@@ -48,7 +48,7 @@
"bugs": {
"url": "https://github.com/gethinode/hinode/issues"
},
"homepage": "https://github.com/gethinode/hinode#readme",
"homepage": "https://gethinode.com",
"devDependencies": {
"@fortawesome/fontawesome-free": "^6.2.1",
"@fullhuman/postcss-purgecss": "^5.0.0",

View File

@@ -2,7 +2,7 @@ name = "Hinode"
license = "MIT"
licenselink = "https://github.com/gethinode/hinode/blob/main/LICENSE"
description = "A clean documentation and blog theme for your Hugo site based on Bootstrap 5."
homepage = "https://github.com/gethinode/hinode"
homepage = "https://gethinode.com"
demosite = "https://demo.gethinode.com"
tags = ["blog", "documentation", "minimal", "modern", "customizable", "search", "bootstrap"]
features = ["security aware", "fast by default", "seo-ready", "development tools", "bootstrap framework", "netlify-ready", "full text search", "page layouts"]