Compare commits

..

17 Commits

Author SHA1 Message Date
Mark Dumay
b7ab9d5690 Merge pull request #359 from gethinode/develop
Refinement
2023-07-26 14:49:44 +02:00
mark
5d20be19a8 Update path for color script 2023-07-26 14:43:15 +02:00
Mark Dumay
132c316ff0 Merge branch 'main' into develop 2023-07-26 14:38:08 +02:00
mark
a3b9081b4d Bump package version 2023-07-26 14:03:25 +02:00
mark
8a689a95de Bump dependencies 2023-07-26 14:02:44 +02:00
mark
9bd04a5b2a Fix complement error for undefined core modules 2023-07-26 09:19:30 +02:00
mark
8dc884f846 Add npm install command 2023-07-26 09:02:31 +02:00
Mark Dumay
4cb558440b Merge pull request #357 from gethinode/hugo-mod-dependencies
Update Hugo module dependencies
2023-07-24 20:01:52 +02:00
mark
0d78918aa4 Set dark mode to disabled by default 2023-07-24 17:18:23 +02:00
mark
ba7ab907ef Fix behavior of critical scripts 2023-07-24 17:18:06 +02:00
markdumay
af557ac054 fix: update Hugo module dependencies 2023-07-23 03:15:51 +00:00
Mark Dumay
9ada0eee80 Merge pull request #355 from gethinode/develop
Fix behavior in default state
2023-07-22 14:57:41 +02:00
Mark Dumay
ae3e20b596 Merge branch 'main' into develop 2023-07-22 14:46:19 +02:00
mark
c49e6f14c1 Bump package version 2023-07-22 14:45:17 +02:00
mark
b4f6b1aa3d Move bootstrap mod check to base template 2023-07-22 14:44:46 +02:00
mark
962549f2ae Allow undefined main menu 2023-07-22 13:13:40 +02:00
Mark Dumay
28601323c4 Update README.md 2023-07-22 07:52:46 +02:00
12 changed files with 39 additions and 26 deletions

View File

@@ -1,5 +1,5 @@
assets/js/critical/color.js
assets/js/analytics.js assets/js/analytics.js
assets/js/color.js
assets/js/flexsearch.js assets/js/flexsearch.js
assets/js/vendor assets/js/vendor
node_modules node_modules

View File

@@ -56,10 +56,11 @@
- [PageSpeed Insights][pagespeed] - [PageSpeed Insights][pagespeed]
- [Mozilla Observatory][observatory] - [Mozilla Observatory][observatory]
Hinode is a clean documentation and blog theme for [Hugo][hugo], an open-source static site generator. Based on the [Bootstrap 5][bootstrap] framework, the rendered site is fast, secure, and responsive. Hinode uses [FlexSearch][flexsearch] to enable full text search across your site. Finally, the theme uses [Node Package Manager][npm] to automate the build process and to keep track of dependencies. Hinode is a clean documentation and blog theme for [Hugo][hugo], an open-source static site generator. Based on the [Bootstrap 5][bootstrap] framework, the rendered site is fast, secure, and responsive. Hinode uses [FlexSearch][flexsearch] to enable full text search across your site. Finally, the theme supports [Node Package Manager][npm] to automate the build process and to keep track of dependencies.
Additional features include: Additional features include:
- Flexible configuration of Hugo modules
- Switching between light mode and dark mode - Switching between light mode and dark mode
- Support for multiple languages - Support for multiple languages
- Reusable Bootstrap components through configurable shortcodes and partials - Reusable Bootstrap components through configurable shortcodes and partials

View File

