mirror of
https://github.com/gethinode/hinode.git
synced 2025-10-07 01:54:23 +00:00
Compare commits
102 Commits
v0.24.0-al
...
v0.24.0-be
Author | SHA1 | Date | |
---|---|---|---|
![]() |
20f14934c2 | ||
![]() |
840e67d12d | ||
![]() |
8ef57a265e | ||
![]() |
8677357450 | ||
![]() |
79ac2dae4f | ||
![]() |
20cad07a0b | ||
![]() |
2c97af2fef | ||
![]() |
95ded6296c | ||
![]() |
3b46095821 | ||
![]() |
1bf4e74e56 | ||
![]() |
9b75b46c49 | ||
![]() |
107077f5ec | ||
![]() |
528b70bfa2 | ||
![]() |
75ab4625b1 | ||
![]() |
bac3054ec2 | ||
![]() |
d63fd5f212 | ||
![]() |
c8b9df7ae5 | ||
![]() |
12daa88f39 | ||
![]() |
c5d895388b | ||
![]() |
5678d2cab5 | ||
![]() |
99d939a3a0 | ||
![]() |
c9a87e8514 | ||
![]() |
af08829f7d | ||
![]() |
28a59a4eac | ||
![]() |
727387931c | ||
![]() |
13a085099c | ||
![]() |
473f390ee6 | ||
![]() |
65cfc0933a | ||
![]() |
321e7f6df5 | ||
![]() |
dda623f040 | ||
![]() |
80d1147d08 | ||
![]() |
b28abcd6f2 | ||
![]() |
93885492d7 | ||
![]() |
ed5daa780d | ||
![]() |
00501edadd | ||
![]() |
fdb1472f9e | ||
![]() |
b176fbd365 | ||
![]() |
f2b0e49aa9 | ||
![]() |
5b8df68db5 | ||
![]() |
fce4b7dde9 | ||
![]() |
ba43672bf6 | ||
![]() |
1b93485064 | ||
![]() |
8d9f12d676 | ||
![]() |
1a89aa39c2 | ||
![]() |
6b60188702 | ||
![]() |
5e410040cc | ||
![]() |
b00f39f850 | ||
![]() |
7e396c5a4d | ||
![]() |
4d43f0bb9b | ||
![]() |
3512bb9dfe | ||
![]() |
7dde897e41 | ||
![]() |
f2cad0fe88 | ||
![]() |
eed2d8f68d | ||
![]() |
d1aebe2fbe | ||
![]() |
013614b149 | ||
![]() |
d55446d5cc | ||
![]() |
80a225e814 | ||
![]() |
c7e63308c5 | ||
![]() |
7bc712b5f3 | ||
![]() |
cf95a84f2a | ||
![]() |
b1e35836f9 | ||
![]() |
a794ab5c52 | ||
![]() |
8fd7d9cde9 | ||
![]() |
93f2f04bae | ||
![]() |
b2a8d78c73 | ||
![]() |
025afc37d4 | ||
![]() |
be5ca21019 | ||
![]() |
69584215b8 | ||
![]() |
e6cef96a03 | ||
![]() |
a6d4a71500 | ||
![]() |
388d8a7e27 | ||
![]() |
9df1b1b981 | ||
![]() |
82d426c14b | ||
![]() |
a2c5073a3d | ||
![]() |
11077b9178 | ||
![]() |
6e8011f111 | ||
![]() |
c6e23b58c5 | ||
![]() |
3267f1165e | ||
![]() |
e46d4764fd | ||
![]() |
2fb4829f68 | ||
![]() |
6009c45e5a | ||
![]() |
69505a1dca | ||
![]() |
c195d903c7 | ||
![]() |
07c1422bbb | ||
![]() |
6be688515d | ||
![]() |
5d83f12b35 | ||
![]() |
008c6a099a | ||
![]() |
125b72177c | ||
![]() |
75054731f4 | ||
![]() |
d36ce74eae | ||
![]() |
2433fa8a66 | ||
![]() |
adbff26d18 | ||
![]() |
bdcdeb9b55 | ||
![]() |
0636708dac | ||
![]() |
eb65b94ef4 | ||
![]() |
01b51f6ef1 | ||
![]() |
89b81cf1b8 | ||
![]() |
54396f4dc0 | ||
![]() |
0660a4c6e9 | ||
![]() |
cba7768e39 | ||
![]() |
a040ab42c3 | ||
![]() |
fa6c01a380 |
@@ -9,44 +9,49 @@
|
||||
(() => {
|
||||
'use strict'
|
||||
|
||||
const supportedThemes = ['auto', 'dark', 'light'];
|
||||
|
||||
// retrieves the currently stored theme from local storage (cookie)
|
||||
const storedTheme = localStorage.getItem('theme')
|
||||
|
||||
const getPreferredTheme = () => {
|
||||
if (storedTheme) {
|
||||
return storedTheme
|
||||
}
|
||||
|
||||
// retrieves the theme preferred by the client, defaults to light
|
||||
function getPreferredTheme() {
|
||||
return window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light'
|
||||
}
|
||||
|
||||
const setTheme = function (theme) {
|
||||
if (theme === 'auto') {
|
||||
document.documentElement.setAttribute('data-bs-theme', (window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light'))
|
||||
// retrieves the current theme, either from local storage or client's preferences
|
||||
function getTheme() {
|
||||
if (storedTheme) {
|
||||
return storedTheme
|
||||
} else {
|
||||
document.documentElement.setAttribute('data-bs-theme', theme)
|
||||
const preference = getPreferredTheme()
|
||||
localStorage.setItem('theme', preference)
|
||||
return preference
|
||||
}
|
||||
}
|
||||
|
||||
setTheme(getPreferredTheme())
|
||||
|
||||
const showActiveTheme = theme => {
|
||||
const activeSelectors = document.querySelectorAll('.theme-icon-active')
|
||||
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')
|
||||
}
|
||||
// applies and stores requested theme
|
||||
function setTheme(theme) {
|
||||
if (!supportedThemes.includes(theme)) {
|
||||
theme = 'auto'
|
||||
}
|
||||
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', () => {
|
||||
@@ -56,18 +61,32 @@
|
||||
})
|
||||
|
||||
window.addEventListener('DOMContentLoaded', () => {
|
||||
showActiveTheme(getPreferredTheme())
|
||||
setTheme(getTheme())
|
||||
const light = (document.documentElement.getAttribute('data-bs-theme') === 'light')
|
||||
|
||||
document.querySelectorAll('[data-bs-theme-value]')
|
||||
.forEach(toggle => {
|
||||
toggle.addEventListener('click', () => {
|
||||
const theme = toggle.getAttribute('data-bs-theme-value')
|
||||
localStorage.setItem('theme', theme)
|
||||
setTheme(theme)
|
||||
showActiveTheme(theme)
|
||||
})
|
||||
document.querySelectorAll('.ball').forEach(ball => {
|
||||
ball.classList.add('notransition');
|
||||
})
|
||||
|
||||
document.querySelectorAll('.navbar-mode-selector').forEach(chk => {
|
||||
chk.checked = light
|
||||
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 -}}
|
@@ -1,25 +1,25 @@
|
||||
// scss-docs-start icons
|
||||
$form-check-input-checked-bg-image: 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-input-indeterminate-bg-image: 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-dark: 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-checked-bg-image: url("/icons/form-switch-checked-bg-image.svg") !default;
|
||||
$form-select-indicator: url("/icons/form-select-indicator.svg") !default;
|
||||
$form-select-indicator-dark: url("/icons/form-select-indicator-dark.svg") !default;
|
||||
$form-feedback-icon-valid: url("/icons/form-feedback-icon-valid.svg") !default;
|
||||
$form-feedback-icon-invalid: url("/icons/form-feedback-icon-invalid.svg") !default;
|
||||
$navbar-light-toggler-icon-bg: url("/icons/navbar-light-toggler-icon-bg.svg") !default;
|
||||
$navbar-dark-toggler-icon-bg: url("/icons/navbar-dark-toggler-icon-bg.svg") !default;
|
||||
$accordion-button-icon: url("/icons/accordion-button-icon.svg") !default;
|
||||
$accordion-button-icon-dark: url("/icons/accordion-button-icon-dark.svg") !default;
|
||||
$accordion-button-active-icon: url("/icons/accordion-button-active-icon.svg") !default;
|
||||
$accordion-button-active-icon-dark: 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-next-icon-bg: url("/icons/carousel-control-next-icon-bg.svg") !default;
|
||||
$btn-close-bg: url("/icons/btn-close-bg.svg") !default;
|
||||
$btn-toggle: url("/icons/btn-toggle.svg") !default;
|
||||
$btn-toggle-dark: url("/icons/btn-toggle-dark.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("#{$base-url}icons/form-check-radio-checked-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("#{$base-url}icons/form-switch-bg-image.svg") !default;
|
||||
$form-switch-bg-image-dark: url("#{$base-url}icons/form-switch-bg-image-dark.svg") !default;
|
||||
$form-switch-focus-bg-image: url("#{$base-url}icons/form-switch-focus-bg-image.svg") !default;
|
||||
$form-switch-checked-bg-image: url("#{$base-url}icons/form-switch-checked-bg-image.svg") !default;
|
||||
$form-select-indicator: url("#{$base-url}icons/form-select-indicator.svg") !default;
|
||||
$form-select-indicator-dark: url("#{$base-url}icons/form-select-indicator-dark.svg") !default;
|
||||
$form-feedback-icon-valid: url("#{$base-url}icons/form-feedback-icon-valid.svg") !default;
|
||||
$form-feedback-icon-invalid: url("#{$base-url}icons/form-feedback-icon-invalid.svg") !default;
|
||||
$navbar-light-toggler-icon-bg: url("#{$base-url}icons/navbar-light-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("#{$base-url}icons/accordion-button-icon.svg") !default;
|
||||
$accordion-button-icon-dark: url("#{$base-url}icons/accordion-button-icon-dark.svg") !default;
|
||||
$accordion-button-active-icon: url("#{$base-url}icons/accordion-button-active-icon.svg") !default;
|
||||
$accordion-button-active-icon-dark: url("#{$base-url}icons/accordion-button-active-icon-dark.svg") !default;
|
||||
$carousel-control-prev-icon-bg: url("#{$base-url}icons/carousel-control-prev-icon-bg.svg") !default;
|
||||
$carousel-control-next-icon-bg: url("#{$base-url}icons/carousel-control-next-icon-bg.svg") !default;
|
||||
$btn-close-bg: url("#{$base-url}icons/btn-close-bg.svg") !default;
|
||||
$btn-toggle: url("#{$base-url}icons/btn-toggle.svg") !default;
|
||||
$btn-toggle-dark: url("#{$base-url}icons/btn-toggle-dark.svg") !default;
|
||||
|
||||
// scss-docs-end icons
|
||||
|
@@ -1,3 +1,9 @@
|
||||
@if $enable-dark-mode {
|
||||
body {
|
||||
transition: background-color 0.5s, color 0.5s;
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// Remove underline from all links
|
||||
//
|
||||
|
@@ -5,6 +5,8 @@ $enable-important-utilities: true !default;
|
||||
// Remove the border from the focused navigation toggler
|
||||
$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-size-base: h.$font-size-base !default;
|
||||
$headings-font-weight: 600 !default;
|
||||
|
@@ -5,6 +5,8 @@ $enable-important-utilities: true !default;
|
||||
// Remove the border from the focused navigation toggler
|
||||
$navbar-toggler-focus-width: 0 !default;
|
||||
|
||||
$base-url: $base-url;
|
||||
|
||||
// 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-size-base: $font-size-base !default;;
|
||||
|
@@ -68,8 +68,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
.card-zoom card-body-link,
|
||||
.card-body-link {
|
||||
.card-zoom .card-body-link {
|
||||
&:hover,
|
||||
&:focus {
|
||||
color: shade-color($primary, $link-shade-percentage) if($enable-important-utilities, !important, null);
|
||||
@@ -78,8 +77,7 @@
|
||||
|
||||
@if $enable-dark-mode {
|
||||
@include color-mode(dark) {
|
||||
.card-zoom card-body-link,
|
||||
.card-body-link {
|
||||
.card-zoom .card-body-link {
|
||||
&:hover,
|
||||
&:focus {
|
||||
color: $primary-bg-subtle-dark if($enable-important-utilities, !important, null);
|
||||
|
@@ -1,8 +1,6 @@
|
||||
// stylelint-disable annotation-no-unknown
|
||||
|
||||
// Source: https://jsfiddle.net/njhgr40m/
|
||||
|
||||
|
||||
.navbar {
|
||||
--bs-navbar-expanded-color: var(--bs-body-bg);
|
||||
--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);
|
||||
}
|
||||
|
@@ -16,25 +16,15 @@
|
||||
transpiler = "libsass"
|
||||
# toml-docs-end main
|
||||
|
||||
# toml-docs-start modules
|
||||
[modules]
|
||||
core = ["bootstrap", "flexsearch", "fontawesome"]
|
||||
optional = ["leaflet", "katex", "lottie"]
|
||||
excludeSCSS = ["bootstrap"]
|
||||
disableTemplate = ["katex"]
|
||||
[modules.katex]
|
||||
state = "defer"
|
||||
[modules.flexsearch]
|
||||
frontmatter = false
|
||||
filter = ""
|
||||
[modules.fontawesome]
|
||||
inline = true
|
||||
debug = true
|
||||
skipMissing = false
|
||||
[modules.utils]
|
||||
filter = "[^0-9A-Za-zŽžÀ-ÿ ;.,\\/'’\"]-"
|
||||
raw = false
|
||||
# toml-docs-end modules
|
||||
# toml-docs-start images
|
||||
[images]
|
||||
[images.cloudinary]
|
||||
host = "cloudinary"
|
||||
[images.imagekit]
|
||||
host = "imagekit"
|
||||
[images.imgix]
|
||||
host = "imgix"
|
||||
# toml-docs-end images
|
||||
|
||||
# toml-docs-start debugging
|
||||
[debugging]
|
||||
|
@@ -15,7 +15,7 @@ for = '/**'
|
||||
https://*.google-analytics.com https://*.analytics.google.com https://*.googletagmanager.com; \
|
||||
font-src 'self' https://fonts.gstatic.com; \
|
||||
frame-src 'self' https://www.youtube-nocookie.com https://www.youtube.com; \
|
||||
img-src 'self' data: https://*.cloudinary.com https://i.vimeocdn.com https://i.ytimg.com https://*.google-analytics.com https://*.googletagmanager.com https://tile.openstreetmap.org; \
|
||||
img-src 'self' data: https://*.imgix.net https://*.imagekit.io https://*.cloudinary.com https://i.vimeocdn.com https://i.ytimg.com https://*.google-analytics.com https://*.googletagmanager.com https://tile.openstreetmap.org; \
|
||||
manifest-src 'self'; \
|
||||
media-src 'self' \
|
||||
"""
|
||||
|
@@ -13,7 +13,7 @@
|
||||
- 992x661
|
||||
- 1200x800
|
||||
- 1400x933
|
||||
- 2800x1866
|
||||
- 2800x1867
|
||||
- ratio: 1x1
|
||||
dimensions:
|
||||
- 576x576
|
||||
@@ -29,7 +29,7 @@
|
||||
- 992x558
|
||||
- 1200x675
|
||||
- 1400x788
|
||||
- 2800x1576
|
||||
- 2800x1575
|
||||
- ratio: 21x9
|
||||
dimensions:
|
||||
- 576x247
|
||||
|
29
data/structures/image-adapter-rewrite.yml
Normal file
29
data/structures/image-adapter-rewrite.yml
Normal 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'.
|
@@ -19,7 +19,9 @@ comment: >-
|
||||
reference.
|
||||
arguments:
|
||||
url:
|
||||
type: string
|
||||
type:
|
||||
- string
|
||||
- template.URL
|
||||
optional: true
|
||||
comment: >-
|
||||
Path or url of the image, e.g. `img/example.jpg`. Images with multiple
|
||||
@@ -128,3 +130,11 @@ arguments:
|
||||
optional: true
|
||||
comment: Class attribute of the figure caption, e.g. `px-4`.
|
||||
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-beta5
|
||||
|
@@ -13,21 +13,6 @@
|
||||
[main.build]
|
||||
transpiler = "dartsass"
|
||||
|
||||
[modules]
|
||||
core = ["bootstrap", "flexsearch", "fontawesome"]
|
||||
optional = ["leaflet", "katex", "lottie"]
|
||||
excludeSCSS = ["bootstrap"]
|
||||
disableTemplate = ["katex"]
|
||||
[modules.katex]
|
||||
state = "defer"
|
||||
[modules.flexsearch]
|
||||
frontmatter = false
|
||||
filter = ""
|
||||
[modules.fontawesome]
|
||||
inline = true
|
||||
debug = true
|
||||
skipMissing = false
|
||||
|
||||
[debugging]
|
||||
showJS = false
|
||||
showSCSS = false
|
||||
@@ -70,6 +55,14 @@
|
||||
[messages]
|
||||
placement = "bottom-right"
|
||||
|
||||
[dam]
|
||||
dimensions = "dimensions.yml"
|
||||
|
||||
[[dam.providers]]
|
||||
name = "Cloudinary"
|
||||
pattern = "cloudinary"
|
||||
adapter = "assets/adapters/cloudinary.html"
|
||||
|
||||
[sharing]
|
||||
enabled = true
|
||||
sort = "weight"
|
||||
|
@@ -15,7 +15,7 @@ for = '/**'
|
||||
https://*.google-analytics.com https://*.analytics.google.com https://*.googletagmanager.com; \
|
||||
font-src 'self' https://fonts.gstatic.com; \
|
||||
frame-src 'self' https://www.youtube-nocookie.com https://www.youtube.com; \
|
||||
img-src 'self' data: https://*.cloudinary.com https://i.vimeocdn.com https://i.ytimg.com https://*.google-analytics.com https://*.googletagmanager.com https://tile.openstreetmap.org; \
|
||||
img-src 'self' data: https://*.imgix.net https://*.imagekit.io https://*.cloudinary.com https://i.vimeocdn.com https://i.ytimg.com https://*.google-analytics.com https://*.googletagmanager.com https://tile.openstreetmap.org; \
|
||||
manifest-src 'self'; \
|
||||
media-src 'self' \
|
||||
"""
|
||||
|
@@ -5,11 +5,7 @@ date: 2024-05-19
|
||||
description: Include responsive images from local sources and selected CDN image providers.
|
||||
tags: ["blog"]
|
||||
thumbnail:
|
||||
url: https://res.cloudinary.com/demo/image/upload/v1689803100/ai/hiker.jpg
|
||||
author: Nathan Dumlao
|
||||
authorURL: https://unsplash.com/@nate_dumlao
|
||||
origin: Unsplash
|
||||
originURL: https://unsplash.com/photos/QLPWQvHvmII
|
||||
url: https://assets.imgix.net/examples/bluehat.jpg
|
||||
---
|
||||
|
||||
## Cloudinary
|
||||
@@ -19,6 +15,28 @@ As an example, the following shortcode displays an image with rounded corners an
|
||||
<!-- markdownlint-disable MD037 -->
|
||||
{{< example lang="hugo" >}}
|
||||
{{</* 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 >}}
|
||||
<!-- markdownlint-enable MD037 -->
|
||||
|
||||
## ImageKit.io
|
||||
|
||||
As an example, the following shortcode displays an image with rounded corners and a 21x9 aspect ratio.
|
||||
|
||||
<!-- markdownlint-disable MD037 -->
|
||||
{{< example lang="hugo" >}}
|
||||
{{</* image src="https://ik.imagekit.io/demo/default-image.jpg"
|
||||
ratio="21x9" caption="ImageKit.io image" class="rounded" */>}}
|
||||
{{< /example >}}
|
||||
<!-- markdownlint-enable MD037 -->
|
||||
|
||||
## Imgix
|
||||
|
||||
As an example, the following shortcode displays an image with rounded corners and a 21x9 aspect ratio.
|
||||
|
||||
<!-- markdownlint-disable MD037 -->
|
||||
{{< example lang="hugo" >}}
|
||||
{{</* image src="https://assets.imgix.net/examples/bluehat.jpg"
|
||||
ratio="21x9" caption="imgix image" class="rounded" */>}}
|
||||
{{< /example >}}
|
||||
<!-- markdownlint-enable MD037 -->
|
||||
|
@@ -22,6 +22,7 @@
|
||||
"i",
|
||||
"img",
|
||||
"input",
|
||||
"label",
|
||||
"li",
|
||||
"link",
|
||||
"mark",
|
||||
@@ -69,6 +70,7 @@
|
||||
"align-self-end",
|
||||
"anchor",
|
||||
"badge",
|
||||
"ball",
|
||||
"bg-body",
|
||||
"bg-body-tertiary",
|
||||
"bg-danger",
|
||||
@@ -123,6 +125,7 @@
|
||||
"carousel-indicators",
|
||||
"carousel-inner",
|
||||
"carousel-item",
|
||||
"checkbox",
|
||||
"chroma",
|
||||
"col",
|
||||
"col-10",
|
||||
@@ -188,7 +191,6 @@
|
||||
"fa-arrow-right",
|
||||
"fa-bootstrap",
|
||||
"fa-circle-check",
|
||||
"fa-circle-half-stroke",
|
||||
"fa-code",
|
||||
"fa-docker",
|
||||
"fa-ellipsis",
|
||||
@@ -257,6 +259,7 @@
|
||||
"justify-content-center",
|
||||
"justify-content-end",
|
||||
"justify-content-start",
|
||||
"label",
|
||||
"lead",
|
||||
"leaflet-map",
|
||||
"link-bg-body",
|
||||
@@ -278,6 +281,7 @@
|
||||
"me-auto",
|
||||
"middle-bar",
|
||||
"min-vh-100",
|
||||
"mode-switch",
|
||||
"ms-1",
|
||||
"ms-3",
|
||||
"ms-auto",
|
||||
@@ -309,6 +313,7 @@
|
||||
"navbar-contrast",
|
||||
"navbar-expand-md",
|
||||
"navbar-fixed-top",
|
||||
"navbar-mode-selector",
|
||||
"navbar-nav",
|
||||
"navbar-nav-scroll",
|
||||
"navbar-title",
|
||||
@@ -391,7 +396,6 @@
|
||||
"sticky-top",
|
||||
"stretched-link",
|
||||
"svg-inline--fa",
|
||||
"switch-mode-collapsed",
|
||||
"syntax-highlight",
|
||||
"tab-content",
|
||||
"tab-pane",
|
||||
@@ -419,8 +423,6 @@
|
||||
"text-sm-start",
|
||||
"text-start",
|
||||
"text-uppercase",
|
||||
"theme-icon",
|
||||
"theme-icon-active",
|
||||
"tickmark",
|
||||
"timeline",
|
||||
"timeline-bg-dark",
|
||||
@@ -459,8 +461,6 @@
|
||||
"w-50"
|
||||
],
|
||||
"ids": [
|
||||
"-theme",
|
||||
"-theme-collapsed",
|
||||
"TableOfContents",
|
||||
"abbr",
|
||||
"accordion",
|
||||
@@ -511,6 +511,8 @@
|
||||
"groupe-de-cartes",
|
||||
"icon",
|
||||
"image",
|
||||
"imagekitio",
|
||||
"imgix",
|
||||
"indicateur-de-chargement",
|
||||
"infobulle",
|
||||
"invite-de-commandes",
|
||||
@@ -530,6 +532,8 @@
|
||||
"nav-0-btn-2",
|
||||
"navbar",
|
||||
"navbar-0-collapse",
|
||||
"navbar-mode",
|
||||
"navbar-mode-checkbox",
|
||||
"navbar-sample-collapse",
|
||||
"navigation",
|
||||
"notification",
|
||||
|
14
go.mod
14
go.mod
@@ -4,13 +4,13 @@ go 1.19
|
||||
|
||||
require (
|
||||
github.com/airbnb/lottie-web v5.12.2+incompatible // indirect
|
||||
github.com/gethinode/mod-bootstrap v1.2.8 // indirect
|
||||
github.com/gethinode/mod-flexsearch v1.11.3 // indirect
|
||||
github.com/gethinode/mod-fontawesome v1.8.2 // indirect
|
||||
github.com/gethinode/mod-katex v1.0.9 // indirect
|
||||
github.com/gethinode/mod-leaflet v1.0.1 // indirect
|
||||
github.com/gethinode/mod-lottie v1.4.6 // indirect
|
||||
github.com/gethinode/mod-utils/v2 v2.2.2 // indirect
|
||||
github.com/gethinode/mod-bootstrap v1.3.0 // indirect
|
||||
github.com/gethinode/mod-flexsearch v1.12.0 // indirect
|
||||
github.com/gethinode/mod-fontawesome v1.9.0 // indirect
|
||||
github.com/gethinode/mod-katex v1.1.0 // indirect
|
||||
github.com/gethinode/mod-leaflet v1.1.0 // indirect
|
||||
github.com/gethinode/mod-lottie v1.5.3 // indirect
|
||||
github.com/gethinode/mod-utils/v2 v2.3.6 // indirect
|
||||
github.com/nextapps-de/flexsearch v0.0.0-20240110101704-4c3966709f85 // indirect
|
||||
github.com/twbs/bootstrap v5.3.3+incompatible // indirect
|
||||
)
|
||||
|
34
go.sum
34
go.sum
@@ -20,6 +20,8 @@ github.com/gethinode/mod-bootstrap v1.2.6 h1:joKKVqWzPgitPbUFlU4oIRj72YXsEHkVun3
|
||||
github.com/gethinode/mod-bootstrap v1.2.6/go.mod h1:CL9IDot6nbXIWJYE/KxfsTdYYEJIGL17BXbAYPn+wVQ=
|
||||
github.com/gethinode/mod-bootstrap v1.2.8 h1:kIKSO6qqE8xA0KQC5s6kkEv5UDc8oT17HalGIwB+dSc=
|
||||
github.com/gethinode/mod-bootstrap v1.2.8/go.mod h1:CL9IDot6nbXIWJYE/KxfsTdYYEJIGL17BXbAYPn+wVQ=
|
||||
github.com/gethinode/mod-bootstrap v1.3.0 h1:UxNmXgXo7gA8C8z1ar47+tSccmKYpaYBBN+txB0pwBk=
|
||||
github.com/gethinode/mod-bootstrap v1.3.0/go.mod h1:CL9IDot6nbXIWJYE/KxfsTdYYEJIGL17BXbAYPn+wVQ=
|
||||
github.com/gethinode/mod-flexsearch v1.0.1 h1:FJkRsUzSnQTXl3MWCigT4E6vfff870UWTnkGqaDGIhA=
|
||||
github.com/gethinode/mod-flexsearch v1.0.1/go.mod h1:TXbGbWsvmhBdsTzRt887mcpFfr4ORpzG3+h/l4W3YM4=
|
||||
github.com/gethinode/mod-flexsearch v1.1.0 h1:7BCMyQDlYlskNXuazt8Jg/jg9WREexu2xVkYqThkAX4=
|
||||
@@ -64,6 +66,8 @@ github.com/gethinode/mod-flexsearch v1.11.1 h1:TtaE6Dv0lH4x73SHDaZpQJLjk52lRu/Vo
|
||||
github.com/gethinode/mod-flexsearch v1.11.1/go.mod h1:L8hrnpupx27cez2ObMX8gWnhbW6qss4HGH1Ea4UaBRQ=
|
||||
github.com/gethinode/mod-flexsearch v1.11.3 h1:ykxpUg8M4vr1C4QzxJOPGt+1ZmPAD/gOCZoFcZxWoWw=
|
||||
github.com/gethinode/mod-flexsearch v1.11.3/go.mod h1:L8hrnpupx27cez2ObMX8gWnhbW6qss4HGH1Ea4UaBRQ=
|
||||
github.com/gethinode/mod-flexsearch v1.12.0 h1:zg1IHvc8VO9WEtQuQnuG6HeWFNByvyqC9JYWDtpsP6s=
|
||||
github.com/gethinode/mod-flexsearch v1.12.0/go.mod h1:L8hrnpupx27cez2ObMX8gWnhbW6qss4HGH1Ea4UaBRQ=
|
||||
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.1.0 h1:rsDzUI+3ZlS/do2ff3ne8/z3KwHeysmuA+WsXlumXXk=
|
||||
@@ -102,6 +106,8 @@ github.com/gethinode/mod-fontawesome v1.8.1 h1:iyvULrpaGizQoI5Vl9WjFYcMGWefdyG90
|
||||
github.com/gethinode/mod-fontawesome v1.8.1/go.mod h1:xBKsZH3WJtMOItZVlp9SbO51uaBy6IbvUZSKpNu3b6Y=
|
||||
github.com/gethinode/mod-fontawesome v1.8.2 h1:LAzLytyh9c9gLzBWMju6Gtp3uEojhBQEYw0o38EUKZY=
|
||||
github.com/gethinode/mod-fontawesome v1.8.2/go.mod h1:xBKsZH3WJtMOItZVlp9SbO51uaBy6IbvUZSKpNu3b6Y=
|
||||
github.com/gethinode/mod-fontawesome v1.9.0 h1:xqUB8AnezMHAt8lye4ksqvmHSVPCOkiHsHGUbqNoeP0=
|
||||
github.com/gethinode/mod-fontawesome v1.9.0/go.mod h1:xBKsZH3WJtMOItZVlp9SbO51uaBy6IbvUZSKpNu3b6Y=
|
||||
github.com/gethinode/mod-katex v1.0.0 h1:me/3dIIZBkfk1mRIFt8QiAGYwYDoSG5bc2hHRtIutFc=
|
||||
github.com/gethinode/mod-katex v1.0.0/go.mod h1:byAfpI3wuqNJIooTGVEGc1cjBhhCy4+CcK1H6495MYg=
|
||||
github.com/gethinode/mod-katex v1.0.1 h1:809QUztxmKgMNchU+v03iMO7Ma+ISc3ZzhXYauc21rs=
|
||||
@@ -120,6 +126,8 @@ github.com/gethinode/mod-katex v1.0.8 h1:tFGFz/JIEogCz4wvUsUncrOsOupPxsjP+TwU/3N
|
||||
github.com/gethinode/mod-katex v1.0.8/go.mod h1:byAfpI3wuqNJIooTGVEGc1cjBhhCy4+CcK1H6495MYg=
|
||||
github.com/gethinode/mod-katex v1.0.9 h1:cCJoR28tZwkDvXps17o9Jwfe3aQQAZ3Rxk0jCNRQdbU=
|
||||
github.com/gethinode/mod-katex v1.0.9/go.mod h1:byAfpI3wuqNJIooTGVEGc1cjBhhCy4+CcK1H6495MYg=
|
||||
github.com/gethinode/mod-katex v1.1.0 h1:PxST3HPUt6F2X/xKakTVeTkwWqCtEr53K1vYEOyQu3I=
|
||||
github.com/gethinode/mod-katex v1.1.0/go.mod h1:byAfpI3wuqNJIooTGVEGc1cjBhhCy4+CcK1H6495MYg=
|
||||
github.com/gethinode/mod-leaflet v0.2.3 h1:QQI4h+IH0jZ7fx4q0um2YIEiYBoW3OAfW8qHzbRCDPk=
|
||||
github.com/gethinode/mod-leaflet v0.2.3/go.mod h1:uGggt87x4Fw7wBoJpSiUvNkYg+s/Ujne7klAX2rxMRk=
|
||||
github.com/gethinode/mod-leaflet v0.3.1 h1:H5MaOa+BB1KuVw7abTqfIn/SNzzRsAyx/WQoSe+2Ykc=
|
||||
@@ -136,6 +144,8 @@ github.com/gethinode/mod-leaflet v1.0.0 h1:HdnWafOGkkK1hYGfqLYF3pp9dAFS/caxlzML9
|
||||
github.com/gethinode/mod-leaflet v1.0.0/go.mod h1:Ei0x9WiL7Dbi4JeG6yI1CE63bT1QJ8sKi67Jea1wFSE=
|
||||
github.com/gethinode/mod-leaflet v1.0.1 h1:L4Coe6HTD9O0Txs1S8AtVg+6/TEneSF9i6fJK8jdWUw=
|
||||
github.com/gethinode/mod-leaflet v1.0.1/go.mod h1:Ei0x9WiL7Dbi4JeG6yI1CE63bT1QJ8sKi67Jea1wFSE=
|
||||
github.com/gethinode/mod-leaflet v1.1.0 h1:FXzPCic5XmUluxQ6e7LYUhhLnxuQOBwry8qjG9k30UY=
|
||||
github.com/gethinode/mod-leaflet v1.1.0/go.mod h1:Ei0x9WiL7Dbi4JeG6yI1CE63bT1QJ8sKi67Jea1wFSE=
|
||||
github.com/gethinode/mod-lottie v1.0.0 h1:1CUZMcgN5FAyjjyuP3qkaOQ6M5sv6HUAbosW4sIT5VE=
|
||||
github.com/gethinode/mod-lottie v1.0.0/go.mod h1:erRCgSL2FCfKHI0jQbSpM+g0jXl7SjKVJrh7kWGteKs=
|
||||
github.com/gethinode/mod-lottie v1.0.1 h1:+IE7xtnSVQpJS56oBJq9RWKZeFEfxrOZAqE3BSrS/u0=
|
||||
@@ -160,6 +170,16 @@ github.com/gethinode/mod-lottie v1.4.4 h1:Lv7J+lAMx++aK9h0L7vAgsjyOZgrjux4xPz4Tp
|
||||
github.com/gethinode/mod-lottie v1.4.4/go.mod h1:7tsZjlFgMlj2iWBIS9uOtHHsCrfx9W7S8OsBrZeSVGU=
|
||||
github.com/gethinode/mod-lottie v1.4.6 h1:L6zvfbq+FQUWTG3X/wWFCvb91WOxJuIkJUlZOd+QJ1Q=
|
||||
github.com/gethinode/mod-lottie v1.4.6/go.mod h1:1/+7U/Q5IuaqkzTrvXK1CnPE7ANnTRsG5k+KaXQUQwE=
|
||||
github.com/gethinode/mod-lottie v1.4.7 h1:5Hes0xY/l8ygzJ8YQIzdqCmvGrDQs8D8qZ/vR1fQh/Q=
|
||||
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/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-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.1 h1:jhZGlGFHHL1f5HXbBMXfiZ2gCz4TVafAzjnRPTIBSEE=
|
||||
@@ -184,6 +204,20 @@ github.com/gethinode/mod-utils/v2 v2.1.1 h1:aLBcS9Zbx+dqnu5oBsTM01AkkN5nwwifgbV4
|
||||
github.com/gethinode/mod-utils/v2 v2.1.1/go.mod h1:GTYeknoLujNjfDxI+V9Dcug26CYJSTJ0B/U2dagw9oY=
|
||||
github.com/gethinode/mod-utils/v2 v2.2.2 h1:ZRxWIJKmZIDYsoMS3WhxxC+BWJrkd1dcZ8rz/cLZExc=
|
||||
github.com/gethinode/mod-utils/v2 v2.2.2/go.mod h1:GTYeknoLujNjfDxI+V9Dcug26CYJSTJ0B/U2dagw9oY=
|
||||
github.com/gethinode/mod-utils/v2 v2.3.0 h1:e3uhlAGasvXe+cgvcmzRe05Zo4UEx86uk0TbnxtyB6U=
|
||||
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/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/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-20240108021025-afd75f742f22 h1:re7L8FxbXQpnX8BgzkdUnDpsUmloGNyLmiy2ZCln8pg=
|
||||
|
@@ -11,6 +11,7 @@
|
||||
"html",
|
||||
"img",
|
||||
"input",
|
||||
"label",
|
||||
"li",
|
||||
"link",
|
||||
"meta",
|
||||
@@ -31,6 +32,7 @@
|
||||
"align-items-center",
|
||||
"align-self-center",
|
||||
"align-self-end",
|
||||
"ball",
|
||||
"bg-body",
|
||||
"bg-opacity-10",
|
||||
"bg-primary",
|
||||
@@ -41,6 +43,7 @@
|
||||
"btn",
|
||||
"btn-close",
|
||||
"btn-primary",
|
||||
"checkbox",
|
||||
"col",
|
||||
"col-12",
|
||||
"col-6",
|
||||
@@ -57,22 +60,15 @@
|
||||
"d-flex",
|
||||
"d-inline",
|
||||
"d-md-block",
|
||||
"d-md-none",
|
||||
"d-none",
|
||||
"display-1",
|
||||
"display-4",
|
||||
"dropdown",
|
||||
"dropdown-item",
|
||||
"dropdown-menu",
|
||||
"dropdown-menu-end",
|
||||
"dropdown-toggle",
|
||||
"emphasis",
|
||||
"end-0",
|
||||
"fa",
|
||||
"fa-10x",
|
||||
"fa-2x",
|
||||
"fa-book-open",
|
||||
"fa-circle-half-stroke",
|
||||
"fa-ellipsis",
|
||||
"fa-face-frown",
|
||||
"fa-fw",
|
||||
@@ -100,6 +96,7 @@
|
||||
"justify-content-center",
|
||||
"justify-content-end",
|
||||
"justify-content-start",
|
||||
"label",
|
||||
"link-bg-footer",
|
||||
"link-secondary",
|
||||
"main-content",
|
||||
@@ -107,6 +104,7 @@
|
||||
"me-auto",
|
||||
"middle-bar",
|
||||
"min-vh-100",
|
||||
"mode-switch",
|
||||
"ms-auto",
|
||||
"ms-md-3",
|
||||
"mt-3",
|
||||
@@ -123,6 +121,7 @@
|
||||
"navbar-container",
|
||||
"navbar-expand-md",
|
||||
"navbar-fixed-top",
|
||||
"navbar-mode-selector",
|
||||
"navbar-nav",
|
||||
"navbar-toggler",
|
||||
"no-js",
|
||||
@@ -156,15 +155,12 @@
|
||||
"search-suggestions",
|
||||
"shadow",
|
||||
"svg-inline--fa",
|
||||
"switch-mode-collapsed",
|
||||
"text-center",
|
||||
"text-decoration-none",
|
||||
"text-muted",
|
||||
"text-secondary",
|
||||
"text-sm-start",
|
||||
"text-start",
|
||||
"theme-icon",
|
||||
"theme-icon-active",
|
||||
"toast",
|
||||
"toast-body",
|
||||
"toast-container",
|
||||
@@ -173,9 +169,9 @@
|
||||
"top-bar"
|
||||
],
|
||||
"ids": [
|
||||
"-theme",
|
||||
"-theme-collapsed",
|
||||
"navbar-0-collapse",
|
||||
"navbar-mode",
|
||||
"navbar-mode-checkbox",
|
||||
"toast-container",
|
||||
"toast-copied-code-message"
|
||||
]
|
||||
|
@@ -1,4 +1,5 @@
|
||||
{{ define "main" }}
|
||||
{{ $base := partial "utilities/GetStaticURL" (dict "url" "/") }}
|
||||
<div class="d-flex flex-fill">
|
||||
<div class="container-xxl my-auto">
|
||||
<div class="text-center">
|
||||
@@ -7,7 +8,7 @@
|
||||
<p class="display-1 mt-3 fw-bold">404</p>
|
||||
<p class="fs-3">{{ T "pageNotFoundTitle" }}</p>
|
||||
</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>
|
||||
</div>
|
||||
</div>
|
||||
|
@@ -13,10 +13,9 @@
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- /* Validate module configuration */ -}}
|
||||
{{- 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 -}}
|
||||
{{- /* Initialize module configuration */ -}}
|
||||
{{- $modules := partial "utilities/InitModules.html" (dict "page" .) -}}
|
||||
{{- $.Scratch.Set "modules" $modules -}}
|
||||
|
||||
{{- $fullCover := or (or (and .IsHome .Site.Params.home.fullCover) .Page.Params.fullCover) .Site.Params.main.footerBelowFold }}
|
||||
{{- $.Scratch.Set "fullCover" $fullCover -}}
|
||||
@@ -30,6 +29,10 @@
|
||||
{{- /* Define main breakpoint */ -}}
|
||||
{{- $.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>
|
||||
<html lang="{{ .Site.Language.Lang }}" class="no-js">
|
||||
<head>
|
||||
|
@@ -32,7 +32,7 @@
|
||||
<div class="d-none-dark">
|
||||
<div class="hstack gap-1">
|
||||
{{ 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") }}
|
||||
{{ end -}}
|
||||
</div>
|
||||
@@ -41,7 +41,7 @@
|
||||
<div class="d-none-light">
|
||||
<div class="hstack gap-1">
|
||||
{{ 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") }}
|
||||
{{ end -}}
|
||||
</div>
|
||||
|
@@ -1,11 +1,12 @@
|
||||
{{ $lang := site.LanguageCode | default site.Language.Lang }}
|
||||
<!DOCTYPE html>
|
||||
<html{{ with site.LanguageCode | default site.Language.Lang }} lang="{{ . }}"{{ end }}>
|
||||
<html {{ with $lang }}lang="{{ . }}"{{ end }}>
|
||||
<head>
|
||||
<title>{{ .Permalink }}</title>
|
||||
<link rel="canonical" href="{{ .Permalink }}">
|
||||
<meta name="robots" content="noindex">
|
||||
<meta charset="utf-8">
|
||||
<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>
|
||||
</html>
|
@@ -33,7 +33,7 @@
|
||||
{{ $operation := "" }}
|
||||
{{ if $format }}
|
||||
{{ $operation = printf "%s,h_%d,w_%d" $transform $height $width }}
|
||||
{{ $file = printf "%s.%s" (path.BaseName $file) $format }}
|
||||
{{ $file = printf "%s.%s" (strings.TrimSuffix (path.Ext $file) $file) $format }}
|
||||
{{ else }}
|
||||
{{ $operation = printf "f_auto,%s,h_%d,w_%d" $transform $height $width }}
|
||||
{{ end }}
|
||||
|
@@ -27,7 +27,7 @@
|
||||
{{ $url = urls.JoinPath "https://" $host $url }}
|
||||
{{ end }}
|
||||
|
||||
<!-- Initialize image if needed -->
|
||||
<!-- Initialize image if needed, do not raise additional warnings -->
|
||||
{{ $format := .format | default "webp" }}
|
||||
{{ if and (not $img) (ne $format "svg") }}
|
||||
{{- $res := partial "utilities/GetImage.html" (dict "url" $url "page" page) -}}
|
||||
@@ -37,7 +37,6 @@
|
||||
{{ end }}
|
||||
|
||||
{{ if not $img }}
|
||||
{{ errorf "partial [assets/adapter/hugo.html] - Expected 'img' argument" -}}
|
||||
{{ $error = true }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
30
layouts/partials/assets/adapters/imagekit-rewrite.html
Normal file
30
layouts/partials/assets/adapters/imagekit-rewrite.html
Normal 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 }}
|
48
layouts/partials/assets/adapters/imagekit.html
Normal file
48
layouts/partials/assets/adapters/imagekit.html
Normal file
@@ -0,0 +1,48 @@
|
||||
<!--
|
||||
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" "args" . "group" "partial") }}
|
||||
{{ errorf "partial [assets/adapter/imagekit.html] - Invalid arguments" -}}
|
||||
{{ $error = true }}
|
||||
{{ end }}
|
||||
|
||||
<!-- Initialize arguments -->
|
||||
{{ $host := .host }}
|
||||
{{ $dir := .dir }}
|
||||
{{ $file := .file }}
|
||||
{{ $format := .format }}
|
||||
{{ $transform := .transform }}
|
||||
{{ $height := .height }}
|
||||
{{ $width := .width }}
|
||||
{{ if eq $transform "fill" }}{{ $transform = "c-maintain_ratio" }}{{ else }}{{ $transform = "c-at_max" }}{{ end }}
|
||||
{{ $element := "" }}
|
||||
|
||||
<!-- Validate image format is supported -->
|
||||
{{ if and $format (not (in (slice "jpg" "jpeg" "webp" "avif" "png") $format)) }}
|
||||
{{ warnf "Image format not supported by ImageKit.io: %s.%s" (path.BaseName $file) $format }}
|
||||
{{ $format = "jpg" }}
|
||||
{{ end }}
|
||||
|
||||
<!-- Split path between end point and image path -->
|
||||
{{ $newdir := printf "/%s" (index (split $dir "/") 1) }}
|
||||
{{ $file = urls.JoinPath (strings.TrimPrefix $newdir $dir) $file }}
|
||||
{{ $dir = $newdir }}
|
||||
|
||||
<!-- Generate image URL -->
|
||||
{{ if not $error }}
|
||||
{{ $operation := "" }}
|
||||
{{ if $format }}
|
||||
{{ $operation = printf "tr:f-%s,%s,h-%d,w-%d" $format $transform $height $width }}
|
||||
{{ else }}
|
||||
{{ $operation = printf "tr:f-auto,%s,h-%d,w-%d" $transform $height $width }}
|
||||
{{ end }}
|
||||
{{- $element = urls.JoinPath (slice "https://" $host $dir $operation $file) -}}
|
||||
{{ end }}
|
||||
|
||||
{{ return $element }}
|
43
layouts/partials/assets/adapters/imgix.html
Normal file
43
layouts/partials/assets/adapters/imgix.html
Normal file
@@ -0,0 +1,43 @@
|
||||
<!--
|
||||
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" "args" . "group" "partial") }}
|
||||
{{ errorf "partial [assets/adapter/imgix.html] - Invalid arguments" -}}
|
||||
{{ $error = true }}
|
||||
{{ end }}
|
||||
|
||||
<!-- Initialize arguments -->
|
||||
{{ $host := .host }}
|
||||
{{ $dir := .dir }}
|
||||
{{ $file := .file }}
|
||||
{{ $format := .format }}
|
||||
{{ $transform := .transform }}
|
||||
{{ $height := .height }}
|
||||
{{ $width := .width }}
|
||||
{{ if eq $transform "fill" }}{{ $transform = "crop" }}{{ else }}{{ $transform = "max" }}{{ end }}
|
||||
{{ $element := "" }}
|
||||
|
||||
<!-- Validate image format is supported -->
|
||||
{{ if and $format (not (in (slice "avif" "gif" "jp2" "jpg" "json" "jxr" "pjpg" "mp4" "png" "png8" "png32" "webm" "webp" "blurhash") $format)) }}
|
||||
{{ warnf "Image format not supported by imgix: %s.%s" (path.BaseName $file) $format }}
|
||||
{{ $format = "jpg" }}
|
||||
{{ end }}
|
||||
|
||||
<!-- Generate image URL -->
|
||||
{{ if not $error }}
|
||||
{{ $operation := "" }}
|
||||
{{ if $format }}
|
||||
{{ $operation = printf "fm=%s&fit=%s&h=%d&w=%d" $format $transform $height $width }}
|
||||
{{ else }}
|
||||
{{ $operation = printf "f_auto&fit=%s&h=%d&w=%d" $transform $height $width }}
|
||||
{{ end }}
|
||||
{{- $element = printf "%s?%s" (urls.JoinPath (slice "https://" $host $dir $file)) $operation -}}
|
||||
{{ end }}
|
||||
|
||||
{{ return $element }}
|
@@ -22,7 +22,7 @@
|
||||
{{- range $index, $item := $page.Ancestors.Reverse -}}
|
||||
{{- $title := .LinkTitle -}}
|
||||
{{- if .IsHome }}{{ $title = T "home" }}{{ end -}}
|
||||
{{- $address := or .RelPermalink (.Params.Redirect | relLangURL) -}}
|
||||
{{- $address := or .RelPermalink .Params.Redirect -}}
|
||||
{{ if $address }}
|
||||
<li class="breadcrumb-item"><a href="{{ $address }}">{{ $title }}</a></li>
|
||||
{{ else }}
|
||||
|
@@ -119,7 +119,7 @@
|
||||
|
||||
{{- range $index, $tag := first $maxTags ($page.GetTerms "tags") -}}
|
||||
{{- if gt $index 0 }} • {{ 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 -}}
|
||||
</small></p>
|
||||
{{- end -}}
|
||||
|
@@ -3,11 +3,23 @@
|
||||
-->
|
||||
|
||||
{{ $ratio := .ratio }}
|
||||
|
||||
{{ $dim := "" }}
|
||||
{{ $matches := first 1 (where site.Data.dimensions "ratio" $ratio) }}
|
||||
{{ if eq ($matches | len) 1 }}
|
||||
{{ $dim = (index $matches 0).dimensions }}
|
||||
{{ $default := dict "4x3" "1400x1050" "3x2" "1400x933" "1x1" "1400x1400" "16x9" "1400x788" "21x9" "1400x600" "auto" "1400" }}
|
||||
|
||||
<!-- Initialize dimensions data - stripping unsupported file extension -->
|
||||
{{ $config := "dimensions" }}
|
||||
{{ with index site.Params "dam" }}{{ with index . "dimensions" }}{{ $config = . }}{{ end }}{{ end }}
|
||||
{{ $config = path.Join (path.Dir $config) (path.BaseName $config) }}
|
||||
|
||||
{{ with index site.Data $config }}
|
||||
{{ $matches := first 1 (where . "ratio" $ratio) }}
|
||||
{{ if eq ($matches | len) 1 }}
|
||||
{{ $dim = (index $matches 0).dimensions }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
||||
{{ if not $dim }}
|
||||
{{ $dim = slice (index $default $ratio) }}
|
||||
{{ end }}
|
||||
|
||||
{{ return $dim }}
|
||||
|
@@ -14,13 +14,13 @@
|
||||
{{- $url := .url -}}
|
||||
{{- $mode := .mode -}}
|
||||
{{- $modes := .modes -}}
|
||||
{{- $plain := .plain | default false }}
|
||||
|
||||
{{- $fallbackURL := "" -}}
|
||||
{{- $anchor := "" -}}
|
||||
{{- $imgset := "" -}}
|
||||
{{- $isVector := false -}}
|
||||
|
||||
|
||||
<!-- Split url into base and anchor when applicable (only relevant for vector images) -->
|
||||
{{- $segments := split $url "#" -}}
|
||||
{{- if gt (len $segments) 2 -}}
|
||||
@@ -30,11 +30,29 @@
|
||||
{{- $anchor = index $segments 1 -}}
|
||||
{{- end -}}
|
||||
|
||||
<!-- TODO: improve CDN detection / handling -->
|
||||
{{ $hook := "hugo" }}
|
||||
{{ if findRE "cloudinary" (urls.Parse $url).Hostname }}
|
||||
{{ $hook = "cloudinary" }}
|
||||
{{- end -}}
|
||||
<!-- Identify image provider -->
|
||||
{{ $hook := "" }}
|
||||
{{ $account := "" }}
|
||||
{{ $container := "" }}
|
||||
{{ $rewrite := false }}
|
||||
{{ range $provider, $val := site.Params.images }}
|
||||
{{ if not $hook }}
|
||||
{{ with index $val "host" }}
|
||||
{{ if (findRE . (urls.Parse $url).Hostname) }}
|
||||
{{ $hook = $provider }}
|
||||
{{ with index $val "account" }}{{ $account = . }}{{ end }}
|
||||
{{ with index $val "rewrite" }}{{ $rewrite = . }}{{ end }}
|
||||
{{ with index $val "container" }}{{ $container = . }}{{ end }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ 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 -->
|
||||
{{ $dims := slice }}
|
||||
@@ -55,31 +73,35 @@
|
||||
{{ $transform = "fill" }}
|
||||
{{ $dims = partial "assets/helpers/GetDimension.html" (dict "ratio" $ratio) }}
|
||||
{{ if not $dims }}{{ errorf "partial [assets/image.html] - Cannot find dimension data: %s" $ratio }}{{ end }}
|
||||
{{ else }}
|
||||
{{ else if not $plain }}
|
||||
{{ $transform = "fit" }}
|
||||
{{- $res := partial "utilities/GetImage.html" (dict "url" $url "page" $page) -}}
|
||||
{{ with $res }}
|
||||
{{ if and $res $res.resource }}
|
||||
{{ $img = $res.resource }}
|
||||
{{ if $res.mirror }}{{ $class = printf "%s mirrorred" $class }}{{ end }}
|
||||
{{ end }}
|
||||
|
||||
{{ $widths := partial "assets/helpers/GetDimension.html" (dict "ratio" "auto") }}
|
||||
{{ range $width := $widths -}}
|
||||
{{- $dims = $dims | append (printf "%sx%d" $width (int (math.Round (mul (div (float $width) $img.Width) $img.Height)))) -}}
|
||||
{{- end -}}
|
||||
{{ $widths := partial "assets/helpers/GetDimension.html" (dict "ratio" "auto") }}
|
||||
{{ range $width := $widths -}}
|
||||
{{- $dims = $dims | append (printf "%dx%d" (int $width) (int (math.Round (mul (div (float $width) $img.Width) $img.Height)))) -}}
|
||||
{{- end -}}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
||||
<!-- Derive image width and height -->
|
||||
{{ $width := "" }}
|
||||
{{ $height := "" }}
|
||||
{{ range $dim := ($dims | last 1) }}
|
||||
{{ $width = (int (index (split $dim "x") 0)) }}
|
||||
{{ $height = (int (index (split $dim "x") 1)) }}
|
||||
{{ if not $plain }}
|
||||
{{ with $dims }}
|
||||
{{ range $dim := (. | last 1) }}
|
||||
{{ $width = (int (index (split $dim "x") 0)) }}
|
||||
{{ $height = (int (index (split $dim "x") 1)) }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
||||
<!-- Generate image urls -->
|
||||
{{ if hasSuffix $url "svg" }}
|
||||
{{- $fallbackURL = $url -}}
|
||||
{{ if or (hasSuffix $url "svg") $plain }}
|
||||
{{- $fallbackURL = partial "utilities/GetStaticURL" (dict "url" $url) -}}
|
||||
{{ 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) -}}
|
||||
{{- $imgset = partial "assets/helpers/image-set.html" (dict "url" $url "img" $img "dims" $dims "transform" $transform "hook" $hook) -}}
|
||||
|
29
layouts/partials/assets/helpers/image-rewrite.html
Normal file
29
layouts/partials/assets/helpers/image-rewrite.html
Normal 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 }}
|
@@ -13,12 +13,19 @@
|
||||
{{ $file := index ((split $dir "/") | collections.Reverse) 0 }}
|
||||
{{ $dir = strings.TrimSuffix $file $dir }}
|
||||
|
||||
{{ $adapter := (printf "assets/adapters/%s.html" $hook) }}
|
||||
{{ if not (fileExists (path.Join "/layouts/partials" $adapter)) }}
|
||||
{{ warnf "Cannot find adapter: %s" (path.Join "/layouts/partials" $adapter) }}
|
||||
{{ $hook = "hugo" }}
|
||||
{{ $adapter = "assets/adapters/hugo.html" }}
|
||||
{{ end }}
|
||||
|
||||
{{ $imgset := slice }}
|
||||
{{- range $index, $dim := $dims -}}
|
||||
{{ $width := (int (index (split $dim "x") 0)) }}
|
||||
{{ $height := (int (index (split $dim "x") 1)) }}
|
||||
|
||||
{{- $element := partial (printf "assets/adapters/%s.html" $hook) (dict
|
||||
{{- $element := partial $adapter (dict
|
||||
"host" $host
|
||||
"dir" $dir
|
||||
"file" $file
|
||||
|
@@ -26,6 +26,7 @@
|
||||
{{- $priority := .priority -}}
|
||||
{{- if eq $priority "auto" }}{{ $priority = "" }}{{ end -}}
|
||||
{{- $sizes := .sizes | default "100vw" -}}
|
||||
{{- $plain := .plain | default false -}}
|
||||
|
||||
{{- $absoluteURL := site.Params.main.canonifyAssetsURLs | default false -}}
|
||||
{{- $url := .url -}}
|
||||
@@ -47,28 +48,29 @@
|
||||
"priority" $priority
|
||||
"sizes" $sizes
|
||||
"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 }}
|
||||
{{- 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 }}
|
@@ -19,9 +19,10 @@
|
||||
{{- $class := .class -}}
|
||||
{{- $cue := .cue | default site.Params.main.externalLinks.cue -}}
|
||||
{{- $tab := .tab | default site.Params.main.externalLinks.tab -}}
|
||||
{{- $baseURL := $page.Scratch.Get "baseURL" -}}
|
||||
|
||||
{{- $menuURL := (or $menu.PageRef $menu.URL) | relLangURL -}}
|
||||
{{- $pageURL := $page.RelPermalink | relLangURL -}}
|
||||
{{- $menuURL := urls.JoinPath $baseURL ((or $menu.PageRef $menu.URL) | relLangURL) -}}
|
||||
{{- $pageURL := $page.RelPermalink -}}
|
||||
{{- $isActive := or (and (hasPrefix $pageURL $menuURL) (ne $menuURL ("/" | relLangURL))) (eq $pageURL $menuURL) -}}
|
||||
{{- $isAlias := $menu.Params.alias -}}
|
||||
{{- $isIcon := $menu.Params.icon -}}
|
||||
|
@@ -16,36 +16,16 @@
|
||||
|
||||
<!-- Inline partial to render the color mode switcher -->
|
||||
{{- define "partials/navbar-mode.html" -}}
|
||||
{{- $size := .size -}}
|
||||
{{- $collapsed := .collapsed -}}
|
||||
{{- $id := .id -}}
|
||||
{{- $id := .id | default "navbar-mode" -}}
|
||||
|
||||
<li class="nav-item dropdown {{ if $collapsed }}d-{{ $size }}-none{{ else }}d-none d-{{ $size }}-block{{ end }}">
|
||||
<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 }}">
|
||||
<span class="theme-icon-active">{{- partial "assets/icon.html" (dict "icon" "fas sun fa-fw") }}</span>{{ if $collapsed }} {{ T "colorMode" }}{{ end }}
|
||||
<span class="d-md-none"></span>
|
||||
</a>
|
||||
<ul class="dropdown-menu dropdown-menu-end" aria-labelledby="{{ $id }}-theme{{ if $collapsed }}-collapsed{{ end }}">
|
||||
<li>
|
||||
<a class="dropdown-item{{ if $collapsed }} switch-mode-collapsed{{ end }}" data-bs-theme-value="light" href="#!">
|
||||
<span class="theme-icon">{{- partial "assets/icon.html" (dict "icon" "fas sun fa-fw" "spacing" false) }}</span>
|
||||
{{- 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>
|
||||
{{- 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>
|
||||
{{- T "colorAuto" }}
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<div class="d-flex mode-switch align-items-center" id="{{ $id }}">
|
||||
<input type="checkbox" class="checkbox navbar-mode-selector" id="{{ $id }}-checkbox" />
|
||||
<label class="label" for="{{ $id }}-checkbox">
|
||||
{{- partial "assets/icon.html" (dict "icon" "fas sun fa-fw" "spacing" false) }}
|
||||
{{- partial "assets/icon.html" (dict "icon" "fas moon fa-fw" "spacing" false) }}
|
||||
<div class="ball"></div>
|
||||
</label>
|
||||
</div>
|
||||
{{- end -}}
|
||||
|
||||
<!-- Inline partial to render the version switcher -->
|
||||
@@ -53,6 +33,7 @@
|
||||
{{- $size := .size -}}
|
||||
{{- $collapsed := .collapsed -}}
|
||||
{{- $page := .page -}}
|
||||
{{- $baseURL := .baseURL -}}
|
||||
{{- $list := site.Params.docs.releases -}}
|
||||
{{- $id := .id -}}
|
||||
{{- $version := partial "utilities/GetVersion.html" (dict "page" $page) -}}
|
||||
@@ -70,7 +51,7 @@
|
||||
{{- end -}}
|
||||
{{ if $item.url }}
|
||||
<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 }}
|
||||
{{ if $item.latest }} ({{ T "latest" }}){{ end }}
|
||||
{{ if $active }}
|
||||
@@ -86,7 +67,7 @@
|
||||
{{- if site.Params.docs.overview -}}
|
||||
{{ if gt (len $list) 0 }}<li><hr class="dropdown-divider"></li>{{ end }}
|
||||
<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>
|
||||
</li>
|
||||
{{- end -}}
|
||||
@@ -98,6 +79,7 @@
|
||||
{{- $absoluteURL := site.Params.main.canonifyAssetsURLs | default false -}}
|
||||
{{- $id := .id | default (printf "navbar-%d" 0) -}}
|
||||
{{- $page := .page -}}
|
||||
{{- $baseURL := $page.Scratch.Get "baseURL" -}}
|
||||
|
||||
{{- $defaultMenu := "main" -}}
|
||||
{{- $menuName := .menus | default $defaultMenu }}
|
||||
@@ -117,6 +99,7 @@
|
||||
{{- $search := .search | default site.Params.navigation.search -}}
|
||||
{{- $searchModal := and $search site.Params.navigation.searchModal -}}
|
||||
{{- $enableDarkMode := .mode | default site.Params.main.enableDarkMode -}}
|
||||
{{- $modes := site.Params.main.modes | default (slice "light" "dark") -}}
|
||||
|
||||
{{- $enableVersions := false -}}
|
||||
{{ $list := site.Params.docs.releases }}
|
||||
@@ -132,8 +115,15 @@
|
||||
{{- $logoDark := "" -}}
|
||||
{{- if $enableDarkMode -}}
|
||||
{{ $ext := path.Ext $logo -}}
|
||||
{{- $logoLight = printf "%s-light%s" (strings.TrimSuffix $ext $logo) $ext -}}
|
||||
{{- $logoDark = printf "%s-dark%s" (strings.TrimSuffix $ext $logo) $ext -}}
|
||||
{{- $ext := path.Ext $logo -}}
|
||||
{{- $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) -}}
|
||||
{{- $dark := fileExists (path.Join "/static" $logoDark) -}}
|
||||
{{- if and $light (not $dark) -}}
|
||||
@@ -152,6 +142,10 @@
|
||||
{{- 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 -}}
|
||||
{{- if .title -}}
|
||||
{{- $title = .title -}}
|
||||
@@ -255,8 +249,8 @@
|
||||
|
||||
<!-- Insert version switcher -->
|
||||
{{- 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" false "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 "baseURL" $baseURL) -}}
|
||||
{{- end -}}
|
||||
|
||||
<!-- Insert language switcher if applicable -->
|
||||
@@ -276,7 +270,7 @@
|
||||
{{- end -}}
|
||||
{{- else -}}
|
||||
{{- 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 -}}
|
||||
</ul>
|
||||
@@ -286,7 +280,6 @@
|
||||
<!-- Insert color mode switcher -->
|
||||
{{- if $enableDarkMode -}}
|
||||
{{- 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 -}}
|
||||
|
||||
<!-- Insert modal search button -->
|
||||
|
@@ -26,8 +26,8 @@
|
||||
{{- $group := .group -}}
|
||||
{{- $data := .menu -}}
|
||||
|
||||
{{- $doc_slug := $group.title | urlize -}}
|
||||
{{- $href := or $group.link (printf "%s/" (relLangURL (path.Join $baseURL $doc_slug))) -}}
|
||||
{{- $doc_slug := urls.JoinPath $baseURL ($group.title | urlize) -}}
|
||||
{{- $href := or $group.link (partial "utilities/GetStaticURL" (dict "url" $doc_slug)) -}}
|
||||
{{- $collapsed := strings.HasPrefix $page.RelPermalink $href -}}
|
||||
|
||||
<li class="mb-1">
|
||||
@@ -71,11 +71,14 @@
|
||||
{{- $level := .level -}}
|
||||
{{- $baseURL := .baseURL -}}
|
||||
{{- $title := .title -}}
|
||||
{{- $href := .href -}}
|
||||
{{- $data := .menu -}}
|
||||
{{ $href := "" }}
|
||||
|
||||
{{- $doc_slug := $title | urlize -}}
|
||||
{{- $href := or $href (printf "%s/" (relLangURL (path.Join $baseURL $doc_slug))) -}}
|
||||
{{ with .href }}
|
||||
{{- $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) -}}
|
||||
|
||||
{{ if eq $level 0}}
|
||||
|
@@ -5,19 +5,24 @@
|
||||
{{ $page_modules = $page_modules | append .Params.modules }}
|
||||
{{ end }}
|
||||
|
||||
{{- $modules := site.Params.modules.optional | intersect $page_modules -}}
|
||||
{{ $config := page.Scratch.Get "modules" }}
|
||||
{{ if not $config }}
|
||||
{{ errorf "partial [footer/optional-scripts.html] - Cannot initialize module configuration" }}
|
||||
{{ end }}
|
||||
|
||||
{{- $modules := $config.optional | intersect $page_modules -}}
|
||||
{{- range $index, $mod := $modules -}}
|
||||
{{- $filename := printf "js/%s.bundle.js" $mod -}}
|
||||
{{- $match := printf "js/modules/%s/**.js" $mod -}}
|
||||
{{- $skipTemplate := false -}}
|
||||
{{- if reflect.IsSlice site.Params.modules.disableTemplate -}}
|
||||
{{- if in site.Params.modules.disableTemplate $mod}}
|
||||
{{- if reflect.IsSlice $config.disableTemplate -}}
|
||||
{{- if in $config.disableTemplate $mod}}
|
||||
{{- $skipTemplate = true -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{ $state := "" }}
|
||||
{{- with (index site.Params.modules $mod) -}}
|
||||
{{- with (index $config.modules $mod) -}}
|
||||
{{- with index . "state" }}{{ $state = . }}{{ end -}}
|
||||
{{- end -}}
|
||||
|
||||
|
@@ -14,9 +14,14 @@
|
||||
{{- errorf "partial [footer/script.html] - Invalid value for param 'processing': %s" $state -}}
|
||||
{{- end -}}
|
||||
|
||||
{{ $config := page.Scratch.Get "modules" }}
|
||||
{{ if not $config }}
|
||||
{{ errorf "partial [footer/scripts.html] - Cannot initialize module configuration" }}
|
||||
{{ end }}
|
||||
|
||||
{{- $modules := "" -}}
|
||||
{{ if $core }}
|
||||
{{- $modules = site.Params.modules.core -}}
|
||||
{{- $modules = $config.core -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- $bundle := partial "utilities/bundle" (dict "match" $match "filename" $filename "modules" $modules "basepath" "js/modules" "all" true "debugging" site.Params.debugging.showJS) -}}
|
||||
|
@@ -7,8 +7,14 @@
|
||||
<meta name="theme" content="{{ printf "Hinode %s" $version }}">
|
||||
{{ partialCached "head/stylesheet-core.html" . -}}
|
||||
|
||||
|
||||
{{ $config := page.Scratch.Get "modules" }}
|
||||
{{ if not $config }}
|
||||
{{ errorf "partial [head/head.html] - Cannot initialize module configuration" }}
|
||||
{{ end }}
|
||||
|
||||
{{ $page_modules := slice | append .Page.Params.modules }}
|
||||
{{- $modules := site.Params.modules.optional | intersect $page_modules -}}
|
||||
{{- $modules := $config.optional | intersect $page_modules -}}
|
||||
{{- range $index, $mod := $modules -}}
|
||||
{{- $source := printf "scss/%s.scss" $mod -}}
|
||||
{{- $target := printf "css/%s.css" $mod -}}
|
||||
@@ -19,7 +25,7 @@
|
||||
<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" }}">
|
||||
{{ 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>
|
||||
{{- end -}}
|
||||
{{ partial "head/seo.html" . }}
|
||||
|
@@ -35,7 +35,9 @@
|
||||
{{- end }}
|
||||
{{- end -}}
|
||||
|
||||
{{ $base := partial "utilities/GetStaticURL" (dict "url" "/") }}
|
||||
{{- range resources.Match "icons/**.svg" -}}
|
||||
{{- $icon := . | resources.ExecuteAsTemplate .RelPermalink $params -}}
|
||||
{{- $target := strings.TrimPrefix $base .RelPermalink -}}
|
||||
{{- $icon := . | resources.ExecuteAsTemplate $target $params -}}
|
||||
{{- $icon.Publish -}}
|
||||
{{- end -}}
|
@@ -14,11 +14,16 @@
|
||||
{{- $core := .core | default true -}}
|
||||
|
||||
{{- $modules := "" -}}
|
||||
{{ $config := page.Scratch.Get "modules" }}
|
||||
{{ if not $config }}
|
||||
{{ errorf "partial [head/stylesheet.html] - Cannot initialize module configuration" }}
|
||||
{{ end }}
|
||||
|
||||
{{ if $core }}
|
||||
{{- if reflect.IsSlice site.Params.modules.excludeSCSS -}}
|
||||
{{- $modules = complement site.Params.modules.excludeSCSS (or site.Params.modules.core slice) -}}
|
||||
{{- if reflect.IsSlice $config.excludeSCSS -}}
|
||||
{{- $modules = complement $config.excludeSCSS (or $config.core slice) -}}
|
||||
{{ else }}
|
||||
{{- $modules = site.Params.modules.core -}}
|
||||
{{- $modules = $config.core -}}
|
||||
{{ end }}
|
||||
{{- end -}}
|
||||
|
||||
@@ -35,6 +40,7 @@
|
||||
{{- $overlayOffset := $navbarOffset -}}
|
||||
{{- if site.Params.navigation.overlay }}{{ $overlayOffset = "0rem" }}{{ end }}
|
||||
{{- $vars := dict
|
||||
"base-url" (page.Scratch.Get "baseURL" | default "/")
|
||||
"theme-font" (default "Inter" site.Params.style.themeFont)
|
||||
"font-size-base" (default "1rem" site.Params.style.fontSizeBase)
|
||||
"primary" (default "#007bff" site.Params.style.primary)
|
||||
|
52
layouts/partials/utilities/InitModules.html
Normal file
52
layouts/partials/utilities/InitModules.html
Normal file
@@ -0,0 +1,52 @@
|
||||
{{ $page := .page }}
|
||||
|
||||
{{ $core := slice }}
|
||||
{{ $optional := slice }}
|
||||
{{ $excludeSCSS := slice }}
|
||||
{{ $disableTemplate := slice }}
|
||||
{{ $modules := dict }}
|
||||
|
||||
{{ range $key, $mod := $page.Site.Params.modules }}
|
||||
{{ if eq $key "core" }}
|
||||
{{ warnf "DEPRECATED: module parameter `core` has been deprecated in release v0.24.0" }}
|
||||
{{ $core = $core | append $mod }}
|
||||
{{ else if eq $key "optional" }}
|
||||
{{ warnf "DEPRECATED: module parameter `optional` has been deprecated in release v0.24.0" }}
|
||||
{{ $optional = $optional | append $mod }}
|
||||
{{ else if eq $key "excludescss" }}
|
||||
{{ warnf "DEPRECATED: module parameter `excludeSCSS` has been deprecated in release v0.24.0" }}
|
||||
{{ $excludeSCSS = $excludeSCSS | append $mod }}
|
||||
{{ else if eq $key "disabletemplate" }}
|
||||
{{ warnf "DEPRECATED: module parameter `disableTemplate` has been deprecated in release v0.24.0" }}
|
||||
{{ $disableTemplate = $disableTemplate | append $mod }}
|
||||
{{ else if reflect.IsMap $mod }}
|
||||
{{ $integration := index $mod "integration" }}
|
||||
{{ if eq $integration "core" }}
|
||||
{{ $core = $core | append $key }}
|
||||
{{ else if eq $integration "optional" }}
|
||||
{{ $optional = $optional | append $key }}
|
||||
{{ else if $integration }}
|
||||
{{ warnf "Unrecognized module integration setting: %s" $integration }}
|
||||
{{ end }}
|
||||
|
||||
{{ if eq (index $mod "excludeSCSS") true }}
|
||||
{{ $excludeSCSS = $excludeSCSS | append $key }}
|
||||
{{ end }}
|
||||
|
||||
{{ if eq (index $mod "disableTemplate") true }}
|
||||
{{ $disableTemplate = $disableTemplate | append $key }}
|
||||
{{ end }}
|
||||
|
||||
{{ $modules = merge $modules (dict $key $mod) }}
|
||||
{{ else }}
|
||||
{{ warnf "Unsupported module parameter: %s" $key }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
||||
{{ $modules := dict "modules" $modules "core" $core "optional" $optional "excludeSCSS" $excludeSCSS "disableTemplate" $disableTemplate }}
|
||||
|
||||
{{- if and $page.IsPage (not (in $core "bootstrap")) -}}
|
||||
{{- errorf "Bootstrap is a required module, please add it to 'modules.core' in your site parameters" -}}
|
||||
{{- end -}}
|
||||
|
||||
{{ return $modules }}
|
@@ -24,6 +24,7 @@
|
||||
{{- $portrait := false -}}
|
||||
{{- $loading := "" -}}
|
||||
{{- $error := false -}}
|
||||
{{- $plain := false -}}
|
||||
|
||||
{{- if .IsNamedParams -}}
|
||||
{{ $url = .Get "src" | default "" -}}
|
||||
@@ -37,6 +38,7 @@
|
||||
{{ $figclass = .Get "figclass" | default "" -}}
|
||||
{{ with .Get "mode" }}{{ $mode = partial "utilities/CastBool.html" . }}{{ end -}}
|
||||
{{ with .Get "portrait" }}{{ $portrait = partial "utilities/CastBool.html" . }}{{ end -}}
|
||||
{{ with .Get "plain" }}{{ $plain = partial "utilities/CastBool.html" . }}{{ end -}}
|
||||
{{ else -}}
|
||||
{{ $url = .Get 0 }}
|
||||
{{ end -}}
|
||||
@@ -58,6 +60,7 @@
|
||||
"figclass" $figclass
|
||||
"mode" $mode
|
||||
"portrait" $portrait
|
||||
"plain" $plain
|
||||
"loading" $loading
|
||||
"page" .Page)
|
||||
-}}
|
||||
|
@@ -24,7 +24,7 @@
|
||||
{{ .Count }} {{ if gt .Count 1 }} {{ T "articles" }} {{ else }} {{ T "article" }} {{ end }}
|
||||
</div>
|
||||
<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>
|
||||
{{ end }}
|
||||
@@ -48,7 +48,7 @@
|
||||
<p class="text-body-secondary mt-5">{{ $year }}</p>
|
||||
{{ $.Scratch.Set "lastYear" $year }}
|
||||
{{ 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>
|
||||
{{ end }}
|
||||
|
@@ -33,7 +33,7 @@
|
||||
font-src 'self' https://*.netlify.app https://fonts.gstatic.com; \
|
||||
frame-src 'self' https://www.youtube-nocookie.com https://www.youtube.com \
|
||||
app.netlify.com; \
|
||||
img-src 'self' data: https://*.cloudinary.com https://*.netlify.app https://i.vimeocdn.com https://i.ytimg.com https://*.google-analytics.com https://*.googletagmanager.com https://tile.openstreetmap.org; \
|
||||
img-src 'self' data: https://*.imgix.net https://*.imagekit.io https://*.cloudinary.com https://*.netlify.app https://i.vimeocdn.com https://i.ytimg.com https://*.google-analytics.com https://*.googletagmanager.com https://tile.openstreetmap.org; \
|
||||
manifest-src 'self'; \
|
||||
media-src 'self' \
|
||||
"""
|
||||
|
512
package-lock.json
generated
512
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
18
package.json
18
package.json
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@gethinode/hinode",
|
||||
"version": "0.24.0-alpha",
|
||||
"version": "0.24.0-beta11",
|
||||
"description": "Hinode is a clean documentation and blog theme for Hugo, an open-source static site generator",
|
||||
"keywords": [
|
||||
"hugo",
|
||||
@@ -66,28 +66,30 @@
|
||||
"url": "https://github.com/gethinode/hinode/issues"
|
||||
},
|
||||
"homepage": "https://gethinode.com",
|
||||
"devDependencies": {
|
||||
"dependencies": {
|
||||
"@fullhuman/postcss-purgecss": "^6.0.0",
|
||||
"@gethinode/netlify-plugin-dartsass": "^0.3.0",
|
||||
"@netlify/plugin-lighthouse": "^6.0.0",
|
||||
"autoprefixer": "^10.4.19",
|
||||
"cssnano": "^7.0.1",
|
||||
"cssnano-preset-advanced": "^7.0.1",
|
||||
"hugo-bin": "0.123.2",
|
||||
"purgecss-whitelister": "^2.4.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@gethinode/netlify-plugin-dartsass": "^0.3.0",
|
||||
"@netlify/plugin-lighthouse": "^6.0.0",
|
||||
"eslint": "^8.57.0",
|
||||
"eslint-config-standard": "^17.1.0",
|
||||
"eslint-plugin-import": "^2.29.1",
|
||||
"eslint-plugin-n": "^16.6.2",
|
||||
"eslint-plugin-promise": "^6.1.1",
|
||||
"hugo-bin": "0.123.1",
|
||||
"eslint-plugin-promise": "^6.2.0",
|
||||
"markdownlint-cli2": "^0.13.0",
|
||||
"netlify-plugin-hugo-cache-resources": "^0.2.1",
|
||||
"npm-run-all": "^4.1.5",
|
||||
"postcss-cli": "^11.0.0",
|
||||
"purgecss-whitelister": "^2.4.0",
|
||||
"replace-in-files-cli": "^2.2.0",
|
||||
"rimraf": "^5.0.7",
|
||||
"shx": "^0.3.4",
|
||||
"stylelint": "^16.5.0",
|
||||
"stylelint": "^16.6.1",
|
||||
"stylelint-config-standard-scss": "^13.1.0"
|
||||
},
|
||||
"optionalDependencies": {
|
||||
|
Reference in New Issue
Block a user