mirror of
https://github.com/gethinode/hinode.git
synced 2025-10-17 15:03:20 +00:00
Compare commits
9 Commits
v0.9.0-alp
...
v0.9.0-bet
Author | SHA1 | Date | |
---|---|---|---|
![]() |
0abf604d2a | ||
![]() |
ca51130286 | ||
![]() |
28e96deb73 | ||
![]() |
9173b6eaaa | ||
![]() |
492420d13f | ||
![]() |
d2ec492827 | ||
![]() |
d12cdc7a76 | ||
![]() |
a4f49ffb18 | ||
![]() |
6599912985 |
16
assets/js/navbar.js
Normal file
16
assets/js/navbar.js
Normal file
@@ -0,0 +1,16 @@
|
||||
const navbar = document.querySelector('.navbar')
|
||||
const toggler = document.getElementById('main-nav-toggler')
|
||||
|
||||
// set the navbar background color to opaque when scrolling past a breakpoint
|
||||
window.onscroll = () => {
|
||||
if (window.scrollY > 75) {
|
||||
navbar.classList.add('nav-active')
|
||||
} else {
|
||||
navbar.classList.remove('nav-active')
|
||||
}
|
||||
}
|
||||
|
||||
// set the navbar background color to opaque when expanded
|
||||
toggler.onclick = () => {
|
||||
navbar.classList.toggle('navbar-expanded')
|
||||
}
|
@@ -2,6 +2,15 @@
|
||||
|
||||
// Source: https://jsfiddle.net/njhgr40m/
|
||||
|
||||
.navbar {
|
||||
transition: 0.5s ease-in-out;
|
||||
background-color: none;
|
||||
}
|
||||
|
||||
.nav-active, .navbar-expanded {
|
||||
background-color: var(--bs-body-bg);
|
||||
}
|
||||
|
||||
/* Remove border from toggler */
|
||||
.navbar-toggler {
|
||||
border: 0 !important;
|
||||
|
@@ -16,13 +16,13 @@
|
||||
sections = ["blog", "projects"]
|
||||
featurePhoto = "/img/sunrise.jpg" # source: https://unsplash.com/photos/ZX6BPboJrYk
|
||||
fullCover = false
|
||||
style = ""
|
||||
# toml-docs-end home
|
||||
|
||||
# toml-docs-start navigation
|
||||
[navigation]
|
||||
logo = "/img/logo_icon.svg"
|
||||
color = "body"
|
||||
style = "light"
|
||||
fixed = true
|
||||
offset = "4em"
|
||||
search = true
|
||||
|
@@ -63,6 +63,8 @@
|
||||
translation: "Dunkel"
|
||||
- id: colorAuto
|
||||
translation: "Automatisch"
|
||||
- id: toggleMainNav
|
||||
translation: "Hauptmenü anzuzeigen oder auszublenden"
|
||||
|
||||
# 404 page
|
||||
- id: pageNotFound
|
||||
|
@@ -54,7 +54,7 @@
|
||||
- id: paginationLast
|
||||
translation: "Last"
|
||||
- id: toggleSidebar
|
||||
translation: "Toggle sidebar navigation"
|
||||
translation: "Toggle sidebar navigation"
|
||||
- id: colorMode
|
||||
translation: "Color mode"
|
||||
- id: colorLight
|
||||
@@ -63,6 +63,8 @@
|
||||
translation: "Dark"
|
||||
- id: colorAuto
|
||||
translation: "Auto"
|
||||
- id: toggleMainNav
|
||||
translation: "Toggle main navigation"
|
||||
|
||||
# 404 page
|
||||
- id: pageNotFound
|
||||
|
@@ -54,7 +54,7 @@
|
||||
- id: paginationLast
|
||||
translation: "Laatste"
|
||||
- id: toggleSidebar
|
||||
translation: "Toon of verberg navigatie"
|
||||
translation: "Toon of verberg navigatie"
|
||||
- id: colorMode
|
||||
translation: "Modus"
|
||||
- id: colorLight
|
||||
@@ -63,6 +63,8 @@
|
||||
translation: "Donker"
|
||||
- id: colorAuto
|
||||
translation: "Automatisch"
|
||||
- id: toggleMainNav
|
||||
translation: "Toon of verberg hoofdnavigatie"
|
||||
|
||||
# 404 page
|
||||
- id: pageNotFound
|
||||
|
@@ -7,12 +7,12 @@
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div class="d-flex flex-column min-vh-100">
|
||||
<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 }}">
|
||||
{{- partial "assets/navbar.html" (dict
|
||||
"page" .
|
||||
"fixed" (string .Site.Params.navigation.fixed)
|
||||
"color" (default "white" .Site.Params.navigation.color)
|
||||
"color" (.Site.Params.navigation.color)
|
||||
"style" (default "light" .Site.Params.navigation.style))
|
||||
-}}
|
||||
</div>
|
||||
|
@@ -3,7 +3,6 @@
|
||||
"page" Required object reference to the current page.
|
||||
"menus" Optional name of the menu configuration, defaults to "main".
|
||||
"size" Optional size of the button, either "sm", "md" (default), or "lg".
|
||||
"style" Optional style of the navbar, either "light" (default) or "dark".
|
||||
"fixed" Optional flag to indicate the navbar should stick to the top, defaults to false.
|
||||
"color" Optional background color of the navbar, either "primary", "secondary", "success",
|
||||
"danger", "warning", "info", "light", "dark", "white" or "black". The default color is none.
|
||||
@@ -37,13 +36,6 @@
|
||||
{{- 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 -}}
|
||||
|
||||
{{- $fixedParam := "false" -}}
|
||||
{{- $fixed := false -}}
|
||||
{{- with .fixed }}{{ $fixedParam = . }}{{ end -}}
|
||||
@@ -53,9 +45,6 @@
|
||||
{{- errorf "Invalid value for param 'fixed': %s" $fixedParam -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- $inverseStyle := "light" -}}
|
||||
{{- if eq $style "light" }}{{ $inverseStyle = "dark" }}{{ end -}}
|
||||
|
||||
{{- $color := "" -}}
|
||||
{{- with .color -}}
|
||||
{{- $color = . -}}
|
||||
@@ -112,9 +101,8 @@
|
||||
</a>
|
||||
|
||||
<!-- Insert main navigation toggler -->
|
||||
<button class="navbar-toggler collapsed me-n3" type="button" data-bs-toggle="collapse" data-bs-target="#navbarSupportedContent-{{ $id }}"
|
||||
aria-controls="navbarSupportedContent-{{ $id }}" aria-expanded="false" aria-label="Toggle main navigation">
|
||||
<!-- TODO: add i18n translation -->
|
||||
<button id="main-nav-toggler" class="navbar-toggler collapsed me-n3" type="button" data-bs-toggle="collapse" data-bs-target="#navbarSupportedContent-{{ $id }}"
|
||||
aria-controls="navbarSupportedContent-{{ $id }}" aria-expanded="false" aria-label="{{ T "toggleMainNav" }}">
|
||||
<span class="toggler-icon top-bar emphasis"></span>
|
||||
<span class="toggler-icon middle-bar emphasis"></span>
|
||||
<span class="toggler-icon bottom-bar emphasis"></span>
|
||||
|
12
package-lock.json
generated
12
package-lock.json
generated
@@ -5128,9 +5128,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/stylelint-config-standard-scss": {
|
||||
"version": "7.0.0",
|
||||
"resolved": "https://registry.npmjs.org/stylelint-config-standard-scss/-/stylelint-config-standard-scss-7.0.0.tgz",
|
||||
"integrity": "sha512-rHgydRJxN4Q9lDcwrLFoiFA3S8CRqsUcyBBCLwEMjIwzJViluFfsOKFPSomx6hScVQgQ4//Fx0hRKiSHyO0ihw==",
|
||||
"version": "7.0.1",
|
||||
"resolved": "https://registry.npmjs.org/stylelint-config-standard-scss/-/stylelint-config-standard-scss-7.0.1.tgz",
|
||||
"integrity": "sha512-m5sRdtsB1F5fnC1Ozla7ryftU47wVpO+HWd+JQTqeoG0g/oPh5EfbWfcVHbNCEtuoHfALIySiUWS20pz2hX6jA==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"stylelint-config-recommended-scss": "^9.0.0",
|
||||
@@ -9350,9 +9350,9 @@
|
||||
}
|
||||
},
|
||||
"stylelint-config-standard-scss": {
|
||||
"version": "7.0.0",
|
||||
"resolved": "https://registry.npmjs.org/stylelint-config-standard-scss/-/stylelint-config-standard-scss-7.0.0.tgz",
|
||||
"integrity": "sha512-rHgydRJxN4Q9lDcwrLFoiFA3S8CRqsUcyBBCLwEMjIwzJViluFfsOKFPSomx6hScVQgQ4//Fx0hRKiSHyO0ihw==",
|
||||
"version": "7.0.1",
|
||||
"resolved": "https://registry.npmjs.org/stylelint-config-standard-scss/-/stylelint-config-standard-scss-7.0.1.tgz",
|
||||
"integrity": "sha512-m5sRdtsB1F5fnC1Ozla7ryftU47wVpO+HWd+JQTqeoG0g/oPh5EfbWfcVHbNCEtuoHfALIySiUWS20pz2hX6jA==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"stylelint-config-recommended-scss": "^9.0.0",
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@gethinode/hinode",
|
||||
"version": "0.9.0-alpha3",
|
||||
"version": "0.9.0-beta",
|
||||
"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