mirror of
https://github.com/gethinode/hinode.git
synced 2025-10-07 10:04:22 +00:00
Compare commits
16 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
e0e694cda4 | ||
![]() |
40b36ef34b | ||
![]() |
d47adb99a2 | ||
![]() |
32b86d1183 | ||
![]() |
c17ac02c13 | ||
![]() |
ea6623349c | ||
![]() |
0d1b08e770 | ||
![]() |
868430b726 | ||
![]() |
d3330716ee | ||
![]() |
9799b9d6eb | ||
![]() |
092ee2f4a7 | ||
![]() |
9c0fca16bf | ||
![]() |
ac5521bffa | ||
![]() |
8634b1ecce | ||
![]() |
258040c345 | ||
![]() |
1cd93c131e |
@@ -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
2
assets/scss/theme.scss
Normal file
@@ -0,0 +1,2 @@
|
||||
// Placeholder to quickly add your own styles
|
||||
// The file is included last in the build pipeline
|
@@ -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]
|
||||
|
@@ -7,6 +7,7 @@
|
||||
# toml-docs-start docs
|
||||
[docs]
|
||||
version = "0.8"
|
||||
basePath = ""
|
||||
# toml-docs-end docs
|
||||
|
||||
# toml-docs-start home
|
||||
|
@@ -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.
|
||||
|
@@ -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. |
|
||||
|
@@ -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.
|
||||
|
@@ -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)
|
||||
-}}
|
||||
|
@@ -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>
|
@@ -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") -}} •
|
||||
{{ $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") -}} •
|
||||
{{- $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 }} • {{ 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 }}• {{ end -}}
|
||||
{{- range $index, $tag := first $maxTags ($page.GetTerms "tags") -}}
|
||||
{{- if gt $index 0 }}• {{ 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 -}}
|
||||
|
16
layouts/partials/assets/icon.html
Normal file
16
layouts/partials/assets/icon.html
Normal 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 -}}
|
@@ -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>
|
||||
|
@@ -20,6 +20,7 @@
|
||||
{{- $footer := "none" -}}
|
||||
{{- $style := "" -}}
|
||||
{{- $homepage := 3 -}}
|
||||
{{- $background := "" -}}
|
||||
|
||||
{{- with (index site.Params $section) -}}
|
||||
{{- with index . "title" }}{{ $title = . }}{{ end -}}
|
||||
@@ -33,6 +34,7 @@
|
||||
{{- 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 -}}
|
||||
@@ -63,7 +65,7 @@
|
||||
{{- 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
|
||||
|
@@ -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 }}
|
||||
|
@@ -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 := "" -}}
|
||||
|
@@ -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 -}}
|
||||
|
@@ -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 -}}
|
||||
|
@@ -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 -}}
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@gethinode/hinode",
|
||||
"version": "0.8.2",
|
||||
"version": "0.8.3",
|
||||
"description": "Hinode is a clean documentation and blog theme for Hugo, an open-source static site generator",
|
||||
"keywords": [
|
||||
"hugo",
|
||||
|
Reference in New Issue
Block a user