@@ -1,3 +1,5 @@
{{- if site.Params.main.enableDarkMode -}}
/*! /*!
* Color mode toggler for Bootstrap's docs (https://getbootstrap.com/) * Color mode toggler for Bootstrap's docs (https://getbootstrap.com/)
* Copyright 2011-2022 The Bootstrap Authors * Copyright 2011-2022 The Bootstrap Authors
@@ -68,3 +70,5 @@
}) })
}) })
})() })()
{{- end -}}

View File

@@ -5,10 +5,6 @@
@import "common/variables.scss"; @import "common/variables.scss";
@import "common/icons.scss"; @import "common/icons.scss";
{{ if not (in site.Params.modules.core "bootstrap") }}
{{ errorf "Bootstrap is a required module, please add it to 'modules.core' in your site parameters" }}
{{ end }}
// Import Bootstrap configuration (mounted by core Bootstrap module) // Import Bootstrap configuration (mounted by core Bootstrap module)
@import "bootstrap.scss"; @import "bootstrap.scss";

2
go.mod
View File

@@ -4,7 +4,7 @@ go 1.19
require ( require (
github.com/gethinode/mod-bootstrap v1.1.0 // indirect github.com/gethinode/mod-bootstrap v1.1.0 // indirect
github.com/gethinode/mod-flexsearch v1.1.2 // indirect github.com/gethinode/mod-flexsearch v1.1.4 // indirect
github.com/gethinode/mod-fontawesome v1.2.1 // indirect github.com/gethinode/mod-fontawesome v1.2.1 // indirect
github.com/gethinode/mod-katex v1.0.2 // indirect github.com/gethinode/mod-katex v1.0.2 // indirect
github.com/gethinode/mod-leaflet v0.3.3 // indirect github.com/gethinode/mod-leaflet v0.3.3 // indirect

4
go.sum
View File

@@ -10,6 +10,10 @@ github.com/gethinode/mod-flexsearch v1.1.1 h1:zHypfKR/rWPAwqNXvo09Pp3vGqU4w3r7d2
github.com/gethinode/mod-flexsearch v1.1.1/go.mod h1:TXbGbWsvmhBdsTzRt887mcpFfr4ORpzG3+h/l4W3YM4= github.com/gethinode/mod-flexsearch v1.1.1/go.mod h1:TXbGbWsvmhBdsTzRt887mcpFfr4ORpzG3+h/l4W3YM4=
github.com/gethinode/mod-flexsearch v1.1.2 h1:vA/jHxLq9xxkYGS9cmAoLNIkEBW+iLVCcQ8qKyEa+R4= github.com/gethinode/mod-flexsearch v1.1.2 h1:vA/jHxLq9xxkYGS9cmAoLNIkEBW+iLVCcQ8qKyEa+R4=
github.com/gethinode/mod-flexsearch v1.1.2/go.mod h1:TXbGbWsvmhBdsTzRt887mcpFfr4ORpzG3+h/l4W3YM4= github.com/gethinode/mod-flexsearch v1.1.2/go.mod h1:TXbGbWsvmhBdsTzRt887mcpFfr4ORpzG3+h/l4W3YM4=
github.com/gethinode/mod-flexsearch v1.1.3 h1:lzmSvnJL6ABjp03avYzSvJJ7hw01CpHap1JGUbDIELg=
github.com/gethinode/mod-flexsearch v1.1.3/go.mod h1:TXbGbWsvmhBdsTzRt887mcpFfr4ORpzG3+h/l4W3YM4=
github.com/gethinode/mod-flexsearch v1.1.4 h1:dJvwBxYlLe/VGlctLn8k89STJ5toATIjNnXIlNeanOY=
github.com/gethinode/mod-flexsearch v1.1.4/go.mod h1:TXbGbWsvmhBdsTzRt887mcpFfr4ORpzG3+h/l4W3YM4=
github.com/gethinode/mod-fontawesome v1.0.2 h1:ZSK6D20/w4y5GnfYfTBB58uHD0ChIfkpKfRGwioS9rg= github.com/gethinode/mod-fontawesome v1.0.2 h1:ZSK6D20/w4y5GnfYfTBB58uHD0ChIfkpKfRGwioS9rg=
github.com/gethinode/mod-fontawesome v1.0.2/go.mod h1:Ki1qkWEOiF0hQpCgWeZRw+HkpL6nd1DxKFptU0O2feI= github.com/gethinode/mod-fontawesome v1.0.2/go.mod h1:Ki1qkWEOiF0hQpCgWeZRw+HkpL6nd1DxKFptU0O2feI=
github.com/gethinode/mod-fontawesome v1.1.0 h1:rsDzUI+3ZlS/do2ff3ne8/z3KwHeysmuA+WsXlumXXk= github.com/gethinode/mod-fontawesome v1.1.0 h1:rsDzUI+3ZlS/do2ff3ne8/z3KwHeysmuA+WsXlumXXk=

View File

@@ -12,6 +12,10 @@
{{- end -}} {{- end -}}
{{- end -}} {{- end -}}
{{- if and .IsPage (not (in .Site.Params.modules.core "bootstrap")) -}}
{{- errorf "Bootstrap is a required module, please add it to 'modules.core' in your site parameters" -}}
{{- end -}}
<!doctype html> <!doctype html>
<html lang="{{ .Site.Language.Lang }}" class="no-js"> <html lang="{{ .Site.Language.Lang }}" class="no-js">
<head> <head>
@@ -19,9 +23,7 @@
</head> </head>
<body> <body>
{{- if site.Params.main.enableDarkMode -}} {{- partial "footer/scripts.html" (dict "filename" "js/critical.bundle.js" "match" "js/critical/**.js" "header" true "page" .) -}}
{{- partial "footer/scripts.html" (dict "filename" "js/critical.bundle.js" "match" "js/critical/**.js" "header" true "page" .) -}}
{{- end -}}
<div class="d-flex flex-column min-vh-100{{ if and .IsHome .Site.Params.home.style }} {{ .Site.Params.home.style }}{{ end }}"> <div class="d-flex flex-column min-vh-100{{ if and .IsHome .Site.Params.home.style }} {{ .Site.Params.home.style }}{{ end }}">
<div class="{{ if .Site.Params.navigation.fixed }}mb-4{{ end }}"> <div class="{{ if .Site.Params.navigation.fixed }}mb-4{{ end }}">
{{- partial "assets/navbar.html" (dict {{- partial "assets/navbar.html" (dict

View File

@@ -105,11 +105,14 @@
{{- errorf "partial [assets/navbar.html] - Missing value for param 'page'" -}} {{- errorf "partial [assets/navbar.html] - Missing value for param 'page'" -}}
{{- end -}} {{- end -}}
{{- $menuName := "main" }} {{- $defaultMenu := "main" }}
{{- with .menus }}{{ $menuName = .}}{{ end -}} {{- $menuName := $defaultMenu }}
{{- with .menus }}{{ $menuName = . }}{{ end -}}
{{- $menus := index site.Menus $menuName -}} {{- $menus := index site.Menus $menuName -}}
{{- if or (ne (printf "%T" $menus) "navigation.Menu") (ne (index $menus 0).Menu $menuName) -}} {{- if or (ne (printf "%T" $menus) "navigation.Menu") (ne (index $menus 0).Menu $menuName) -}}
{{- errorf "partial [assets/navbar.html] - Invalid value for param 'menus': %s" $menuName -}} {{- if ne $menuName $defaultMenu }}
{{- errorf "partial [assets/navbar.html] - Invalid value for param 'menus': %s" $menuName -}}
{{- end -}}
{{- end -}} {{- end -}}
{{- $size := "md" -}} {{- $size := "md" -}}
@@ -147,7 +150,7 @@
{{- end -}} {{- end -}}
{{- end -}} {{- end -}}
{{- $enableDarkMode := default true site.Params.main.enableDarkMode -}} {{- $enableDarkMode := default false site.Params.main.enableDarkMode -}}
{{- with .mode -}} {{- with .mode -}}
{{- $darkModeParam := . -}} {{- $darkModeParam := . -}}
{{- if in $supportedFlags $darkModeParam -}} {{- if in $supportedFlags $darkModeParam -}}
@@ -238,7 +241,7 @@
{{- end -}} {{- end -}}
<!-- Insert divider if applicable --> <!-- Insert divider if applicable -->
{{- if or $enableLanguage $enableVersions -}} {{- if and $menus (or $enableLanguage $enableVersions) -}}
<li class="nav-item py-2 py-md-1 col-12 col-md-auto d-none d-{{ $size }}-block"> <li class="nav-item py-2 py-md-1 col-12 col-md-auto d-none d-{{ $size }}-block">
<div class="vr d-none d-md-flex h-100 mx-md-2"></div> <div class="vr d-none d-md-flex h-100 mx-md-2"></div>
</li> </li>

View File

@@ -23,9 +23,11 @@
{{- end }} {{- end }}
{{- end -}} {{- end -}}
{{- if not hugo.IsProduction -}} {{- if gt (len $js.Content) 0 -}}
<script src="{{ $js.Permalink }}"></script> {{- if not hugo.IsProduction -}}
{{ else -}} <script src="{{ $js.Permalink }}"></script>
{{ $js = $js | minify | fingerprint -}} {{ else -}}
<script src="{{ $js.Permalink }}" integrity="{{ $js.Data.Integrity }}" crossorigin="anonymous"></script> {{ $js = $js | minify | fingerprint -}}
<script src="{{ $js.Permalink }}" integrity="{{ $js.Data.Integrity }}" crossorigin="anonymous"></script>
{{ end -}}
{{ end -}} {{ end -}}

View File

@@ -6,7 +6,7 @@
{{- $modules := "" -}} {{- $modules := "" -}}
{{ if $core }} {{ if $core }}
{{- if reflect.IsSlice site.Params.modules.excludeSCSS -}} {{- if reflect.IsSlice site.Params.modules.excludeSCSS -}}
{{- $modules = complement site.Params.modules.excludeSCSS site.Params.modules.core -}} {{- $modules = complement site.Params.modules.excludeSCSS (or site.Params.modules.core slice) -}}
{{ else }} {{ else }}
{{- $modules = site.Params.modules.core -}} {{- $modules = site.Params.modules.core -}}
{{ end }} {{ end }}

4
package-lock.json generated
View File

@@ -1,12 +1,12 @@
{ {
"name": "@gethinode/hinode", "name": "@gethinode/hinode",
"version": "0.16.2", "version": "0.16.4",
"lockfileVersion": 2, "lockfileVersion": 2,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "@gethinode/hinode", "name": "@gethinode/hinode",
"version": "0.16.2", "version": "0.16.4",
"license": "MIT", "license": "MIT",
"devDependencies": { "devDependencies": {
"@fortawesome/fontawesome-free": "^6.4.0", "@fortawesome/fontawesome-free": "^6.4.0",

View File

@@ -1,6 +1,6 @@
{ {
"name": "@gethinode/hinode", "name": "@gethinode/hinode",
"version": "0.16.2", "version": "0.16.4",
"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",
@@ -20,7 +20,7 @@
"prestart": "npm run clean && npm run mod:vendor", "prestart": "npm run clean && npm run mod:vendor",
"start": "hugo server --bind=0.0.0.0 --disableFastRender", "start": "hugo server --bind=0.0.0.0 --disableFastRender",
"start:prod": "hugo server --bind=0.0.0.0 --disableFastRender --printI18nWarnings -e production", "start:prod": "hugo server --bind=0.0.0.0 --disableFastRender --printI18nWarnings -e production",
"prebuild": "npm run clean", "prebuild": "npm run clean && npm run -s mod:install",
"build": "hugo --gc --minify", "build": "hugo --gc --minify",
"build:debug": "hugo -e debug --debug", "build:debug": "hugo -e debug --debug",
"build:preview": "npm run build -D -F", "build:preview": "npm run build -D -F",
@@ -32,6 +32,7 @@
"lint:markdown": "markdownlint-cli2 \"*.md\" \"content/**/*.md\"", "lint:markdown": "markdownlint-cli2 \"*.md\" \"content/**/*.md\"",
"lint:markdown-fix": "markdownlint-cli2-fix \"*.md\" \"content/**/*.md\"", "lint:markdown-fix": "markdownlint-cli2-fix \"*.md\" \"content/**/*.md\"",
"mod:clean": "hugo mod clean", "mod:clean": "hugo mod clean",
"mod:install": "hugo mod get ./... && npm run -s mod:vendor && npm run -s mod:tidy",
"mod:update": "hugo mod get -u ./... && npm run -s mod:vendor && npm run -s mod:tidy", "mod:update": "hugo mod get -u ./... && npm run -s mod:vendor && npm run -s mod:tidy",
"mod:tidy": "hugo mod tidy", "mod:tidy": "hugo mod tidy",
"mod:vendor": "rimraf _vendor && hugo mod vendor", "mod:vendor": "rimraf _vendor && hugo mod vendor",
@@ -43,7 +44,7 @@
"create:syntax-light": "hugo gen chromastyles --style=github > ./assets/scss/components/_syntax-light.scss", "create:syntax-light": "hugo gen chromastyles --style=github > ./assets/scss/components/_syntax-light.scss",
"create:syntax-dark": "hugo gen chromastyles --style=github-dark > ./assets/scss/components/_syntax-dark.scss", "create:syntax-dark": "hugo gen chromastyles --style=github-dark > ./assets/scss/components/_syntax-dark.scss",
"update:syntax-dark": "replace-in-files --string=\"#ffffcc\" --replacement=\"#b8b800\" ./assets/scss/components/_syntax-dark.scss", "update:syntax-dark": "replace-in-files --string=\"#ffffcc\" --replacement=\"#b8b800\" ./assets/scss/components/_syntax-dark.scss",
"upgrade": "npx npm-check-updates -u" "upgrade": "npx npm-check-updates -u && mod:update"
}, },
"repository": { "repository": {
"type": "git", "type": "git",