Compare commits

...

84 Commits

Author SHA1 Message Date
Mark Dumay
e6586b52cd Merge pull request #992 from gethinode/develop
Remove spacing from pagination buttons
2024-06-10 07:05:06 +02:00
Mark Dumay
937964a02b Merge branch 'main' into develop 2024-06-10 06:56:39 +02:00
Mark Dumay
9b4afdfb35 Merge pull request #985 from gethinode/hugo-mod-dependencies
Update Hugo module dependencies
2024-06-10 06:56:15 +02:00
Mark Dumay
2121e663a0 Bump package release 2024-06-10 06:55:59 +02:00
Mark Dumay
46699664dc Remove spacing from pagination buttons 2024-06-10 06:55:00 +02:00
markdumay
98ec788fb3 fix: update Hugo module dependencies 2024-06-07 03:06:28 +00:00
github-actions[bot]
e248862905 Merge pull request #989 from gethinode/dependabot/npm_and_yarn/hugo-bin-0.124.0
Bump hugo-bin from 0.123.3 to 0.124.0
2024-06-06 13:13:31 +00:00
dependabot[bot]
8ba8acf675 Bump hugo-bin from 0.123.3 to 0.124.0
Bumps [hugo-bin](https://github.com/fenneclab/hugo-bin) from 0.123.3 to 0.124.0.
- [Release notes](https://github.com/fenneclab/hugo-bin/releases)
- [Commits](https://github.com/fenneclab/hugo-bin/compare/v0.123.3...v0.124.0)

---
updated-dependencies:
- dependency-name: hugo-bin
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-06-06 13:07:40 +00:00
github-actions[bot]
a7cf1ad918 Merge pull request #988 from gethinode/dependabot/npm_and_yarn/cssnano-7.0.2
Bump cssnano from 7.0.1 to 7.0.2
2024-06-05 14:12:55 +00:00
dependabot[bot]
492ce3e38b Bump cssnano from 7.0.1 to 7.0.2
Bumps [cssnano](https://github.com/cssnano/cssnano) from 7.0.1 to 7.0.2.
- [Release notes](https://github.com/cssnano/cssnano/releases)
- [Commits](https://github.com/cssnano/cssnano/compare/cssnano@7.0.1...cssnano@7.0.2)

---
updated-dependencies:
- dependency-name: cssnano
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-06-05 14:08:02 +00:00
github-actions[bot]
eaa5c217db Merge pull request #987 from gethinode/dependabot/npm_and_yarn/cssnano-preset-advanced-7.0.2
Bump cssnano-preset-advanced from 7.0.1 to 7.0.2
2024-06-05 14:07:17 +00:00
dependabot[bot]
410d681d23 Bump cssnano-preset-advanced from 7.0.1 to 7.0.2
Bumps [cssnano-preset-advanced](https://github.com/cssnano/cssnano) from 7.0.1 to 7.0.2.
- [Release notes](https://github.com/cssnano/cssnano/releases)
- [Commits](https://github.com/cssnano/cssnano/compare/cssnano-preset-advanced@7.0.1...cssnano-preset-advanced@7.0.2)

---
updated-dependencies:
- dependency-name: cssnano-preset-advanced
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-06-05 14:02:55 +00:00
Mark Dumay
deaf9f0fec Merge pull request #983 from gethinode/develop
Fix external links in navbar
2024-06-04 09:12:15 +02:00
Mark Dumay
7ed3313c55 Merge branch 'main' into develop 2024-06-04 09:06:15 +02:00
Mark Dumay
1477ff7bb2 Bump package release 2024-06-04 09:05:47 +02:00
Mark Dumay
7e2f6606bf Fix external links in navbar 2024-06-04 09:05:11 +02:00
Mark Dumay
2acc8fc737 Merge pull request #982 from gethinode/hugo-mod-dependencies
Update Hugo module dependencies
2024-06-04 06:19:46 +02:00
markdumay
96fe90ce9d fix: update Hugo module dependencies 2024-06-04 03:06:36 +00:00
github-actions[bot]
acf25e5375 Merge pull request #979 from gethinode/dependabot/npm_and_yarn/hugo-bin-0.123.3
Bump hugo-bin from 0.123.2 to 0.123.3
2024-06-03 13:58:51 +00:00
dependabot[bot]
aa35e03692 Bump hugo-bin from 0.123.2 to 0.123.3
Bumps [hugo-bin](https://github.com/fenneclab/hugo-bin) from 0.123.2 to 0.123.3.
- [Release notes](https://github.com/fenneclab/hugo-bin/releases)
- [Commits](https://github.com/fenneclab/hugo-bin/compare/v0.123.2...v0.123.3)

---
updated-dependencies:
- dependency-name: hugo-bin
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-06-03 13:51:57 +00:00
Mark Dumay
31cf9eb577 Merge pull request #978 from gethinode/develop
Publish v0.24.0 release
2024-06-03 13:14:41 +02:00
Mark Dumay
9a8ebd3558 Update release tag for plain images support 2024-06-03 13:08:22 +02:00
Mark Dumay
148c587283 Merge branch 'main' into develop 2024-06-03 13:06:01 +02:00
Mark Dumay
7c9c4cbabb Publish v0.24.0 release 2024-06-03 13:05:15 +02:00
Mark Dumay
20f14934c2 Merge pull request #977 from gethinode/develop
Bump package release
2024-06-03 12:52:10 +02:00
Mark Dumay
840e67d12d Merge branch 'main' into develop 2024-06-03 12:45:05 +02:00
Mark Dumay
8ef57a265e Bump package release 2024-06-03 12:43:19 +02:00
Mark Dumay
8677357450 Merge pull request #976 from gethinode/develop
Sync color mode when navigating browser history
2024-06-03 11:59:43 +02:00
Mark Dumay
79ac2dae4f Merge branch 'main' into develop 2024-06-03 11:32:15 +02:00
Mark Dumay
20cad07a0b Sync color mode when navigating browser history 2024-06-03 11:31:10 +02:00
Mark Dumay
2c97af2fef Merge pull request #975 from gethinode/develop
Smoothen transition between color modes
2024-06-03 11:30:49 +02:00
Mark Dumay
95ded6296c Merge branch 'main' into develop 2024-06-03 10:16:28 +02:00
Mark Dumay
3b46095821 Sync release numbering 2024-06-03 10:04:34 +02:00
Mark Dumay
1bf4e74e56 Smoothen transition between color modes 2024-06-03 10:02:58 +02:00
Mark Dumay
9b75b46c49 Merge pull request #974 from gethinode/develop
Fix color-mode switcher
2024-06-03 09:44:51 +02:00
Mark Dumay
107077f5ec Fix color-mode switcher 2024-06-03 09:36:48 +02:00
Mark Dumay
528b70bfa2 Merge branch 'main' into develop 2024-06-03 07:27:40 +02:00
Mark Dumay
75ab4625b1 Isolate production dependencies 2024-06-03 07:27:05 +02:00
Mark Dumay
bac3054ec2 Merge pull request #972 from gethinode/switch
Replace color-mode switcher
2024-06-03 06:23:02 +02:00
Mark Dumay
d63fd5f212 Merge branch 'main' into switch 2024-06-02 19:50:01 +02:00
Mark Dumay
c8b9df7ae5 Merge pull request #973 from gethinode/develop
Fix color-mode aware logo
2024-06-02 19:49:48 +02:00
Mark Dumay
12daa88f39 Bump package release 2024-06-02 19:42:05 +02:00
Mark Dumay
c5d895388b Fix color-mode aware logo 2024-06-02 19:41:21 +02:00
Mark Dumay
5678d2cab5 Replace color-mode switcher 2024-06-02 17:13:04 +02:00
Mark Dumay
99d939a3a0 Merge pull request #971 from gethinode/develop
Fix sidebar links
2024-06-02 12:02:05 +02:00
Mark Dumay
c9a87e8514 Fix sidebar links 2024-06-02 11:26:43 +02:00
Mark Dumay
af08829f7d Merge pull request #970 from gethinode/subfolder
Support deployments to subfolder
2024-06-02 07:41:21 +02:00
Mark Dumay
28a59a4eac Merge branch 'main' into subfolder 2024-06-02 07:27:55 +02:00
Mark Dumay
727387931c Support deployments to subfolder 2024-06-02 07:26:47 +02:00
github-actions[bot]
13a085099c Merge pull request #968 from gethinode/dependabot/npm_and_yarn/hugo-bin-0.123.2
Bump hugo-bin from 0.123.1 to 0.123.2
2024-05-31 13:33:46 +00:00
dependabot[bot]
473f390ee6 Bump hugo-bin from 0.123.1 to 0.123.2
Bumps [hugo-bin](https://github.com/fenneclab/hugo-bin) from 0.123.1 to 0.123.2.
- [Release notes](https://github.com/fenneclab/hugo-bin/releases)
- [Commits](https://github.com/fenneclab/hugo-bin/compare/v0.123.1...v0.123.2)

---
updated-dependencies:
- dependency-name: hugo-bin
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-05-31 13:28:03 +00:00
Mark Dumay
65cfc0933a Merge pull request #966 from gethinode/hugo-mod-dependencies
Update Hugo module dependencies
2024-05-30 08:56:14 +02:00
markdumay
321e7f6df5 fix: update Hugo module dependencies 2024-05-30 05:39:32 +00:00
Mark Dumay
dda623f040 Merge pull request #965 from gethinode/hugo-mod-dependencies
Update Hugo module dependencies
2024-05-30 06:50:03 +02:00
markdumay
80d1147d08 fix: update Hugo module dependencies 2024-05-30 03:05:37 +00:00
Mark Dumay
b28abcd6f2 Merge pull request #964 from gethinode/develop
Enable rewrite of CDN origin images
2024-05-29 10:57:47 +02:00
Mark Dumay
93885492d7 Merge branch 'main' into develop 2024-05-29 10:50:19 +02:00
Mark Dumay
ed5daa780d Enable rewrite of CDN origin images 2024-05-29 10:49:40 +02:00
Mark Dumay
00501edadd Merge pull request #963 from gethinode/develop
Suppress additional image warning
2024-05-29 10:48:20 +02:00
Mark Dumay
fdb1472f9e Merge branch 'main' into develop 2024-05-29 10:41:52 +02:00
Mark Dumay
b176fbd365 Suppress additional image warning 2024-05-29 10:41:19 +02:00
github-actions[bot]
f2b0e49aa9 Merge pull request #962 from gethinode/dependabot/npm_and_yarn/stylelint-16.6.1
Bump stylelint from 16.6.0 to 16.6.1
2024-05-28 13:54:51 +00:00
dependabot[bot]
5b8df68db5 Bump stylelint from 16.6.0 to 16.6.1
Bumps [stylelint](https://github.com/stylelint/stylelint) from 16.6.0 to 16.6.1.
- [Release notes](https://github.com/stylelint/stylelint/releases)
- [Changelog](https://github.com/stylelint/stylelint/blob/main/CHANGELOG.md)
- [Commits](https://github.com/stylelint/stylelint/compare/16.6.0...16.6.1)

---
updated-dependencies:
- dependency-name: stylelint
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-05-28 13:48:47 +00:00
Mark Dumay
fce4b7dde9 Merge pull request #961 from gethinode/develop
Prevent processing of plain images
2024-05-28 15:48:03 +02:00
Mark Dumay
ba43672bf6 Merge branch 'main' into develop 2024-05-28 15:41:06 +02:00
Mark Dumay
1b93485064 Prevent processing of plain images 2024-05-28 15:40:38 +02:00
Mark Dumay
8d9f12d676 Merge pull request #960 from gethinode/develop
Use latest resource handling
2024-05-28 12:42:32 +02:00
Mark Dumay
1a89aa39c2 Merge branch 'main' into develop 2024-05-28 11:59:14 +02:00
Mark Dumay
6b60188702 Use latest resource handling 2024-05-28 11:58:42 +02:00
Mark Dumay
5e410040cc Merge pull request #959 from gethinode/develop
Support plain images
2024-05-28 11:50:07 +02:00
Mark Dumay
b00f39f850 Merge branch 'main' into develop 2024-05-28 11:41:16 +02:00
Mark Dumay
7e396c5a4d Support plain images 2024-05-28 11:40:38 +02:00
github-actions[bot]
4d43f0bb9b Merge pull request #958 from gethinode/dependabot/npm_and_yarn/eslint-plugin-promise-6.2.0
Bump eslint-plugin-promise from 6.1.1 to 6.2.0
2024-05-27 13:20:07 +00:00
dependabot[bot]
3512bb9dfe Bump eslint-plugin-promise from 6.1.1 to 6.2.0
Bumps [eslint-plugin-promise](https://github.com/eslint-community/eslint-plugin-promise) from 6.1.1 to 6.2.0.
- [Release notes](https://github.com/eslint-community/eslint-plugin-promise/releases)
- [Changelog](https://github.com/eslint-community/eslint-plugin-promise/blob/main/CHANGELOG.md)
- [Commits](https://github.com/eslint-community/eslint-plugin-promise/compare/v6.1.1...v6.2.0)

---
updated-dependencies:
- dependency-name: eslint-plugin-promise
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-05-27 13:15:06 +00:00
Mark Dumay
7dde897e41 Merge pull request #957 from gethinode/develop
Improve image handling
2024-05-27 11:01:32 +02:00
Mark Dumay
f2cad0fe88 Merge branch 'main' into develop 2024-05-27 10:55:17 +02:00
Mark Dumay
eed2d8f68d Merge pull request #956 from gethinode/hugo-mod-dependencies
Update Hugo module dependencies
2024-05-27 10:54:48 +02:00
Mark Dumay
d1aebe2fbe Bump package release 2024-05-27 10:48:23 +02:00
markdumay
013614b149 fix: update Hugo module dependencies 2024-05-27 08:48:19 +00:00
Mark Dumay
d55446d5cc Improve image handling 2024-05-27 10:35:06 +02:00
Mark Dumay
80a225e814 Merge pull request #955 from gethinode/develop
Fix image color mode
2024-05-26 19:29:27 +02:00
Mark Dumay
c7e63308c5 Bump package release 2024-05-26 19:22:10 +02:00
Mark Dumay
7bc712b5f3 Merge branch 'main' into develop 2024-05-26 19:15:44 +02:00
Mark Dumay
cf95a84f2a Fix image color mode 2024-05-26 19:14:59 +02:00
35 changed files with 599 additions and 575 deletions

View File

@@ -9,44 +9,49 @@
(() => { (() => {
'use strict' 'use strict'
const supportedThemes = ['auto', 'dark', 'light'];
// retrieves the currently stored theme from local storage (cookie)
const storedTheme = localStorage.getItem('theme') const storedTheme = localStorage.getItem('theme')
const getPreferredTheme = () => { // retrieves the theme preferred by the client, defaults to light
if (storedTheme) { function getPreferredTheme() {
return storedTheme
}
return window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light' return window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light'
} }
const setTheme = function (theme) { // retrieves the current theme, either from local storage or client's preferences
if (theme === 'auto') { function getTheme() {
document.documentElement.setAttribute('data-bs-theme', (window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light')) if (storedTheme) {
return storedTheme
} else { } else {
document.documentElement.setAttribute('data-bs-theme', theme) const preference = getPreferredTheme()
localStorage.setItem('theme', preference)
return preference
} }
} }
setTheme(getPreferredTheme()) // applies and stores requested theme
function setTheme(theme) {
const showActiveTheme = theme => { if (!supportedThemes.includes(theme)) {
const activeSelectors = document.querySelectorAll('.theme-icon-active') theme = 'auto'
const activeButtons = document.querySelectorAll(`[data-bs-theme-value="${theme}"]`)
if (activeButtons.length > 0) {
const activeIcon = activeButtons[0].querySelector('span')
document.querySelectorAll('[data-bs-theme-value]').forEach(element => {
element.classList.remove('active')
})
for (let i = 0; i < activeSelectors.length; ++i) {
activeSelectors[i].innerHTML = activeIcon.innerHTML
}
for (let i = 0; i < activeButtons.length; ++i) {
activeButtons[i].classList.add('active')
}
} }
localStorage.setItem('theme', theme)
if (theme === 'auto') {
document.documentElement.setAttribute('data-bs-theme', (getPreferredTheme()))
} else {
document.documentElement.setAttribute('data-bs-theme', theme)
}
document.querySelectorAll('.navbar-mode-selector').forEach(chk => {
chk.checked = (document.documentElement.getAttribute('data-bs-theme') === 'light')
})
}
// alternates the currently active theme
function toggleTheme() {
const target = document.documentElement.getAttribute('data-bs-theme') === 'dark' ? 'light' : 'dark'
setTheme(target)
} }
window.matchMedia('(prefers-color-scheme: dark)').addEventListener('change', () => { window.matchMedia('(prefers-color-scheme: dark)').addEventListener('change', () => {
@@ -56,18 +61,32 @@
}) })
window.addEventListener('DOMContentLoaded', () => { window.addEventListener('DOMContentLoaded', () => {
showActiveTheme(getPreferredTheme()) setTheme(getTheme())
const light = (document.documentElement.getAttribute('data-bs-theme') === 'light')
document.querySelectorAll('[data-bs-theme-value]') document.querySelectorAll('.ball').forEach(ball => {
.forEach(toggle => { ball.classList.add('notransition');
toggle.addEventListener('click', () => { })
const theme = toggle.getAttribute('data-bs-theme-value')
localStorage.setItem('theme', theme) document.querySelectorAll('.navbar-mode-selector').forEach(chk => {
setTheme(theme) chk.checked = light
showActiveTheme(theme) chk.addEventListener('change', function () {
}) toggleTheme()
}) })
})
document.querySelectorAll('.ball').forEach(ball => {
ball.offsetHeight; // flush css changes
ball.classList.remove('notransition');
})
}) })
window.addEventListener('load', () => {
const light = (document.documentElement.getAttribute('data-bs-theme') === 'light')
document.querySelectorAll('.navbar-mode-selector').forEach(chk => {
chk.checked = light
})
});
})() })()
{{- end -}} {{- end -}}

View File

@@ -1,25 +1,25 @@
// scss-docs-start icons // scss-docs-start icons
$form-check-input-checked-bg-image: url("/icons/form-check-input-checked-bg-image.svg") !default; $form-check-input-checked-bg-image: url("#{$base-url}icons/form-check-input-checked-bg-image.svg") !default;
$form-check-radio-checked-bg-image: url("/icons/form-check-radio-checked-bg-image.svg") !default; $form-check-radio-checked-bg-image: url("#{$base-url}icons/form-check-radio-checked-bg-image.svg") !default;
$form-check-input-indeterminate-bg-image: url("/icons/form-check-input-indeterminate-bg-image.svg") !default; $form-check-input-indeterminate-bg-image: url("#{$base-url}icons/form-check-input-indeterminate-bg-image.svg") !default;
$form-switch-bg-image: url("/icons/form-switch-bg-image.svg") !default; $form-switch-bg-image: url("#{$base-url}icons/form-switch-bg-image.svg") !default;
$form-switch-bg-image-dark: url("/icons/form-switch-bg-image-dark.svg") !default; $form-switch-bg-image-dark: url("#{$base-url}icons/form-switch-bg-image-dark.svg") !default;
$form-switch-focus-bg-image: url("/icons/form-switch-focus-bg-image.svg") !default; $form-switch-focus-bg-image: url("#{$base-url}icons/form-switch-focus-bg-image.svg") !default;
$form-switch-checked-bg-image: url("/icons/form-switch-checked-bg-image.svg") !default; $form-switch-checked-bg-image: url("#{$base-url}icons/form-switch-checked-bg-image.svg") !default;
$form-select-indicator: url("/icons/form-select-indicator.svg") !default; $form-select-indicator: url("#{$base-url}icons/form-select-indicator.svg") !default;
$form-select-indicator-dark: url("/icons/form-select-indicator-dark.svg") !default; $form-select-indicator-dark: url("#{$base-url}icons/form-select-indicator-dark.svg") !default;
$form-feedback-icon-valid: url("/icons/form-feedback-icon-valid.svg") !default; $form-feedback-icon-valid: url("#{$base-url}icons/form-feedback-icon-valid.svg") !default;
$form-feedback-icon-invalid: url("/icons/form-feedback-icon-invalid.svg") !default; $form-feedback-icon-invalid: url("#{$base-url}icons/form-feedback-icon-invalid.svg") !default;
$navbar-light-toggler-icon-bg: url("/icons/navbar-light-toggler-icon-bg.svg") !default; $navbar-light-toggler-icon-bg: url("#{$base-url}icons/navbar-light-toggler-icon-bg.svg") !default;
$navbar-dark-toggler-icon-bg: url("/icons/navbar-dark-toggler-icon-bg.svg") !default; $navbar-dark-toggler-icon-bg: url("#{$base-url}icons/navbar-dark-toggler-icon-bg.svg") !default;
$accordion-button-icon: url("/icons/accordion-button-icon.svg") !default; $accordion-button-icon: url("#{$base-url}icons/accordion-button-icon.svg") !default;
$accordion-button-icon-dark: url("/icons/accordion-button-icon-dark.svg") !default; $accordion-button-icon-dark: url("#{$base-url}icons/accordion-button-icon-dark.svg") !default;
$accordion-button-active-icon: url("/icons/accordion-button-active-icon.svg") !default; $accordion-button-active-icon: url("#{$base-url}icons/accordion-button-active-icon.svg") !default;
$accordion-button-active-icon-dark: url("/icons/accordion-button-active-icon-dark.svg") !default; $accordion-button-active-icon-dark: url("#{$base-url}icons/accordion-button-active-icon-dark.svg") !default;
$carousel-control-prev-icon-bg: url("/icons/carousel-control-prev-icon-bg.svg") !default; $carousel-control-prev-icon-bg: url("#{$base-url}icons/carousel-control-prev-icon-bg.svg") !default;
$carousel-control-next-icon-bg: url("/icons/carousel-control-next-icon-bg.svg") !default; $carousel-control-next-icon-bg: url("#{$base-url}icons/carousel-control-next-icon-bg.svg") !default;
$btn-close-bg: url("/icons/btn-close-bg.svg") !default; $btn-close-bg: url("#{$base-url}icons/btn-close-bg.svg") !default;
$btn-toggle: url("/icons/btn-toggle.svg") !default; $btn-toggle: url("#{$base-url}icons/btn-toggle.svg") !default;
$btn-toggle-dark: url("/icons/btn-toggle-dark.svg") !default; $btn-toggle-dark: url("#{$base-url}icons/btn-toggle-dark.svg") !default;
// scss-docs-end icons // scss-docs-end icons

View File

@@ -1,3 +1,9 @@
@if $enable-dark-mode {
body {
transition: background-color 0.5s, color 0.5s;
}
}
// //
// Remove underline from all links // Remove underline from all links
// //

View File

@@ -5,6 +5,8 @@ $enable-important-utilities: true !default;
// Remove the border from the focused navigation toggler // Remove the border from the focused navigation toggler
$navbar-toggler-focus-width: 0 !default; $navbar-toggler-focus-width: 0 !default;
$base-url: h.$base-url;
$font-family-sans-serif: h.$theme-font, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji" !default; $font-family-sans-serif: h.$theme-font, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji" !default;
$font-size-base: h.$font-size-base !default; $font-size-base: h.$font-size-base !default;
$headings-font-weight: 600 !default; $headings-font-weight: 600 !default;

View File

@@ -5,6 +5,8 @@ $enable-important-utilities: true !default;
// Remove the border from the focused navigation toggler // Remove the border from the focused navigation toggler
$navbar-toggler-focus-width: 0 !default; $navbar-toggler-focus-width: 0 !default;
$base-url: $base-url;
// scss-docs-start font // scss-docs-start font
$font-family-sans-serif: $theme-font, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji" !default; $font-family-sans-serif: $theme-font, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji" !default;
$font-size-base: $font-size-base !default;; $font-size-base: $font-size-base !default;;

View File

@@ -1,8 +1,6 @@
// stylelint-disable annotation-no-unknown // stylelint-disable annotation-no-unknown
// Source: https://jsfiddle.net/njhgr40m/ // Source: https://jsfiddle.net/njhgr40m/
.navbar { .navbar {
--bs-navbar-expanded-color: var(--bs-body-bg); --bs-navbar-expanded-color: var(--bs-body-bg);
--bs-navbar-toggler-color: var(--bs-navbar-hover-color); --bs-navbar-toggler-color: var(--bs-navbar-hover-color);
@@ -236,3 +234,61 @@
} }
} }
} }
// adapted from https://www.codeply.com/p/UsTEwDkzNp#
.checkbox {
opacity: 0;
position: absolute;
}
.mode-switch {
--#{$prefix}mode-switch-width: 50px;
}
.mode-switch .label {
border-color: var(--#{$prefix}border-color);
border-style: solid;
border-width: 1px;
border-radius: var(--#{$prefix}mode-switch-width);
cursor: pointer;
display: flex;
align-items: center;
justify-content: space-between;
padding: 5px;
position: relative;
height: calc(1px + var(--#{$prefix}mode-switch-width) / 2);
width: var(--#{$prefix}mode-switch-width);
transform: scale(0.9);
}
.notransition {
-webkit-transition: none !important;
-moz-transition: none !important;
-o-transition: none !important;
transition: none !important;
}
.mode-switch .label .ball {
background-color: var(--#{$prefix}secondary-bg);
border-radius: 50%;
position: absolute;
top: 2px;
left: 2px;
height: calc((var(--#{$prefix}mode-switch-width) / 2) - 5px);
width: calc((var(--#{$prefix}mode-switch-width) / 2) - 5px);
transition: transform 0.2s linear;
}
.mode-switch .checkbox:checked + .label .ball {
transform: translateX(calc((var(--#{$prefix}mode-switch-width) / 2) - 1px));
}
.mode-switch .fa-moon {
color: $yellow;
transform: scale(0.8);
}
.mode-switch .fa-sun {
color: var(--#{$prefix}bs-body-color);
transform: scale(0.8);
}

View File

@@ -0,0 +1,29 @@
comment: >-
Rewrites an origin URL to a target URL as supported by a CDN image adapter.
arguments:
account:
type: string
optional: true
comment: Account name of the origin server.
container:
type: string
optional: true
comment: Container name of the origin server.
host:
type: string
optional: true
comment: >-
Host of an URL. For example, the host of the URL
'https://example.com/first/second/third.webp' equals 'example.com'.
dir:
type: string
optional: true
comment: >-
All but the last element of an URL extension. For example, the dir of the
URL 'https://example.com/first/second/third.webp' equals '/first/second/'.
file:
type: string
optional: false
comment: >-
The last element of an URL extension. For example, the file of the
URL 'https://example.com/first/second/third.webp' equals 'third.webp'.

View File

@@ -19,7 +19,9 @@ comment: >-
reference. reference.
arguments: arguments:
url: url:
type: string type:
- string
- template.URL
optional: true optional: true
comment: >- comment: >-
Path or url of the image, e.g. `img/example.jpg`. Images with multiple Path or url of the image, e.g. `img/example.jpg`. Images with multiple
@@ -128,3 +130,11 @@ arguments:
optional: true optional: true
comment: Class attribute of the figure caption, e.g. `px-4`. comment: Class attribute of the figure caption, e.g. `px-4`.
release: v0.23.0 release: v0.23.0
plain:
type: bool
default: false
optional: true
comment:
Flag to indicate if the image should render a plain image instead of an
image set. When set, no transformations are applied to the image.
release: v0.24.0

View File

@@ -15,7 +15,7 @@ As an example, the following shortcode displays an image with rounded corners an
<!-- markdownlint-disable MD037 --> <!-- markdownlint-disable MD037 -->
{{< example lang="hugo" >}} {{< example lang="hugo" >}}
{{</* image src="https://res.cloudinary.com/demo/image/upload/dog.webp" {{</* image src="https://res.cloudinary.com/demo/image/upload/dog.webp"
ratio="21x9" caption="Cloudinary image" class="rounded" */>}} ratio="21x9" caption="Cloudinary image" class="rounded" plain=true */>}}
{{< /example >}} {{< /example >}}
<!-- markdownlint-enable MD037 --> <!-- markdownlint-enable MD037 -->

View File

@@ -22,6 +22,7 @@
"i", "i",
"img", "img",
"input", "input",
"label",
"li", "li",
"link", "link",
"mark", "mark",
@@ -69,6 +70,7 @@
"align-self-end", "align-self-end",
"anchor", "anchor",
"badge", "badge",
"ball",
"bg-body", "bg-body",
"bg-body-tertiary", "bg-body-tertiary",
"bg-danger", "bg-danger",
@@ -123,6 +125,7 @@
"carousel-indicators", "carousel-indicators",
"carousel-inner", "carousel-inner",
"carousel-item", "carousel-item",
"checkbox",
"chroma", "chroma",
"col", "col",
"col-10", "col-10",
@@ -188,7 +191,6 @@
"fa-arrow-right", "fa-arrow-right",
"fa-bootstrap", "fa-bootstrap",
"fa-circle-check", "fa-circle-check",
"fa-circle-half-stroke",
"fa-code", "fa-code",
"fa-docker", "fa-docker",
"fa-ellipsis", "fa-ellipsis",
@@ -257,6 +259,7 @@
"justify-content-center", "justify-content-center",
"justify-content-end", "justify-content-end",
"justify-content-start", "justify-content-start",
"label",
"lead", "lead",
"leaflet-map", "leaflet-map",
"link-bg-body", "link-bg-body",
@@ -278,6 +281,7 @@
"me-auto", "me-auto",
"middle-bar", "middle-bar",
"min-vh-100", "min-vh-100",
"mode-switch",
"ms-1", "ms-1",
"ms-3", "ms-3",
"ms-auto", "ms-auto",
@@ -309,6 +313,7 @@
"navbar-contrast", "navbar-contrast",
"navbar-expand-md", "navbar-expand-md",
"navbar-fixed-top", "navbar-fixed-top",
"navbar-mode-selector",
"navbar-nav", "navbar-nav",
"navbar-nav-scroll", "navbar-nav-scroll",
"navbar-title", "navbar-title",
@@ -391,7 +396,6 @@
"sticky-top", "sticky-top",
"stretched-link", "stretched-link",
"svg-inline--fa", "svg-inline--fa",
"switch-mode-collapsed",
"syntax-highlight", "syntax-highlight",
"tab-content", "tab-content",
"tab-pane", "tab-pane",
@@ -419,8 +423,6 @@
"text-sm-start", "text-sm-start",
"text-start", "text-start",
"text-uppercase", "text-uppercase",
"theme-icon",
"theme-icon-active",
"tickmark", "tickmark",
"timeline", "timeline",
"timeline-bg-dark", "timeline-bg-dark",
@@ -459,8 +461,6 @@
"w-50" "w-50"
], ],
"ids": [ "ids": [
"-theme",
"-theme-collapsed",
"TableOfContents", "TableOfContents",
"abbr", "abbr",
"accordion", "accordion",
@@ -532,6 +532,8 @@
"nav-0-btn-2", "nav-0-btn-2",
"navbar", "navbar",
"navbar-0-collapse", "navbar-0-collapse",
"navbar-mode",
"navbar-mode-checkbox",
"navbar-sample-collapse", "navbar-sample-collapse",
"navigation", "navigation",
"notification", "notification",

4
go.mod
View File

@@ -9,8 +9,8 @@ require (
github.com/gethinode/mod-fontawesome v1.9.0 // indirect github.com/gethinode/mod-fontawesome v1.9.0 // indirect
github.com/gethinode/mod-katex v1.1.0 // indirect github.com/gethinode/mod-katex v1.1.0 // indirect
github.com/gethinode/mod-leaflet v1.1.0 // indirect github.com/gethinode/mod-leaflet v1.1.0 // indirect
github.com/gethinode/mod-lottie v1.5.0 // indirect github.com/gethinode/mod-lottie v1.5.4 // indirect
github.com/gethinode/mod-utils/v2 v2.3.1 // indirect github.com/gethinode/mod-utils/v2 v2.3.7 // indirect
github.com/nextapps-de/flexsearch v0.0.0-20240110101704-4c3966709f85 // indirect github.com/nextapps-de/flexsearch v0.0.0-20240110101704-4c3966709f85 // indirect
github.com/twbs/bootstrap v5.3.3+incompatible // indirect github.com/twbs/bootstrap v5.3.3+incompatible // indirect
) )

20
go.sum
View File

@@ -174,6 +174,14 @@ github.com/gethinode/mod-lottie v1.4.7 h1:5Hes0xY/l8ygzJ8YQIzdqCmvGrDQs8D8qZ/vR1
github.com/gethinode/mod-lottie v1.4.7/go.mod h1:FvcG3NjXOBOnwou0QvXYNPHpybxwT6yxmSh4N+nBD9s= github.com/gethinode/mod-lottie v1.4.7/go.mod h1:FvcG3NjXOBOnwou0QvXYNPHpybxwT6yxmSh4N+nBD9s=
github.com/gethinode/mod-lottie v1.5.0 h1:LwEEY+p+sPrN01yz7GyVOsF5lZ4qMln69+gAxJs1DDA= github.com/gethinode/mod-lottie v1.5.0 h1:LwEEY+p+sPrN01yz7GyVOsF5lZ4qMln69+gAxJs1DDA=
github.com/gethinode/mod-lottie v1.5.0/go.mod h1:FvcG3NjXOBOnwou0QvXYNPHpybxwT6yxmSh4N+nBD9s= github.com/gethinode/mod-lottie v1.5.0/go.mod h1:FvcG3NjXOBOnwou0QvXYNPHpybxwT6yxmSh4N+nBD9s=
github.com/gethinode/mod-lottie v1.5.1 h1:84ZmOTKJH75wsd/YjPaaBRkTeLnmRROv9iFlQVMC+jA=
github.com/gethinode/mod-lottie v1.5.1/go.mod h1:z0Q6EADM7pN7gmhCzDx2VR4uG5mxn9qbsphtxjIkssY=
github.com/gethinode/mod-lottie v1.5.2 h1:UvrNAQeD/97Q5fbv3uKIY48fY3IWJeLy/v206Gb0F6Y=
github.com/gethinode/mod-lottie v1.5.2/go.mod h1:HM1pA85EiPO7RtNysw/a2ZzRqktO2WvB/KyWLOuynzg=
github.com/gethinode/mod-lottie v1.5.3 h1:fvCjCoZoCEhY2aou30oEsEo6N4tVSI0ijFyXS3wNib0=
github.com/gethinode/mod-lottie v1.5.3/go.mod h1:XHVMuPsuJIm9/Eb2ql4jsT49/BQqMlBiirQoty4uHAo=
github.com/gethinode/mod-lottie v1.5.4 h1:+xbamSsjcnP2tyzGl0CA1enma7gkAp67wenmuP0XELY=
github.com/gethinode/mod-lottie v1.5.4/go.mod h1:gALqz48aYpoDLxJOI3LzIpdy0Eq/lOBNtlcOxABa9tg=
github.com/gethinode/mod-utils v1.0.0 h1:cqHm2xS5uDiJzRm1KfHaNbq6uMVDKLhQa8/BuTZ1nhY= github.com/gethinode/mod-utils v1.0.0 h1:cqHm2xS5uDiJzRm1KfHaNbq6uMVDKLhQa8/BuTZ1nhY=
github.com/gethinode/mod-utils v1.0.0/go.mod h1:ONJm3pHCq7nvaPNjusLZNCeCbhOhSBH4HVKHwK1FdYE= github.com/gethinode/mod-utils v1.0.0/go.mod h1:ONJm3pHCq7nvaPNjusLZNCeCbhOhSBH4HVKHwK1FdYE=
github.com/gethinode/mod-utils v1.0.1 h1:jhZGlGFHHL1f5HXbBMXfiZ2gCz4TVafAzjnRPTIBSEE= github.com/gethinode/mod-utils v1.0.1 h1:jhZGlGFHHL1f5HXbBMXfiZ2gCz4TVafAzjnRPTIBSEE=
@@ -202,6 +210,18 @@ github.com/gethinode/mod-utils/v2 v2.3.0 h1:e3uhlAGasvXe+cgvcmzRe05Zo4UEx86uk0Tb
github.com/gethinode/mod-utils/v2 v2.3.0/go.mod h1:GTYeknoLujNjfDxI+V9Dcug26CYJSTJ0B/U2dagw9oY= github.com/gethinode/mod-utils/v2 v2.3.0/go.mod h1:GTYeknoLujNjfDxI+V9Dcug26CYJSTJ0B/U2dagw9oY=
github.com/gethinode/mod-utils/v2 v2.3.1 h1:blqynoRJ+H2SPfSU28iYheYWPH39MKNtK5HKJPghL3M= github.com/gethinode/mod-utils/v2 v2.3.1 h1:blqynoRJ+H2SPfSU28iYheYWPH39MKNtK5HKJPghL3M=
github.com/gethinode/mod-utils/v2 v2.3.1/go.mod h1:GTYeknoLujNjfDxI+V9Dcug26CYJSTJ0B/U2dagw9oY= github.com/gethinode/mod-utils/v2 v2.3.1/go.mod h1:GTYeknoLujNjfDxI+V9Dcug26CYJSTJ0B/U2dagw9oY=
github.com/gethinode/mod-utils/v2 v2.3.2 h1:QxYtHqeiLfAg+38ULFr3qYwNuypcnV1KzsmmNUjbX+U=
github.com/gethinode/mod-utils/v2 v2.3.2/go.mod h1:GTYeknoLujNjfDxI+V9Dcug26CYJSTJ0B/U2dagw9oY=
github.com/gethinode/mod-utils/v2 v2.3.3 h1:dewgQgAyPJJ1lA2WhowHaFqVaeLjUNYgxDO4mE3v0F0=
github.com/gethinode/mod-utils/v2 v2.3.3/go.mod h1:GTYeknoLujNjfDxI+V9Dcug26CYJSTJ0B/U2dagw9oY=
github.com/gethinode/mod-utils/v2 v2.3.4 h1:4OmUsLW7FyQL7vJhg/Iy9E7nFXWL955qCtsj6yWU51M=
github.com/gethinode/mod-utils/v2 v2.3.4/go.mod h1:GTYeknoLujNjfDxI+V9Dcug26CYJSTJ0B/U2dagw9oY=
github.com/gethinode/mod-utils/v2 v2.3.5 h1:r8V330xQkHTjzAFNCde1Kpz6fgidzmMRW82eIonUnOo=
github.com/gethinode/mod-utils/v2 v2.3.5/go.mod h1:GTYeknoLujNjfDxI+V9Dcug26CYJSTJ0B/U2dagw9oY=
github.com/gethinode/mod-utils/v2 v2.3.6 h1:Ta+WKc83sK9ZROKmUwS4pA32Qm0bQqoMmWHEOzDvZ5Y=
github.com/gethinode/mod-utils/v2 v2.3.6/go.mod h1:GTYeknoLujNjfDxI+V9Dcug26CYJSTJ0B/U2dagw9oY=
github.com/gethinode/mod-utils/v2 v2.3.7 h1:FFsUPO7NBp9Bhjovf0Ki5hnDGfeMKV/3RNz1Qpv7+oQ=
github.com/gethinode/mod-utils/v2 v2.3.7/go.mod h1:GTYeknoLujNjfDxI+V9Dcug26CYJSTJ0B/U2dagw9oY=
github.com/nextapps-de/flexsearch v0.0.0-20230711092928-1243fd883ec3 h1:H/qVR5O4BXjRjD+5PZB+r4ug2BSJ2Of4RtwOntd+OKo= github.com/nextapps-de/flexsearch v0.0.0-20230711092928-1243fd883ec3 h1:H/qVR5O4BXjRjD+5PZB+r4ug2BSJ2Of4RtwOntd+OKo=
github.com/nextapps-de/flexsearch v0.0.0-20230711092928-1243fd883ec3/go.mod h1:5GdMfPAXzbA2gXBqTjC6l27kioSYzHlqDMh0+wyx7sU= github.com/nextapps-de/flexsearch v0.0.0-20230711092928-1243fd883ec3/go.mod h1:5GdMfPAXzbA2gXBqTjC6l27kioSYzHlqDMh0+wyx7sU=
github.com/nextapps-de/flexsearch v0.0.0-20240108021025-afd75f742f22 h1:re7L8FxbXQpnX8BgzkdUnDpsUmloGNyLmiy2ZCln8pg= github.com/nextapps-de/flexsearch v0.0.0-20240108021025-afd75f742f22 h1:re7L8FxbXQpnX8BgzkdUnDpsUmloGNyLmiy2ZCln8pg=

View File

@@ -11,6 +11,7 @@
"html", "html",
"img", "img",
"input", "input",
"label",
"li", "li",
"link", "link",
"meta", "meta",
@@ -31,6 +32,7 @@
"align-items-center", "align-items-center",
"align-self-center", "align-self-center",
"align-self-end", "align-self-end",
"ball",
"bg-body", "bg-body",
"bg-opacity-10", "bg-opacity-10",
"bg-primary", "bg-primary",
@@ -41,6 +43,7 @@
"btn", "btn",
"btn-close", "btn-close",
"btn-primary", "btn-primary",
"checkbox",
"col", "col",
"col-12", "col-12",
"col-6", "col-6",
@@ -57,22 +60,15 @@
"d-flex", "d-flex",
"d-inline", "d-inline",
"d-md-block", "d-md-block",
"d-md-none",
"d-none", "d-none",
"display-1", "display-1",
"display-4", "display-4",
"dropdown",
"dropdown-item",
"dropdown-menu",
"dropdown-menu-end",
"dropdown-toggle",
"emphasis", "emphasis",
"end-0", "end-0",
"fa", "fa",
"fa-10x", "fa-10x",
"fa-2x", "fa-2x",
"fa-book-open", "fa-book-open",
"fa-circle-half-stroke",
"fa-ellipsis", "fa-ellipsis",
"fa-face-frown", "fa-face-frown",
"fa-fw", "fa-fw",
@@ -100,6 +96,7 @@
"justify-content-center", "justify-content-center",
"justify-content-end", "justify-content-end",
"justify-content-start", "justify-content-start",
"label",
"link-bg-footer", "link-bg-footer",
"link-secondary", "link-secondary",
"main-content", "main-content",
@@ -107,6 +104,7 @@
"me-auto", "me-auto",
"middle-bar", "middle-bar",
"min-vh-100", "min-vh-100",
"mode-switch",
"ms-auto", "ms-auto",
"ms-md-3", "ms-md-3",
"mt-3", "mt-3",
@@ -123,6 +121,7 @@
"navbar-container", "navbar-container",
"navbar-expand-md", "navbar-expand-md",
"navbar-fixed-top", "navbar-fixed-top",
"navbar-mode-selector",
"navbar-nav", "navbar-nav",
"navbar-toggler", "navbar-toggler",
"no-js", "no-js",
@@ -156,15 +155,12 @@
"search-suggestions", "search-suggestions",
"shadow", "shadow",
"svg-inline--fa", "svg-inline--fa",
"switch-mode-collapsed",
"text-center", "text-center",
"text-decoration-none", "text-decoration-none",
"text-muted", "text-muted",
"text-secondary", "text-secondary",
"text-sm-start", "text-sm-start",
"text-start", "text-start",
"theme-icon",
"theme-icon-active",
"toast", "toast",
"toast-body", "toast-body",
"toast-container", "toast-container",
@@ -173,9 +169,9 @@
"top-bar" "top-bar"
], ],
"ids": [ "ids": [
"-theme",
"-theme-collapsed",
"navbar-0-collapse", "navbar-0-collapse",
"navbar-mode",
"navbar-mode-checkbox",
"toast-container", "toast-container",
"toast-copied-code-message" "toast-copied-code-message"
] ]

View File

@@ -1,4 +1,5 @@
{{ define "main" }} {{ define "main" }}
{{ $base := partial "utilities/GetStaticURL" (dict "url" "/") }}
<div class="d-flex flex-fill"> <div class="d-flex flex-fill">
<div class="container-xxl my-auto"> <div class="container-xxl my-auto">
<div class="text-center"> <div class="text-center">
@@ -7,7 +8,7 @@
<p class="display-1 mt-3 fw-bold">404</p> <p class="display-1 mt-3 fw-bold">404</p>
<p class="fs-3">{{ T "pageNotFoundTitle" }}</p> <p class="fs-3">{{ T "pageNotFoundTitle" }}</p>
</span> </span>
{{- $home := printf "<a href=\"%s\">%s</a>" ("/" | relLangURL) (T "pageNotFoundHome") -}} {{- $home := printf "<a href=\"%s\">%s</a>" $base (T "pageNotFoundHome") -}}
<p>{{ T "pageNotFound" $home | safeHTML }}</p> <p>{{ T "pageNotFound" $home | safeHTML }}</p>
</div> </div>
</div> </div>

View File

@@ -29,6 +29,10 @@
{{- /* Define main breakpoint */ -}} {{- /* Define main breakpoint */ -}}
{{- $.Scratch.Set "breakpoint" (partial "utilities/GetBreakpoint.html") }} {{- $.Scratch.Set "breakpoint" (partial "utilities/GetBreakpoint.html") }}
{{- /* Define base URL */ -}}
{{ $lang := site.LanguageCode | default site.Language.Lang }}
{{ $.Scratch.Set "baseURL" (strings.TrimSuffix (printf "%s/" $lang) site.Home.RelPermalink) }}
<!doctype html> <!doctype html>
<html lang="{{ .Site.Language.Lang }}" class="no-js"> <html lang="{{ .Site.Language.Lang }}" class="no-js">
<head> <head>

View File

@@ -32,7 +32,7 @@
<div class="d-none-dark"> <div class="d-none-dark">
<div class="hstack gap-1"> <div class="hstack gap-1">
{{ range (.GetTerms "tags") -}} {{ range (.GetTerms "tags") -}}
{{- $url := (path.Join .Page.RelPermalink) | relLangURL -}} {{- $url := .Page.RelPermalink -}}
{{ partial "assets/button.html" (dict "href" $url "title" .LinkTitle "color" "light" "size" "sm") }} {{ partial "assets/button.html" (dict "href" $url "title" .LinkTitle "color" "light" "size" "sm") }}
{{ end -}} {{ end -}}
</div> </div>
@@ -41,7 +41,7 @@
<div class="d-none-light"> <div class="d-none-light">
<div class="hstack gap-1"> <div class="hstack gap-1">
{{ range (.GetTerms "tags") -}} {{ range (.GetTerms "tags") -}}
{{- $url := (path.Join .Page.RelPermalink) | relLangURL -}} {{- $url := .Page.RelPermalink -}}
{{ partial "assets/button.html" (dict "href" $url "title" .LinkTitle "color" "primary" "size" "sm" "outline" "true") }} {{ partial "assets/button.html" (dict "href" $url "title" .LinkTitle "color" "primary" "size" "sm" "outline" "true") }}
{{ end -}} {{ end -}}
</div> </div>

View File

@@ -1,11 +1,12 @@
{{ $lang := site.LanguageCode | default site.Language.Lang }}
<!DOCTYPE html> <!DOCTYPE html>
<html{{ with site.LanguageCode | default site.Language.Lang }} lang="{{ . }}"{{ end }}> <html {{ with $lang }}lang="{{ . }}"{{ end }}>
<head> <head>
<title>{{ .Permalink }}</title> <title>{{ .Permalink }}</title>
<link rel="canonical" href="{{ .Permalink }}"> <link rel="canonical" href="{{ .Permalink }}">
<meta name="robots" content="noindex"> <meta name="robots" content="noindex">
<meta charset="utf-8"> <meta charset="utf-8">
<noscript><meta http-equiv="refresh" content="0; url={{ .Permalink }}"></noscript> <noscript><meta http-equiv="refresh" content="0; url={{ .Permalink }}"></noscript>
<script src="/js/alias.js"></script> <script src='{{ partial "utilities/GetStaticURL" (dict "url" "js/alias.js") }}'></script>
</head> </head>
</html> </html>

View File

@@ -27,7 +27,7 @@
{{ $url = urls.JoinPath "https://" $host $url }} {{ $url = urls.JoinPath "https://" $host $url }}
{{ end }} {{ end }}
<!-- Initialize image if needed --> <!-- Initialize image if needed, do not raise additional warnings -->
{{ $format := .format | default "webp" }} {{ $format := .format | default "webp" }}
{{ if and (not $img) (ne $format "svg") }} {{ if and (not $img) (ne $format "svg") }}
{{- $res := partial "utilities/GetImage.html" (dict "url" $url "page" page) -}} {{- $res := partial "utilities/GetImage.html" (dict "url" $url "page" page) -}}
@@ -37,7 +37,6 @@
{{ end }} {{ end }}
{{ if not $img }} {{ if not $img }}
{{ errorf "partial [assets/adapter/hugo.html] - Expected 'img' argument" -}}
{{ $error = true }} {{ $error = true }}
{{ end }} {{ end }}
{{ end }} {{ end }}

View File

@@ -0,0 +1,30 @@
<!--
Copyright © 2024 The Hinode Team / Mark Dumay. All rights reserved.
Use of this source code is governed by The MIT License (MIT) that can be found in the LICENSE file.
Visit gethinode.com/license for more details.
-->
{{ $error := false }}
<!-- Validate arguments -->
{{ if partial "utilities/IsInvalidArgs.html" (dict "structure" "image-adapter-rewrite" "args" . "group" "partial") }}
{{ errorf "partial [assets/adapter/imagekit-rewrite.html] - Invalid arguments" -}}
{{ $error = true }}
{{ end }}
<!-- Initialize arguments -->
{{ $account := .account }}
{{ $container := trim .container "/" }}
{{ $host := .host }}
{{ $dir := .dir }}
{{ $file := .file }}
{{ $element := "" }}
{{ with $container }}{{ $dir = strings.TrimPrefix (printf "/%s" .) $dir }}{{ end }}
{{ if ne $host "ik.imagekit.io" }}
{{ $element = urls.JoinPath (slice "https://ik.imagekit.io" $account $dir $file) }}
{{ else }}
{{ $element = urls.JoinPath (slice "https://" $host $dir $file) }}
{{ end }}
{{ return $element }}

View File

@@ -22,7 +22,7 @@
{{- range $index, $item := $page.Ancestors.Reverse -}} {{- range $index, $item := $page.Ancestors.Reverse -}}
{{- $title := .LinkTitle -}} {{- $title := .LinkTitle -}}
{{- if .IsHome }}{{ $title = T "home" }}{{ end -}} {{- if .IsHome }}{{ $title = T "home" }}{{ end -}}
{{- $address := or .RelPermalink (.Params.Redirect | relLangURL) -}} {{- $address := or .RelPermalink .Params.Redirect -}}
{{ if $address }} {{ if $address }}
<li class="breadcrumb-item"><a href="{{ $address }}">{{ $title }}</a></li> <li class="breadcrumb-item"><a href="{{ $address }}">{{ $title }}</a></li>
{{ else }} {{ else }}

View File

@@ -119,7 +119,7 @@
{{- range $index, $tag := first $maxTags ($page.GetTerms "tags") -}} {{- range $index, $tag := first $maxTags ($page.GetTerms "tags") -}}
{{- if gt $index 0 }}&nbsp;&bull;&nbsp;{{ end -}} {{- if gt $index 0 }}&nbsp;&bull;&nbsp;{{ end -}}
<a href="{{ (path.Join $tag.Page.RelPermalink) | relLangURL }}" class="{{ $link }} tag-link" aria-label="tag: {{ $tag.LinkTitle }}">{{ $tag.LinkTitle }}</a> <a href="{{ $tag.Page.RelPermalink }}" class="{{ $link }} tag-link" aria-label="tag: {{ $tag.LinkTitle }}">{{ $tag.LinkTitle }}</a>
{{- end -}} {{- end -}}
</small></p> </small></p>
{{- end -}} {{- end -}}

View File

@@ -14,13 +14,13 @@
{{- $url := .url -}} {{- $url := .url -}}
{{- $mode := .mode -}} {{- $mode := .mode -}}
{{- $modes := .modes -}} {{- $modes := .modes -}}
{{- $plain := .plain | default false }}
{{- $fallbackURL := "" -}} {{- $fallbackURL := "" -}}
{{- $anchor := "" -}} {{- $anchor := "" -}}
{{- $imgset := "" -}} {{- $imgset := "" -}}
{{- $isVector := false -}} {{- $isVector := false -}}
<!-- Split url into base and anchor when applicable (only relevant for vector images) --> <!-- Split url into base and anchor when applicable (only relevant for vector images) -->
{{- $segments := split $url "#" -}} {{- $segments := split $url "#" -}}
{{- if gt (len $segments) 2 -}} {{- if gt (len $segments) 2 -}}
@@ -32,17 +32,28 @@
<!-- Identify image provider --> <!-- Identify image provider -->
{{ $hook := "" }} {{ $hook := "" }}
{{ $account := "" }}
{{ $container := "" }}
{{ $rewrite := false }}
{{ range $provider, $val := site.Params.images }} {{ range $provider, $val := site.Params.images }}
{{ if not $hook }} {{ if not $hook }}
{{ with index $val "host" }} {{ with index $val "host" }}
{{ if (findRE . (urls.Parse $url).Hostname) }} {{ if (findRE . (urls.Parse $url).Hostname) }}
{{ $hook = $provider }} {{ $hook = $provider }}
{{ with index $val "account" }}{{ $account = . }}{{ end }}
{{ with index $val "rewrite" }}{{ $rewrite = . }}{{ end }}
{{ with index $val "container" }}{{ $container = . }}{{ end }}
{{ end }} {{ end }}
{{ end }} {{ end }}
{{ end }} {{ end }}
{{ end }} {{ end }}
{{ if not $hook }}{{ $hook = "hugo" }}{{ end }} {{ if not $hook }}{{ $hook = "hugo" }}{{ end }}
<!-- Rewrite the origin URL if applicable -->
{{ if $rewrite }}
{{ $url = partial "assets/helpers/image-rewrite.html" (dict "url" $url "account" $account "container" $container "hook" $hook) }}
{{ end }}
<!-- Define image dimensions --> <!-- Define image dimensions -->
{{ $dims := slice }} {{ $dims := slice }}
{{- $res := "" -}} {{- $res := "" -}}
@@ -62,33 +73,35 @@
{{ $transform = "fill" }} {{ $transform = "fill" }}
{{ $dims = partial "assets/helpers/GetDimension.html" (dict "ratio" $ratio) }} {{ $dims = partial "assets/helpers/GetDimension.html" (dict "ratio" $ratio) }}
{{ if not $dims }}{{ errorf "partial [assets/image.html] - Cannot find dimension data: %s" $ratio }}{{ end }} {{ if not $dims }}{{ errorf "partial [assets/image.html] - Cannot find dimension data: %s" $ratio }}{{ end }}
{{ else }} {{ else if not $plain }}
{{ $transform = "fit" }} {{ $transform = "fit" }}
{{- $res := partial "utilities/GetImage.html" (dict "url" $url "page" $page) -}} {{- $res := partial "utilities/GetImage.html" (dict "url" $url "page" $page) -}}
{{ with $res }} {{ if and $res $res.resource }}
{{ $img = $res.resource }} {{ $img = $res.resource }}
{{ if $res.mirror }}{{ $class = printf "%s mirrorred" $class }}{{ end }} {{ if $res.mirror }}{{ $class = printf "%s mirrorred" $class }}{{ end }}
{{ end }}
{{ $widths := partial "assets/helpers/GetDimension.html" (dict "ratio" "auto") }} {{ $widths := partial "assets/helpers/GetDimension.html" (dict "ratio" "auto") }}
{{ range $width := $widths -}} {{ range $width := $widths -}}
{{- $dims = $dims | append (printf "%dx%d" (int $width) (int (math.Round (mul (div (float $width) $img.Width) $img.Height)))) -}} {{- $dims = $dims | append (printf "%dx%d" (int $width) (int (math.Round (mul (div (float $width) $img.Width) $img.Height)))) -}}
{{- end -}} {{- end -}}
{{ end }}
{{ end }} {{ end }}
<!-- Derive image width and height --> <!-- Derive image width and height -->
{{ $width := "" }} {{ $width := "" }}
{{ $height := "" }} {{ $height := "" }}
{{ with $dims }} {{ if not $plain }}
{{ range $dim := (. | last 1) }} {{ with $dims }}
{{ $width = (int (index (split $dim "x") 0)) }} {{ range $dim := (. | last 1) }}
{{ $height = (int (index (split $dim "x") 1)) }} {{ $width = (int (index (split $dim "x") 0)) }}
{{ $height = (int (index (split $dim "x") 1)) }}
{{ end }}
{{ end }} {{ end }}
{{ end }} {{ end }}
<!-- Generate image urls --> <!-- Generate image urls -->
{{ if hasSuffix $url "svg" }} {{ if or (hasSuffix $url "svg") $plain }}
{{- $fallbackURL = $url -}} {{- $fallbackURL = partial "utilities/GetStaticURL" (dict "url" $url) -}}
{{ else }} {{ else }}
{{- $fallbackURL = partial "assets/helpers/image-set.html" (dict "url" $url "img" $img "dims" ($dims | last 1) "transform" $transform "hook" $hook "format" "jpg" "includeWidth" false) -}} {{- $fallbackURL = partial "assets/helpers/image-set.html" (dict "url" $url "img" $img "dims" ($dims | last 1) "transform" $transform "hook" $hook "format" "jpg" "includeWidth" false) -}}
{{- $imgset = partial "assets/helpers/image-set.html" (dict "url" $url "img" $img "dims" $dims "transform" $transform "hook" $hook) -}} {{- $imgset = partial "assets/helpers/image-set.html" (dict "url" $url "img" $img "dims" $dims "transform" $transform "hook" $hook) -}}

View File

@@ -0,0 +1,29 @@
{{- $url := .url -}}
{{- $account := .account -}}
{{- $container := .container -}}
{{ $hook := .hook }}
{{ $host := (urls.Parse $url).Hostname }}
{{ $dir := (urls.Parse $url).Path }}
{{ $file := index ((split $dir "/") | collections.Reverse) 0 }}
{{ $dir = strings.TrimSuffix $file $dir }}
{{ $error := false }}
{{ $adapter := (printf "assets/adapters/%s-rewrite.html" $hook) }}
{{ if not (fileExists (path.Join "/layouts/partials" $adapter)) }}
{{ warnf "Cannot find adapter: %s" (path.Join "/layouts/partials" $adapter) }}
{{ $error = true }}
{{ end }}
{{ $result := $url }}
{{ if not $error }}
{{ $result = partial $adapter (dict
"account" $account
"container" $container
"host" $host
"dir" $dir
"file" $file
)}}
{{ end }}
{{ return $result }}

View File

@@ -26,6 +26,7 @@
{{- $priority := .priority -}} {{- $priority := .priority -}}
{{- if eq $priority "auto" }}{{ $priority = "" }}{{ end -}} {{- if eq $priority "auto" }}{{ $priority = "" }}{{ end -}}
{{- $sizes := .sizes | default "100vw" -}} {{- $sizes := .sizes | default "100vw" -}}
{{- $plain := .plain | default false -}}
{{- $absoluteURL := site.Params.main.canonifyAssetsURLs | default false -}} {{- $absoluteURL := site.Params.main.canonifyAssetsURLs | default false -}}
{{- $url := .url -}} {{- $url := .url -}}
@@ -47,28 +48,29 @@
"priority" $priority "priority" $priority
"sizes" $sizes "sizes" $sizes
"absoluteURL" $absoluteURL "absoluteURL" $absoluteURL
"plain" $plain
) )
-}} -}}
{{- if $mode -}}
{{- $ext := path.Ext $url -}}
{{- $base := strings.TrimSuffix $ext $url -}}
{{- range $suffix := $modes -}}
{{- $base = strings.TrimSuffix (printf "-%s" $suffix) $base -}}
{{- end -}}
{{- range $suffix := $modes -}}
{{- $image := printf "%s-%s%s" $base $suffix $ext -}}
{{- $params = merge $params (dict
"url" $image
"mode" $suffix
"modes" $modes)
-}}
{{- end -}}
{{ else }}
{{- $params = merge $params (dict "url" $url) -}}
{{- end -}}
{{ if not $error }} {{ if not $error }}
{{- partial "assets/helpers/image-definition.html" $params -}} {{- if $mode -}}
{{- $ext := path.Ext $url -}}
{{- $base := strings.TrimSuffix $ext $url -}}
{{- range $suffix := $modes -}}
{{- $base = strings.TrimSuffix (printf "-%s" $suffix) $base -}}
{{- end -}}
{{- range $suffix := $modes -}}
{{- $image := printf "%s-%s%s" $base $suffix $ext -}}
{{- $params = merge $params (dict
"url" $image
"mode" $suffix
"modes" $modes)
-}}
{{- partial "assets/helpers/image-definition.html" $params -}}
{{- end -}}
{{ else }}
{{- $params = merge $params (dict "url" $url) -}}
{{- partial "assets/helpers/image-definition.html" $params -}}
{{- end -}}
{{ end }} {{ end }}

View File

@@ -19,9 +19,14 @@
{{- $class := .class -}} {{- $class := .class -}}
{{- $cue := .cue | default site.Params.main.externalLinks.cue -}} {{- $cue := .cue | default site.Params.main.externalLinks.cue -}}
{{- $tab := .tab | default site.Params.main.externalLinks.tab -}} {{- $tab := .tab | default site.Params.main.externalLinks.tab -}}
{{- $baseURL := $page.Scratch.Get "baseURL" | default "/" -}}
{{- $menuURL := (or $menu.PageRef $menu.URL) | relLangURL -}} {{- $menuURL := "" -}}
{{- $pageURL := $page.RelPermalink | relLangURL -}} {{ if or (strings.HasPrefix $menu.PageRef "http") (strings.HasPrefix $menu.URL "http") }}
{{ $menuURL = or $menu.PageRef $menu.URL }}
{{ else }}
{{- $menuURL = urls.JoinPath $baseURL ((or $menu.PageRef $menu.URL) | relLangURL) -}}
{{ end }}
{{- $pageURL := $page.RelPermalink -}}
{{- $isActive := or (and (hasPrefix $pageURL $menuURL) (ne $menuURL ("/" | relLangURL))) (eq $pageURL $menuURL) -}} {{- $isActive := or (and (hasPrefix $pageURL $menuURL) (ne $menuURL ("/" | relLangURL))) (eq $pageURL $menuURL) -}}
{{- $isAlias := $menu.Params.alias -}} {{- $isAlias := $menu.Params.alias -}}
{{- $isIcon := $menu.Params.icon -}} {{- $isIcon := $menu.Params.icon -}}

View File

@@ -16,36 +16,16 @@
<!-- Inline partial to render the color mode switcher --> <!-- Inline partial to render the color mode switcher -->
{{- define "partials/navbar-mode.html" -}} {{- define "partials/navbar-mode.html" -}}
{{- $size := .size -}} {{- $id := .id | default "navbar-mode" -}}
{{- $collapsed := .collapsed -}}
{{- $id := .id -}}
<li class="nav-item dropdown {{ if $collapsed }}d-{{ $size }}-none{{ else }}d-none d-{{ $size }}-block{{ end }}"> <div class="d-flex mode-switch align-items-center" id="{{ $id }}">
<a class="nav-link dropdown-toggle" href="#!" role="button" data-bs-toggle="dropdown" aria-label="{{ T "colorMode" }}" aria-expanded="false" id="{{ $id }}-theme{{ if $collapsed }}-collapsed{{ end }}"> <input type="checkbox" class="checkbox navbar-mode-selector" id="{{ $id }}-checkbox" />
<span class="theme-icon-active">{{- partial "assets/icon.html" (dict "icon" "fas sun fa-fw") }}</span>{{ if $collapsed }}&nbsp;{{ T "colorMode" }}{{ end }} <label class="label" for="{{ $id }}-checkbox">
<span class="d-md-none"></span> {{- partial "assets/icon.html" (dict "icon" "fas sun fa-fw" "spacing" false) }}
</a> {{- partial "assets/icon.html" (dict "icon" "fas moon fa-fw" "spacing" false) }}
<ul class="dropdown-menu dropdown-menu-end" aria-labelledby="{{ $id }}-theme{{ if $collapsed }}-collapsed{{ end }}"> <div class="ball"></div>
<li> </label>
<a class="dropdown-item{{ if $collapsed }} switch-mode-collapsed{{ end }}" data-bs-theme-value="light" href="#!"> </div>
<span class="theme-icon">{{- partial "assets/icon.html" (dict "icon" "fas sun fa-fw" "spacing" false) }}</span>&nbsp;
{{- T "colorLight" }}
</a>
</li>
<li>
<a class="dropdown-item{{ if $collapsed }} switch-mode-collapsed{{ end }}" data-bs-theme-value="dark" href="#!">
<span class="theme-icon">{{- partial "assets/icon.html" (dict "icon" "fas moon fa-fw" "spacing" false) }}</span>&nbsp;
{{- T "colorDark" }}
</a>
</li>
<li>
<a class="dropdown-item{{ if $collapsed }} switch-mode-collapsed{{ end }}" data-bs-theme-value="auto" href="#!">
<span class="theme-icon">{{- partial "assets/icon.html" (dict "icon" "fas circle-half-stroke fa-fw" "spacing" false) }}</span>&nbsp;
{{- T "colorAuto" }}
</a>
</li>
</ul>
</li>
{{- end -}} {{- end -}}
<!-- Inline partial to render the version switcher --> <!-- Inline partial to render the version switcher -->
@@ -53,6 +33,7 @@
{{- $size := .size -}} {{- $size := .size -}}
{{- $collapsed := .collapsed -}} {{- $collapsed := .collapsed -}}
{{- $page := .page -}} {{- $page := .page -}}
{{- $baseURL := .baseURL -}}
{{- $list := site.Params.docs.releases -}} {{- $list := site.Params.docs.releases -}}
{{- $id := .id -}} {{- $id := .id -}}
{{- $version := partial "utilities/GetVersion.html" (dict "page" $page) -}} {{- $version := partial "utilities/GetVersion.html" (dict "page" $page) -}}
@@ -70,7 +51,7 @@
{{- end -}} {{- end -}}
{{ if $item.url }} {{ if $item.url }}
<li> <li>
{{- $url := (path.Join $item.url) | relLangURL -}} {{- $url := (urls.JoinPath $baseURL $item.url) | relLangURL -}}
<a class="pe-5 dropdown-item{{ if $collapsed }} switch-mode-collapsed{{ end }}{{ if $active }} active{{ end }}{{ if $disabled }} disabled{{ end }}" href="{{ $url }}">{{ $item.label }} <a class="pe-5 dropdown-item{{ if $collapsed }} switch-mode-collapsed{{ end }}{{ if $active }} active{{ end }}{{ if $disabled }} disabled{{ end }}" href="{{ $url }}">{{ $item.label }}
{{ if $item.latest }}&nbsp;({{ T "latest" }}){{ end }} {{ if $item.latest }}&nbsp;({{ T "latest" }}){{ end }}
{{ if $active }} {{ if $active }}
@@ -86,7 +67,7 @@
{{- if site.Params.docs.overview -}} {{- if site.Params.docs.overview -}}
{{ if gt (len $list) 0 }}<li><hr class="dropdown-divider"></li>{{ end }} {{ if gt (len $list) 0 }}<li><hr class="dropdown-divider"></li>{{ end }}
<li> <li>
{{- $url := (path.Join site.Params.docs.overview) | relLangURL -}} {{- $url := (urls.JoinPath $baseURL site.Params.docs.overview) | relLangURL -}}
<a class="dropdown-item{{ if $collapsed }} switch-mode-collapsed{{ end }}" href="{{ $url }}">{{ T "allVersions" }}</a> <a class="dropdown-item{{ if $collapsed }} switch-mode-collapsed{{ end }}" href="{{ $url }}">{{ T "allVersions" }}</a>
</li> </li>
{{- end -}} {{- end -}}
@@ -98,6 +79,7 @@
{{- $absoluteURL := site.Params.main.canonifyAssetsURLs | default false -}} {{- $absoluteURL := site.Params.main.canonifyAssetsURLs | default false -}}
{{- $id := .id | default (printf "navbar-%d" 0) -}} {{- $id := .id | default (printf "navbar-%d" 0) -}}
{{- $page := .page -}} {{- $page := .page -}}
{{- $baseURL := $page.Scratch.Get "baseURL" -}}
{{- $defaultMenu := "main" -}} {{- $defaultMenu := "main" -}}
{{- $menuName := .menus | default $defaultMenu }} {{- $menuName := .menus | default $defaultMenu }}
@@ -117,6 +99,7 @@
{{- $search := .search | default site.Params.navigation.search -}} {{- $search := .search | default site.Params.navigation.search -}}
{{- $searchModal := and $search site.Params.navigation.searchModal -}} {{- $searchModal := and $search site.Params.navigation.searchModal -}}
{{- $enableDarkMode := .mode | default site.Params.main.enableDarkMode -}} {{- $enableDarkMode := .mode | default site.Params.main.enableDarkMode -}}
{{- $modes := site.Params.main.modes | default (slice "light" "dark") -}}
{{- $enableVersions := false -}} {{- $enableVersions := false -}}
{{ $list := site.Params.docs.releases }} {{ $list := site.Params.docs.releases }}
@@ -132,8 +115,15 @@
{{- $logoDark := "" -}} {{- $logoDark := "" -}}
{{- if $enableDarkMode -}} {{- if $enableDarkMode -}}
{{ $ext := path.Ext $logo -}} {{ $ext := path.Ext $logo -}}
{{- $logoLight = printf "%s-light%s" (strings.TrimSuffix $ext $logo) $ext -}} {{- $ext := path.Ext $logo -}}
{{- $logoDark = printf "%s-dark%s" (strings.TrimSuffix $ext $logo) $ext -}} {{- $base := strings.TrimSuffix $ext $logo -}}
{{- range $suffix := $modes -}}
{{- $base = strings.TrimSuffix (printf "-%s" $suffix) $base -}}
{{- end -}}
{{- $logoLight = printf "%s-light%s" $base $ext -}}
{{- $logoDark = printf "%s-dark%s" $base $ext -}}
{{- $light := fileExists (path.Join "/static" $logoLight) -}} {{- $light := fileExists (path.Join "/static" $logoLight) -}}
{{- $dark := fileExists (path.Join "/static" $logoDark) -}} {{- $dark := fileExists (path.Join "/static" $logoDark) -}}
{{- if and $light (not $dark) -}} {{- if and $light (not $dark) -}}
@@ -152,6 +142,10 @@
{{- end -}} {{- end -}}
{{- end -}} {{- end -}}
{{ if $logo }}{{ $logo = urls.JoinPath $baseURL $logo }}{{ end }}
{{ if $logoLight }}{{ $logoLight = urls.JoinPath $baseURL $logoLight }}{{ end }}
{{ if $logoDark }}{{ $logoDark = urls.JoinPath $baseURL $logoDark }}{{ end }}
{{- $title := site.Title -}} {{- $title := site.Title -}}
{{- if .title -}} {{- if .title -}}
{{- $title = .title -}} {{- $title = .title -}}
@@ -255,8 +249,8 @@
<!-- Insert version switcher --> <!-- Insert version switcher -->
{{- if $enableVersions -}} {{- if $enableVersions -}}
{{- partial "partials/navbar-versions.html" (dict "page" $page "size" $size "collapsed" true "id" .id) -}} {{- partial "partials/navbar-versions.html" (dict "page" $page "size" $size "collapsed" true "id" .id "baseURL" $baseURL) -}}
{{- partial "partials/navbar-versions.html" (dict "page" $page "size" $size "collapsed" false "id" .id) -}} {{- partial "partials/navbar-versions.html" (dict "page" $page "size" $size "collapsed" false "id" .id "baseURL" $baseURL) -}}
{{- end -}} {{- end -}}
<!-- Insert language switcher if applicable --> <!-- Insert language switcher if applicable -->
@@ -276,7 +270,7 @@
{{- end -}} {{- end -}}
{{- else -}} {{- else -}}
{{- range site.Languages -}} {{- range site.Languages -}}
<li><a class="dropdown-item" href="/{{ .Lang }}">{{ default .Lang .LanguageName }}</a></li> <li><a class="dropdown-item" href="{{ urls.JoinPath $baseURL .Lang }}">{{ default .Lang .LanguageName }}</a></li>
{{- end -}} {{- end -}}
{{- end -}} {{- end -}}
</ul> </ul>
@@ -286,7 +280,6 @@
<!-- Insert color mode switcher --> <!-- Insert color mode switcher -->
{{- if $enableDarkMode -}} {{- if $enableDarkMode -}}
{{- partial "partials/navbar-mode.html" (dict "size" $size "collapsed" true "id" .id) -}} {{- partial "partials/navbar-mode.html" (dict "size" $size "collapsed" true "id" .id) -}}
{{- partial "partials/navbar-mode.html" (dict "size" $size "collapsed" false "id" .id) -}}
{{- end -}} {{- end -}}
<!-- Insert modal search button --> <!-- Insert modal search button -->

View File

@@ -21,22 +21,30 @@
{{- with .First }} {{- with .First }}
{{- if ne $currentPageNumber .PageNumber }} {{- if ne $currentPageNumber .PageNumber }}
<li class="page-item"> <li class="page-item">
<a href="{{ .URL }}" aria-label="{{ T "paginationFirst" }}" class="page-link" role="button"><span aria-hidden="true">{{ partial "assets/icon.html" (dict "icon" "fas angles-left") }}</span></a> <a href="{{ .URL }}" aria-label="{{ T "paginationFirst" }}" class="page-link" role="button">
<span aria-hidden="true">{{ partial "assets/icon.html" (dict "icon" "fas angles-left" "spacing" false) }}</span>
</a>
</li> </li>
{{- else }} {{- else }}
<li class="page-item disabled"> <li class="page-item disabled">
<a aria-disabled="true" aria-label="{{ T "paginationFirst" }}" class="page-link" role="button" tabindex="-1"><span aria-hidden="true">{{ partial "assets/icon.html" (dict "icon" "fas angles-left") }}</span></a> <a aria-disabled="true" aria-label="{{ T "paginationFirst" }}" class="page-link" role="button" tabindex="-1">
<span aria-hidden="true">{{ partial "assets/icon.html" (dict "icon" "fas angles-left" "spacing" false) }}</span>
</a>
</li> </li>
{{- end }} {{- end }}
{{- end }} {{- end }}
{{- with .Prev }} {{- with .Prev }}
<li class="page-item"> <li class="page-item">
<a href="{{ .URL }}" aria-label="{{ T "paginationPrevious" }}" class="page-link" role="button"><span aria-hidden="true">{{ partial "assets/icon.html" (dict "icon" "fas angle-left") }}</span></a> <a href="{{ .URL }}" aria-label="{{ T "paginationPrevious" }}" class="page-link" role="button">
<span aria-hidden="true">{{ partial "assets/icon.html" (dict "icon" "fas angle-left" "spacing" false) }}</span>
</a>
</li> </li>
{{- else }} {{- else }}
<li class="page-item disabled"> <li class="page-item disabled">
<a aria-disabled="true" aria-label="{{ T "paginationPrevious" }}" class="page-link" role="button" tabindex="-1"><span aria-hidden="true">{{ partial "assets/icon.html" (dict "icon" "fas angle-left") }}</span></a> <a aria-disabled="true" aria-label="{{ T "paginationPrevious" }}" class="page-link" role="button" tabindex="-1">
<span aria-hidden="true">{{ partial "assets/icon.html" (dict "icon" "fas angle-left" "spacing" false) }}</span>
</a>
</li> </li>
{{- end }} {{- end }}
@@ -61,22 +69,30 @@
{{- with .Next }} {{- with .Next }}
<li class="page-item"> <li class="page-item">
<a href="{{ .URL }}" aria-label="{{ T "paginationNext" }}" class="page-link" role="button"><span aria-hidden="true">{{ partial "assets/icon.html" (dict "icon" "fas angle-right") }}</span></a> <a href="{{ .URL }}" aria-label="{{ T "paginationNext" }}" class="page-link" role="button">
<span aria-hidden="true">{{ partial "assets/icon.html" (dict "icon" "fas angle-right" "spacing" false) }}</span>
</a>
</li> </li>
{{- else }} {{- else }}
<li class="page-item disabled"> <li class="page-item disabled">
<a aria-disabled="true" aria-label="{{ T "paginationNext" }}" class="page-link" role="button" tabindex="-1"><span aria-hidden="true">{{ partial "assets/icon.html" (dict "icon" "fas angle-right") }}</span></a> <a aria-disabled="true" aria-label="{{ T "paginationNext" }}" class="page-link" role="button" tabindex="-1">
<span aria-hidden="true">{{ partial "assets/icon.html" (dict "icon" "fas angle-right" "spacing" false) }}</span>
</a>
</li> </li>
{{- end }} {{- end }}
{{- with .Last }} {{- with .Last }}
{{- if ne $currentPageNumber .PageNumber }} {{- if ne $currentPageNumber .PageNumber }}
<li class="page-item"> <li class="page-item">
<a href="{{ .URL }}" aria-label="{{ T "paginationLast" }}" class="page-link" role="button"><span aria-hidden="true">{{ partial "assets/icon.html" (dict "icon" "fas angles-right") }}</span></a> <a href="{{ .URL }}" aria-label="{{ T "paginationLast" }}" class="page-link" role="button">
<span aria-hidden="true">{{ partial "assets/icon.html" (dict "icon" "fas angles-right" "spacing" false) }}</span>
</a>
</li> </li>
{{- else }} {{- else }}
<li class="page-item disabled"> <li class="page-item disabled">
<a aria-disabled="true" aria-label="{{ T "paginationLast" }}" class="page-link" role="button" tabindex="-1"><span aria-hidden="true">{{ partial "assets/icon.html" (dict "icon" "fas angles-right") }}</span></a> <a aria-disabled="true" aria-label="{{ T "paginationLast" }}" class="page-link" role="button" tabindex="-1">
<span aria-hidden="true">{{ partial "assets/icon.html" (dict "icon" "fas angles-right" "spacing" false) }}</span>
</a>
</li> </li>
{{- end }} {{- end }}
{{- end }} {{- end }}
@@ -90,14 +106,18 @@
{{- with .First }} {{- with .First }}
{{- if ne $currentPageNumber .PageNumber }} {{- if ne $currentPageNumber .PageNumber }}
<li class="page-item"> <li class="page-item">
<a href="{{ .URL }}" aria-label="{{ T "paginationFirst" }}" class="page-link" role="button"><span aria-hidden="true">{{ partial "assets/icon.html" (dict "icon" "fas angles-left") }}</span></a> <a href="{{ .URL }}" aria-label="{{ T "paginationFirst" }}" class="page-link" role="button">
<span aria-hidden="true">{{ partial "assets/icon.html" (dict "icon" "fas angles-left" "spacing" false) }}</span>
</a>
</li> </li>
{{- end }} {{- end }}
{{- end }} {{- end }}
{{- with .Prev }} {{- with .Prev }}
<li class="page-item"> <li class="page-item">
<a href="{{ .URL }}" aria-label="{{ T "paginationPrevious" }}" class="page-link" role="button"><span aria-hidden="true">{{ partial "assets/icon.html" (dict "icon" "fas angle-left") }}</span></a> <a href="{{ .URL }}" aria-label="{{ T "paginationPrevious" }}" class="page-link" role="button">
<span aria-hidden="true">{{ partial "assets/icon.html" (dict "icon" "fas angle-left" "spacing" false) }}</span>
</a>
</li> </li>
{{- end }} {{- end }}
@@ -122,14 +142,18 @@
{{- with .Next }} {{- with .Next }}
<li class="page-item"> <li class="page-item">
<a href="{{ .URL }}" aria-label="{{ T "paginationNext" }}" class="page-link" role="button"><span aria-hidden="true">{{ partial "assets/icon.html" (dict "icon" "fas angle-right") }}</span></a> <a href="{{ .URL }}" aria-label="{{ T "paginationNext" }}" class="page-link" role="button">
<span aria-hidden="true">{{ partial "assets/icon.html" (dict "icon" "fas angle-right" "spacing" false) }}</span>
</a>
</li> </li>
{{- end }} {{- end }}
{{- with .Last }} {{- with .Last }}
{{- if ne $currentPageNumber .PageNumber }} {{- if ne $currentPageNumber .PageNumber }}
<li class="page-item"> <li class="page-item">
<a href="{{ .URL }}" aria-label="{{ T "paginationLast" }}" class="page-link" role="button"><span aria-hidden="true">{{ partial "assets/icon.html" (dict "icon" "fas angles-right") }}</span></a> <a href="{{ .URL }}" aria-label="{{ T "paginationLast" }}" class="page-link" role="button">
<span aria-hidden="true">{{ partial "assets/icon.html" (dict "icon" "fas angles-right" "spacing" false) }}</span>
</a>
</li> </li>
{{- end }} {{- end }}
{{- end }} {{- end }}

View File

@@ -26,8 +26,8 @@
{{- $group := .group -}} {{- $group := .group -}}
{{- $data := .menu -}} {{- $data := .menu -}}
{{- $doc_slug := $group.title | urlize -}} {{- $doc_slug := urls.JoinPath $baseURL ($group.title | urlize) -}}
{{- $href := or $group.link (printf "%s/" (relLangURL (path.Join $baseURL $doc_slug))) -}} {{- $href := or $group.link (partial "utilities/GetStaticURL" (dict "url" $doc_slug)) -}}
{{- $collapsed := strings.HasPrefix $page.RelPermalink $href -}} {{- $collapsed := strings.HasPrefix $page.RelPermalink $href -}}
<li class="mb-1"> <li class="mb-1">
@@ -71,11 +71,14 @@
{{- $level := .level -}} {{- $level := .level -}}
{{- $baseURL := .baseURL -}} {{- $baseURL := .baseURL -}}
{{- $title := .title -}} {{- $title := .title -}}
{{- $href := .href -}}
{{- $data := .menu -}} {{- $data := .menu -}}
{{ $href := "" }}
{{- $doc_slug := $title | urlize -}} {{ with .href }}
{{- $href := or $href (printf "%s/" (relLangURL (path.Join $baseURL $doc_slug))) -}} {{- $href = (partial "utilities/GetStaticURL" (dict "url" (urls.JoinPath $baseURL .))) -}}
{{ else }}
{{- $href = partial "utilities/GetStaticURL" (dict "url" (urls.JoinPath $baseURL ($title | urlize))) -}}
{{ end }}
{{- $active := eq (strings.TrimSuffix "/" $page.RelPermalink) (strings.TrimSuffix "/" $href) -}} {{- $active := eq (strings.TrimSuffix "/" $page.RelPermalink) (strings.TrimSuffix "/" $href) -}}
{{ if eq $level 0}} {{ if eq $level 0}}

View File

@@ -25,7 +25,7 @@
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin> <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link rel="stylesheet" href="{{ .Site.Params.style.themeFontPath | default "https://fonts.googleapis.com/css2?family=Inter:wght@200;300;600&display=swap" }}"> <link rel="stylesheet" href="{{ .Site.Params.style.themeFontPath | default "https://fonts.googleapis.com/css2?family=Inter:wght@200;300;600&display=swap" }}">
{{ else if .Site.Params.style.themeFontPreload }} {{ else if .Site.Params.style.themeFontPreload }}
{{ $font := .Site.Params.style.themeFontPreload }} {{ $font := partial "utilities/GetStaticURL" (dict "url" .Site.Params.style.themeFontPreload) }}
<link rel="preload" href="{{ $font }}" as="font" type="font/{{ strings.TrimPrefix "." (path.Ext $font) }}" crossorigin> <link rel="preload" href="{{ $font }}" as="font" type="font/{{ strings.TrimPrefix "." (path.Ext $font) }}" crossorigin>
{{- end -}} {{- end -}}
{{ partial "head/seo.html" . }} {{ partial "head/seo.html" . }}

View File

@@ -35,7 +35,9 @@
{{- end }} {{- end }}
{{- end -}} {{- end -}}
{{ $base := partial "utilities/GetStaticURL" (dict "url" "/") }}
{{- range resources.Match "icons/**.svg" -}} {{- range resources.Match "icons/**.svg" -}}
{{- $icon := . | resources.ExecuteAsTemplate .RelPermalink $params -}} {{- $target := strings.TrimPrefix $base .RelPermalink -}}
{{- $icon := . | resources.ExecuteAsTemplate $target $params -}}
{{- $icon.Publish -}} {{- $icon.Publish -}}
{{- end -}} {{- end -}}

View File

@@ -40,6 +40,7 @@
{{- $overlayOffset := $navbarOffset -}} {{- $overlayOffset := $navbarOffset -}}
{{- if site.Params.navigation.overlay }}{{ $overlayOffset = "0rem" }}{{ end }} {{- if site.Params.navigation.overlay }}{{ $overlayOffset = "0rem" }}{{ end }}
{{- $vars := dict {{- $vars := dict
"base-url" (page.Scratch.Get "baseURL" | default "/")
"theme-font" (default "Inter" site.Params.style.themeFont) "theme-font" (default "Inter" site.Params.style.themeFont)
"font-size-base" (default "1rem" site.Params.style.fontSizeBase) "font-size-base" (default "1rem" site.Params.style.fontSizeBase)
"primary" (default "#007bff" site.Params.style.primary) "primary" (default "#007bff" site.Params.style.primary)

View File

@@ -24,6 +24,7 @@
{{- $portrait := false -}} {{- $portrait := false -}}
{{- $loading := "" -}} {{- $loading := "" -}}
{{- $error := false -}} {{- $error := false -}}
{{- $plain := false -}}
{{- if .IsNamedParams -}} {{- if .IsNamedParams -}}
{{ $url = .Get "src" | default "" -}} {{ $url = .Get "src" | default "" -}}
@@ -37,6 +38,7 @@
{{ $figclass = .Get "figclass" | default "" -}} {{ $figclass = .Get "figclass" | default "" -}}
{{ with .Get "mode" }}{{ $mode = partial "utilities/CastBool.html" . }}{{ end -}} {{ with .Get "mode" }}{{ $mode = partial "utilities/CastBool.html" . }}{{ end -}}
{{ with .Get "portrait" }}{{ $portrait = partial "utilities/CastBool.html" . }}{{ end -}} {{ with .Get "portrait" }}{{ $portrait = partial "utilities/CastBool.html" . }}{{ end -}}
{{ with .Get "plain" }}{{ $plain = partial "utilities/CastBool.html" . }}{{ end -}}
{{ else -}} {{ else -}}
{{ $url = .Get 0 }} {{ $url = .Get 0 }}
{{ end -}} {{ end -}}
@@ -58,6 +60,7 @@
"figclass" $figclass "figclass" $figclass
"mode" $mode "mode" $mode
"portrait" $portrait "portrait" $portrait
"plain" $plain
"loading" $loading "loading" $loading
"page" .Page) "page" .Page)
-}} -}}

View File

@@ -24,7 +24,7 @@
{{ .Count }} {{ if gt .Count 1 }} {{ T "articles" }} {{ else }} {{ T "article" }} {{ end }} {{ .Count }} {{ if gt .Count 1 }} {{ T "articles" }} {{ else }} {{ T "article" }} {{ end }}
</div> </div>
<div class="col-9"> <div class="col-9">
<a href="{{ (path.Join .Page.RelPermalink) | relLangURL }}">{{ .Page.Title | .Page.RenderString }}</a> <a href="{{ .Page.RelPermalink }}">{{ .Page.Title | .Page.RenderString }}</a>
</div> </div>
</div> </div>
{{ end }} {{ end }}
@@ -48,7 +48,7 @@
<p class="text-body-secondary mt-5">{{ $year }}</p> <p class="text-body-secondary mt-5">{{ $year }}</p>
{{ $.Scratch.Set "lastYear" $year }} {{ $.Scratch.Set "lastYear" $year }}
{{ end }} {{ end }}
<a href="{{ (path.Join .Page.RelPermalink) | relLangURL }}">{{ if .Draft }}{{ T "draft" | upper }}: {{ end }}{{ .Title | .Page.RenderString }}</a> <a href="{{ .Page.RelPermalink }}">{{ if .Draft }}{{ T "draft" | upper }}: {{ end }}{{ .Title | .Page.RenderString }}</a>
</div> </div>
</div> </div>
{{ end }} {{ end }}

528
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -1,6 +1,6 @@
{ {
"name": "@gethinode/hinode", "name": "@gethinode/hinode",
"version": "0.24.0-beta2", "version": "0.24.2",
"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",
@@ -66,28 +66,30 @@
"url": "https://github.com/gethinode/hinode/issues" "url": "https://github.com/gethinode/hinode/issues"
}, },
"homepage": "https://gethinode.com", "homepage": "https://gethinode.com",
"devDependencies": { "dependencies": {
"@fullhuman/postcss-purgecss": "^6.0.0", "@fullhuman/postcss-purgecss": "^6.0.0",
"autoprefixer": "^10.4.19",
"cssnano": "^7.0.2",
"cssnano-preset-advanced": "^7.0.2",
"hugo-bin": "0.124.0",
"purgecss-whitelister": "^2.4.0"
},
"devDependencies": {
"@gethinode/netlify-plugin-dartsass": "^0.3.0", "@gethinode/netlify-plugin-dartsass": "^0.3.0",
"@netlify/plugin-lighthouse": "^6.0.0", "@netlify/plugin-lighthouse": "^6.0.0",
"autoprefixer": "^10.4.19",
"cssnano": "^7.0.1",
"cssnano-preset-advanced": "^7.0.1",
"eslint": "^8.57.0", "eslint": "^8.57.0",
"eslint-config-standard": "^17.1.0", "eslint-config-standard": "^17.1.0",
"eslint-plugin-import": "^2.29.1", "eslint-plugin-import": "^2.29.1",
"eslint-plugin-n": "^16.6.2", "eslint-plugin-n": "^16.6.2",
"eslint-plugin-promise": "^6.1.1", "eslint-plugin-promise": "^6.2.0",
"hugo-bin": "0.123.1",
"markdownlint-cli2": "^0.13.0", "markdownlint-cli2": "^0.13.0",
"netlify-plugin-hugo-cache-resources": "^0.2.1", "netlify-plugin-hugo-cache-resources": "^0.2.1",
"npm-run-all": "^4.1.5", "npm-run-all": "^4.1.5",
"postcss-cli": "^11.0.0", "postcss-cli": "^11.0.0",
"purgecss-whitelister": "^2.4.0",
"replace-in-files-cli": "^2.2.0", "replace-in-files-cli": "^2.2.0",
"rimraf": "^5.0.7", "rimraf": "^5.0.7",
"shx": "^0.3.4", "shx": "^0.3.4",
"stylelint": "^16.6.0", "stylelint": "^16.6.1",
"stylelint-config-standard-scss": "^13.1.0" "stylelint-config-standard-scss": "^13.1.0"
}, },
"optionalDependencies": { "optionalDependencies": {