Compare commits

...

47 Commits

Author SHA1 Message Date
Mark Dumay
2b3f87b885 Merge pull request #1196 from gethinode/develop
Prepare for consent-enabled script bundling
2024-09-17 19:06:27 +02:00
Mark Dumay
213bb31133 Merge branch 'main' into develop 2024-09-17 18:59:42 +02:00
Mark Dumay
b0130d9f7d Support bundling of scripts by category 2024-09-17 18:57:50 +02:00
Mark Dumay
07a3be644c Remove support for deprecated module configuration keys 2024-09-17 18:55:53 +02:00
Mark Dumay
262bc47260 Shift Google Analytics to separate module 2024-09-17 16:46:37 +02:00
Mark Dumay
51553a05f0 Merge pull request #1195 from gethinode/hugo-mod-dependencies
Update Hugo module dependencies
2024-09-17 08:55:39 +02:00
markdumay
bd06ee211b fix: update Hugo module dependencies 2024-09-17 03:06:18 +00:00
Mark Dumay
cc8e889825 Merge pull request #1194 from gethinode/develop
Suppress anchor links for empty headings
2024-09-15 10:59:41 +02:00
Mark Dumay
a6144122b2 Merge branch 'main' into develop 2024-09-15 08:40:39 +02:00
Mark Dumay
853e0c818f Bump package release 2024-09-15 08:40:01 +02:00
Mark Dumay
1c5fb55d89 Suppress anchor links for empty headings 2024-09-15 08:39:29 +02:00
Mark Dumay
d48fb1a300 Merge pull request #1191 from gethinode/hugo-mod-dependencies
Update Hugo module dependencies
2024-09-15 06:57:36 +02:00
Mark Dumay
f2aa9d2661 Merge branch 'main' into hugo-mod-dependencies 2024-09-15 06:39:15 +02:00
Mark Dumay
d721e1cfc2 Merge pull request #1193 from gethinode/develop
Add nofollow to external links
2024-09-15 06:28:41 +02:00
Mark Dumay
7f7bf2152c Merge branch 'main' into develop 2024-09-15 06:21:02 +02:00
Mark Dumay
a9543de1e7 Add nofollow to external links 2024-09-15 06:20:23 +02:00
Mark Dumay
39e4073837 Merge pull request #1192 from gethinode/develop
Support configuration of meta title and meta description
2024-09-15 06:19:11 +02:00
Mark Dumay
d2782349d5 Reset meta data of example page 2024-09-15 06:12:38 +02:00
Mark Dumay
fe97815460 Merge branch 'main' into develop 2024-09-15 06:09:56 +02:00
Mark Dumay
7bcaa69d5b Support configuration of meta title and meta description 2024-09-15 06:09:09 +02:00
markdumay
30ae3f6b3c fix: update Hugo module dependencies 2024-09-15 03:10:46 +00:00
github-actions[bot]
6540e11fa9 Merge pull request #1189 from gethinode/dependabot/npm_and_yarn/neostandard-0.11.5
Bump neostandard from 0.11.4 to 0.11.5
2024-09-12 13:43:46 +00:00
dependabot[bot]
14f2145239 Bump neostandard from 0.11.4 to 0.11.5
Bumps [neostandard](https://github.com/neostandard/neostandard) from 0.11.4 to 0.11.5.
- [Release notes](https://github.com/neostandard/neostandard/releases)
- [Changelog](https://github.com/neostandard/neostandard/blob/main/CHANGELOG.md)
- [Commits](https://github.com/neostandard/neostandard/compare/v0.11.4...v0.11.5)

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

Signed-off-by: dependabot[bot] <support@github.com>
2024-09-12 13:38:34 +00:00
Mark Dumay
856a0aed08 Merge pull request #1188 from gethinode/develop
Fix bootstrap form validation when purging styles
2024-09-12 07:13:56 +02:00
Mark Dumay
5c6b91f1ce Merge branch 'main' into develop 2024-09-12 07:07:31 +02:00
Mark Dumay
152b8ca060 Bump package release 2024-09-12 07:06:42 +02:00
Mark Dumay
0f8870fed0 Fix bootstrap form validation when purging styles
See #1184
2024-09-12 07:06:10 +02:00
Mark Dumay
742ae6784b Merge pull request #1187 from gethinode/develop
Refine hugo caching
2024-09-12 06:57:22 +02:00
Mark Dumay
ce4c8c0a7c Merge branch 'main' into develop 2024-09-12 06:42:13 +02:00
Mark Dumay
40de449fed Refine hugo caching 2024-09-12 06:41:35 +02:00
Mark Dumay
4c27864248 Improve code layout 2024-09-12 06:41:03 +02:00
Mark Dumay
3efb2b7451 Merge pull request #1186 from gethinode/develop
Improve handling of Cloudinary image paths
2024-09-12 06:36:51 +02:00
Mark Dumay
721e222849 Merge branch 'main' into develop 2024-09-12 06:30:49 +02:00
Mark Dumay
77b9d62d76 Improve handling of Cloudinary image paths
You can reference an image on Cloudinary by using the account name, relative directory, and file name. However, you can reference the image by optionally adding the API path (e.g. "image/upload", "video/upload") directly after the account name. Hinode now parses both types of paths correctly.
2024-09-12 06:29:54 +02:00
github-actions[bot]
efe3c947c2 Merge pull request #1183 from gethinode/dependabot/npm_and_yarn/hugo-bin-0.131.2
Bump hugo-bin from 0.131.1 to 0.131.2
2024-09-10 13:24:12 +00:00
dependabot[bot]
beee2e40e0 Bump hugo-bin from 0.131.1 to 0.131.2
Bumps [hugo-bin](https://github.com/fenneclab/hugo-bin) from 0.131.1 to 0.131.2.
- [Release notes](https://github.com/fenneclab/hugo-bin/releases)
- [Commits](https://github.com/fenneclab/hugo-bin/compare/v0.131.1...v0.131.2)

---
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-09-10 13:19:12 +00:00
Mark Dumay
895d606175 Merge pull request #1182 from gethinode/develop
Bump Netlify build environment
2024-09-10 09:36:02 +02:00
Mark Dumay
9a17df96f3 Merge branch 'main' into develop 2024-09-10 07:17:05 +02:00
Mark Dumay
d2e1a1678a Bump Netlify build environment 2024-09-10 07:16:39 +02:00
Mark Dumay
d8451e2699 Merge pull request #1181 from gethinode/develop
Fix deprecation warning
2024-09-10 07:15:09 +02:00
Mark Dumay
f98ab74905 Merge branch 'main' into develop 2024-09-10 07:09:30 +02:00
Mark Dumay
6e453ea2ab Fix deprecation warning 2024-09-10 07:09:05 +02:00
Mark Dumay
d6ca890c80 Merge pull request #1180 from gethinode/develop
Improve handling of unsupported alert types
2024-09-10 07:07:51 +02:00
Mark Dumay
46aecfe65a Merge branch 'main' into develop 2024-09-10 06:58:26 +02:00
Mark Dumay
496c07ff7e Improve handling of unsupported alert types 2024-09-10 06:55:56 +02:00
github-actions[bot]
3a63f4fad7 Merge pull request #1179 from gethinode/dependabot/npm_and_yarn/eslint-9.10.0
Bump eslint from 9.9.1 to 9.10.0
2024-09-09 13:24:05 +00:00
dependabot[bot]
bbf99507d6 Bump eslint from 9.9.1 to 9.10.0
Bumps [eslint](https://github.com/eslint/eslint) from 9.9.1 to 9.10.0.
- [Release notes](https://github.com/eslint/eslint/releases)
- [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md)
- [Commits](https://github.com/eslint/eslint/compare/v9.9.1...v9.10.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2024-09-09 13:18:22 +00:00
33 changed files with 392 additions and 272 deletions

View File

@@ -123,7 +123,7 @@ Hinode is inspired by the following themes:
## Donate ## Donate
<!-- markdownlint-disable MD033 --> <!-- markdownlint-disable MD033 -->
<a href="https://www.buymeacoffee.com/markdumay" target="_blank" rel="noopener noreferrer"><img src="https://cdn.buymeacoffee.com/buttons/lato-orange.png" alt="Buy Me A Coffee" style="height: 51px !important;width: 217px !important;"></a> <a href="https://www.buymeacoffee.com/markdumay" target="_blank" rel="noopener noreferrer nofollow"><img src="https://cdn.buymeacoffee.com/buttons/lato-orange.png" alt="Buy Me A Coffee" style="height: 51px !important;width: 217px !important;"></a>
<!-- markdownlint-enable MD033 --> <!-- markdownlint-enable MD033 -->
## License ## License

View File

@@ -1,21 +0,0 @@
// Adapted from https://github.com/gohugoio/hugo/blob/master/tpl/tplimpl/embedded/templates/google_analytics.html
{{ if and (not hugo.IsServer) (not site.Config.Privacy.GoogleAnalytics.Disable) }}
{{ with site.Config.Services.GoogleAnalytics.ID }}
{{ if strings.HasPrefix (lower .) "ua-" }}
{{ warnf "Google Analytics 4 (GA4) replaced Google Universal Analytics (UA) effective 1 July 2023. See https://support.google.com/analytics/answer/11583528. Create a GA4 property and data stream, then replace the Google Analytics ID in your site configuration with the new value." }}
{{ else }}
var doNotTrack = false;
if ({{ site.Config.Privacy.GoogleAnalytics.RespectDoNotTrack }}) {
var dnt = (navigator.doNotTrack || window.doNotTrack || navigator.msDoNotTrack);
var doNotTrack = (dnt == "1" || dnt == "yes");
}
if (!doNotTrack) {
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', '{{ . }}');
}
{{ end }}
{{ end }}
{{ end }}

View File

@@ -130,6 +130,8 @@ home = ["HTML", "RSS", "REDIR"]
path = "github.com/gethinode/mod-flexsearch/v2" path = "github.com/gethinode/mod-flexsearch/v2"
[[module.imports]] [[module.imports]]
path = "github.com/gethinode/mod-fontawesome" path = "github.com/gethinode/mod-fontawesome"
[[module.imports]]
path = "github.com/gethinode/mod-google-analytics"
[[module.imports]] [[module.imports]]
path = "github.com/gethinode/mod-katex" path = "github.com/gethinode/mod-katex"
[[module.imports]] [[module.imports]]

View File

@@ -11,5 +11,5 @@
title = "Follow me" title = "Follow me"
caption = "I work on everything coding and tweet developer memes" caption = "I work on everything coding and tweet developer memes"
[en.params.footer] [en.params.footer]
# license = "Licensed under Creative Commons (<a href='https://creativecommons.org/licenses/by-nc-sa/4.0/' class='link-secondary' target='_blank' rel='noopener noreferrer'>CC BY-NC-SA 4.0</a>)." # license = "Licensed under Creative Commons (<a href='https://creativecommons.org/licenses/by-nc-sa/4.0/' class='link-secondary' target='_blank' rel='noopener noreferrer nofollow'>CC BY-NC-SA 4.0</a>)."
# toml-docs-end lang-param # toml-docs-end lang-param

View File

@@ -10,7 +10,7 @@ const purgecss = require('@fullhuman/postcss-purgecss')({
return [...(els.tags || []), ...(els.classes || []), ...(els.ids || [])] return [...(els.tags || []), ...(els.classes || []), ...(els.ids || [])]
}, },
dynamicAttributes: ['data-bs-theme'], dynamicAttributes: ['data-bs-theme'],
safelist: [ safelist: ['was-validated',
...whitelister([ ...whitelister([
'./assets/scss/components/_clipboard.scss', './assets/scss/components/_clipboard.scss',
'./assets/scss/components/_command.scss', './assets/scss/components/_command.scss',

View File

@@ -0,0 +1,65 @@
comment: >-
Includes a reference to a local or external JavaScript file. Hinode uses the
template defined in `layouts/partials/templates/script.html` to generate the
link to a (bundled) JavaScript file. It includes context such as the state,
category, and integrity. For example, you can adapt this template to implement
cookie consent management.
arguments:
link:
type: string
optional: false
comment: >-
Location of the script source, either an URL for an external script or a
(relative) path for a local script.
state:
type: select
optional: true
comment: >-
Defines the loading behavior of the script bundle. By default, scripts are
loaded immediately. Use `async` to process the script in the background.
Use 'defer' to load the script in relative order when the DOM is fully
built.
options:
values:
- async
- defer
- immediate
category:
type: select
optional: true
default: other
comment: >-
Assigns the script to a category that can be used for cookie consent
management. The following categories are available:
- Necessary cookies are linked to the site's essential features, which include
secure log-in and customizable consent settings. There is no personally
identifying information stored by these cookies.
- Functional cookies facilitate the performance of specific tasks, such as
gathering user comments, disseminating the website's content on social
media, and enabling additional third-party capabilities. Hinode uses
functional cookies to store the user's language and theme preferences.
- Cookies with analytical functions are employed to comprehend how users
engage with the website. These cookies aid in the provision of data on
metrics like number of visitors, bounce rate, source of traffic, etc.
- In order to provide users with a better user experience, performance
cookies are employed to comprehend and evaluate the website's important
performance indicators.
- Advertisement cookies are used to track the success of ad campaigns and
show users personalized advertisements depending on the pages they have
previously viewed.
- Unassigned cookies are categorized as 'other' by default. These cookies
should be reviewed and assigned to a specific category by the site
administrator.
options:
values:
- necessary
- functional
- analytics
- performance
- advertisement
- other
integrity:
type: string
optional: true
comment: >-
Cryptographic hash of the script to enable Subresource Integrity (SRI).

View File

@@ -8,62 +8,17 @@ arguments:
- '*hugolib.pageForShortcode' - '*hugolib.pageForShortcode'
optional: false optional: false
comment: Context of the current page. comment: Context of the current page.
core: type:
type: bool
default: false
optional: true
comment: >-
Trigger to include all core files in the script bundle. Core bundles are
loaded asynchronously in each page of the site.
filename:
type: string
default: js/main.bundle.js
optional: true
comment: >-
Path of the target bundle file, relative to the site root.
match:
type: string
default: {js/*.js,js/vendor/**.js}
optional: true
comment: >-
Regular expression that defines the pattern of source files to be included
in the bundle. The pattern is relative to the project's `asset` folder.
header:
type: bool
default: false
comment: >-
Trigger to consider the script as loaded in the page header. When enabled,
it includes a script to load Google Analytics adjacent to any bundle
input.
localize:
type: bool
default: false
optional: true
comment: >-
Triggers the creation of a language-specific bundle file. The language
code is appended as suffix to the base name. For example, the English
version of `js/main.bundle.js` becomes `js/main.bundle.en.js`.
skipTemplate:
type: bool
default: false
optional: true
comment: >-
Script source input can contain Go Template magic. As such, Hinode
processes all input files with `resources.ExecuteAsTemplate`. However,
certain input files may be incompatible. Set `skipTemplate` to true to
skip template processing.
state:
type: select type: select
default: core
optional: true optional: true
default: async
comment: >- comment: >-
Defines the loading behavior of the script bundle. By default, scripts are Type of script bundle. Critical scripts are included in the page header
processed in the background and loaded when ready (`async`). Set the state and are loaded immediately. Core scripts are bundled by category and are
to `immediate` to load the script immediately (such as critical scripts). loaded asynchronously. Optional scripts are loaded individually on the
Use 'defer' to load the script in relative order when the DOM is fully pages that require them. They use the synchronization method as defined
built. in their containing module.
options: values:
values: - critical
- async - core
- defer - optional
- immediate

View File

@@ -11,7 +11,7 @@ tagline = "A Hugo Theme"
title = "Follow me" title = "Follow me"
caption = "I work on everything coding and tweet developer memes" caption = "I work on everything coding and tweet developer memes"
[en.params.footer] [en.params.footer]
# license = "Licensed under Creative Commons (<a href='https://creativecommons.org/licenses/by-nc-sa/4.0/' class='link-secondary' target='_blank' rel='noopener noreferrer'>CC BY-NC-SA 4.0</a>)." # license = "Licensed under Creative Commons (<a href='https://creativecommons.org/licenses/by-nc-sa/4.0/' class='link-secondary' target='_blank' rel='noopener noreferrer nofollow'>CC BY-NC-SA 4.0</a>)."
# toml-docs-end lang-param # toml-docs-end lang-param
[en.params.sections.blog] [en.params.sections.blog]
reference = "More Posts" reference = "More Posts"
@@ -30,7 +30,7 @@ tagline = "Een Hugo Thema"
title = "Volg mij" title = "Volg mij"
caption = "Ik doe aan programmeren en tweet memes" caption = "Ik doe aan programmeren en tweet memes"
[nl.params.footer] [nl.params.footer]
# license = "Gelicenseerd onder Creative Commons (<a href='https://creativecommons.org/licenses/by-nc-sa/4.0/' class='link-secondary' target='_blank' rel='noopener noreferrer'>CC BY-NC-SA 4.0</a>)." # license = "Gelicenseerd onder Creative Commons (<a href='https://creativecommons.org/licenses/by-nc-sa/4.0/' class='link-secondary' target='_blank' rel='noopener noreferrer nofollow'>CC BY-NC-SA 4.0</a>)."
[nl.params.sections.blog] [nl.params.sections.blog]
reference = "Meer artikelen" reference = "Meer artikelen"
[nl.params.sections.projects] [nl.params.sections.projects]
@@ -49,7 +49,7 @@ tagline = "Un thème Hugo"
title = "Suivez-moi" title = "Suivez-moi"
caption = "Je code et je tweet des mèmes de développeurs." caption = "Je code et je tweet des mèmes de développeurs."
[fr.params.footer] [fr.params.footer]
# license = "Gelicenseerd onder Creative Commons (<a href='https://creativecommons.org/licenses/by-nc-sa/4.0/' class='link-secondary' target='_blank' rel='noopener noreferrer'>CC BY-NC-SA 4.0</a>)." # license = "Gelicenseerd onder Creative Commons (<a href='https://creativecommons.org/licenses/by-nc-sa/4.0/' class='link-secondary' target='_blank' rel='noopener noreferrer nofollow'>CC BY-NC-SA 4.0</a>)."
[fr.params.sections.blog] [fr.params.sections.blog]
reference = "Plus d'articles" reference = "Plus d'articles"
[fr.params.sections.projects] [fr.params.sections.projects]

View File

@@ -10,7 +10,7 @@ const purgecss = require('@fullhuman/postcss-purgecss')({
return [...(els.tags || []), ...(els.classes || []), ...(els.ids || [])] return [...(els.tags || []), ...(els.classes || []), ...(els.ids || [])]
}, },
dynamicAttributes: ['data-bs-theme'], dynamicAttributes: ['data-bs-theme'],
safelist: [ safelist: ['was-validated',
...whitelister([ ...whitelister([
'./_vendor/github.com/gethinode/hinode/assets/scss/components/_clipboard.scss', './_vendor/github.com/gethinode/hinode/assets/scss/components/_clipboard.scss',
'./_vendor/github.com/gethinode/hinode/assets/scss/components/_command.scss', './_vendor/github.com/gethinode/hinode/assets/scss/components/_command.scss',

View File

@@ -14,7 +14,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/dog.webp"
ratio="21x9" caption="Cloudinary image" class="rounded" plain=true */>}} ratio="21x9" caption="Cloudinary image" class="rounded" plain=true */>}}
{{< /example >}} {{< /example >}}
<!-- markdownlint-enable MD037 --> <!-- markdownlint-enable MD037 -->

7
go.mod
View File

@@ -7,11 +7,12 @@ require (
github.com/gethinode/mod-bootstrap v1.3.1 // indirect github.com/gethinode/mod-bootstrap v1.3.1 // indirect
github.com/gethinode/mod-flexsearch/v2 v2.0.1 // indirect github.com/gethinode/mod-flexsearch/v2 v2.0.1 // indirect
github.com/gethinode/mod-fontawesome v1.10.0 // indirect github.com/gethinode/mod-fontawesome v1.10.0 // indirect
github.com/gethinode/mod-google-analytics v1.0.2 // indirect
github.com/gethinode/mod-katex v1.1.2 // indirect github.com/gethinode/mod-katex v1.1.2 // indirect
github.com/gethinode/mod-leaflet v1.1.1 // indirect github.com/gethinode/mod-leaflet v1.1.1 // indirect
github.com/gethinode/mod-lottie v1.5.8 // indirect github.com/gethinode/mod-lottie v1.5.9 // indirect
github.com/gethinode/mod-simple-datatables v1.0.10 // indirect github.com/gethinode/mod-simple-datatables v1.0.12 // indirect
github.com/gethinode/mod-utils/v2 v2.7.0 // indirect github.com/gethinode/mod-utils/v2 v2.8.1 // indirect
github.com/nextapps-de/flexsearch v0.0.0-20240501124520-961c3ae84a87 // indirect github.com/nextapps-de/flexsearch v0.0.0-20240501124520-961c3ae84a87 // indirect
github.com/twbs/bootstrap v5.3.3+incompatible // indirect github.com/twbs/bootstrap v5.3.3+incompatible // indirect
) )

14
go.sum
View File

@@ -118,6 +118,12 @@ github.com/gethinode/mod-fontawesome v1.9.1 h1:cQk84vriqffM4fuUUoM9j3SSD+3ppeW2j
github.com/gethinode/mod-fontawesome v1.9.1/go.mod h1:xBKsZH3WJtMOItZVlp9SbO51uaBy6IbvUZSKpNu3b6Y= github.com/gethinode/mod-fontawesome v1.9.1/go.mod h1:xBKsZH3WJtMOItZVlp9SbO51uaBy6IbvUZSKpNu3b6Y=
github.com/gethinode/mod-fontawesome v1.10.0 h1:Izs2AKc+YVBa1TywcH54OKLTNCUMXRoFIqOs+n0FgOo= github.com/gethinode/mod-fontawesome v1.10.0 h1:Izs2AKc+YVBa1TywcH54OKLTNCUMXRoFIqOs+n0FgOo=
github.com/gethinode/mod-fontawesome v1.10.0/go.mod h1:xBKsZH3WJtMOItZVlp9SbO51uaBy6IbvUZSKpNu3b6Y= github.com/gethinode/mod-fontawesome v1.10.0/go.mod h1:xBKsZH3WJtMOItZVlp9SbO51uaBy6IbvUZSKpNu3b6Y=
github.com/gethinode/mod-google-analytics v1.0.0 h1:fly42RQ69bdyJe8WFefsBIo7WMIXkd3wZn32kyAr4h4=
github.com/gethinode/mod-google-analytics v1.0.0/go.mod h1:dl628cFozpCvoIMCiV7ujzQipjxcm3eatXrSfLPWNII=
github.com/gethinode/mod-google-analytics v1.0.1 h1:zbmOdnAhhFCA7qWw7fnR46biWhqW2r06sIaTWyhB5R0=
github.com/gethinode/mod-google-analytics v1.0.1/go.mod h1:dl628cFozpCvoIMCiV7ujzQipjxcm3eatXrSfLPWNII=
github.com/gethinode/mod-google-analytics v1.0.2 h1:ljrAYdAPqiQg6rdnL6Je8zLK6mhlXoTGJ/vGtIUpX+w=
github.com/gethinode/mod-google-analytics v1.0.2/go.mod h1:dl628cFozpCvoIMCiV7ujzQipjxcm3eatXrSfLPWNII=
github.com/gethinode/mod-katex v1.0.0 h1:me/3dIIZBkfk1mRIFt8QiAGYwYDoSG5bc2hHRtIutFc= 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.0/go.mod h1:byAfpI3wuqNJIooTGVEGc1cjBhhCy4+CcK1H6495MYg=
github.com/gethinode/mod-katex v1.0.1 h1:809QUztxmKgMNchU+v03iMO7Ma+ISc3ZzhXYauc21rs= github.com/gethinode/mod-katex v1.0.1 h1:809QUztxmKgMNchU+v03iMO7Ma+ISc3ZzhXYauc21rs=
@@ -206,6 +212,8 @@ github.com/gethinode/mod-lottie v1.5.7 h1:hcf04kmKv7xrI2byxtgHwkScYIHfP9aquInHNZ
github.com/gethinode/mod-lottie v1.5.7/go.mod h1:rhWg+MSSnWmqHKNEViE/9/78RjQD6uWWFASgjvFjgyo= github.com/gethinode/mod-lottie v1.5.7/go.mod h1:rhWg+MSSnWmqHKNEViE/9/78RjQD6uWWFASgjvFjgyo=
github.com/gethinode/mod-lottie v1.5.8 h1:glg5HcjOBkFt5MoF7p24NN+RzctExPQUDXvdhPx9u6I= github.com/gethinode/mod-lottie v1.5.8 h1:glg5HcjOBkFt5MoF7p24NN+RzctExPQUDXvdhPx9u6I=
github.com/gethinode/mod-lottie v1.5.8/go.mod h1:Z/FlAcCJWYI1Z9tQnL0yRN4lqhyZl9CqYpfJUPVDaGc= github.com/gethinode/mod-lottie v1.5.8/go.mod h1:Z/FlAcCJWYI1Z9tQnL0yRN4lqhyZl9CqYpfJUPVDaGc=
github.com/gethinode/mod-lottie v1.5.9 h1:1MFsq8pO7s4RXu1sA0z75xdp63FPdJ6ar9OhEieDSj8=
github.com/gethinode/mod-lottie v1.5.9/go.mod h1:TA1rPRwSilT5mXUakNSVlXNrgTpE87mUOB/fdunAdA0=
github.com/gethinode/mod-simple-datatables v1.0.0 h1:Dj4WGw12OkaimwkCpLn5Jhmd49dvNJW9O2P/W9F+HlQ= github.com/gethinode/mod-simple-datatables v1.0.0 h1:Dj4WGw12OkaimwkCpLn5Jhmd49dvNJW9O2P/W9F+HlQ=
github.com/gethinode/mod-simple-datatables v1.0.0/go.mod h1:K8T7fIdb8pMOB+OSW4A5lz5IW99+HyzcTgx764fvOGw= github.com/gethinode/mod-simple-datatables v1.0.0/go.mod h1:K8T7fIdb8pMOB+OSW4A5lz5IW99+HyzcTgx764fvOGw=
github.com/gethinode/mod-simple-datatables v1.0.2 h1:zhqxHet3iLQWYCBbGROALpOY9zQlptMycFkz1Tto5bA= github.com/gethinode/mod-simple-datatables v1.0.2 h1:zhqxHet3iLQWYCBbGROALpOY9zQlptMycFkz1Tto5bA=
@@ -224,6 +232,8 @@ github.com/gethinode/mod-simple-datatables v1.0.9 h1:8OnpY/axFkgxJ598DHW4nDtxsCY
github.com/gethinode/mod-simple-datatables v1.0.9/go.mod h1:rgQWdDZ6lTR9+08dGY1zBDLZI/UneKPufakAK20+lmI= github.com/gethinode/mod-simple-datatables v1.0.9/go.mod h1:rgQWdDZ6lTR9+08dGY1zBDLZI/UneKPufakAK20+lmI=
github.com/gethinode/mod-simple-datatables v1.0.10 h1:/nYy4oCgooUJhTBgLdQzMnJEjolkD+dp2nkfLNT9Klg= github.com/gethinode/mod-simple-datatables v1.0.10 h1:/nYy4oCgooUJhTBgLdQzMnJEjolkD+dp2nkfLNT9Klg=
github.com/gethinode/mod-simple-datatables v1.0.10/go.mod h1:rgQWdDZ6lTR9+08dGY1zBDLZI/UneKPufakAK20+lmI= github.com/gethinode/mod-simple-datatables v1.0.10/go.mod h1:rgQWdDZ6lTR9+08dGY1zBDLZI/UneKPufakAK20+lmI=
github.com/gethinode/mod-simple-datatables v1.0.12 h1:myyVp1ctQA6j+5UTWcDwQmy8ipXdjs8T+qpTpRPBPII=
github.com/gethinode/mod-simple-datatables v1.0.12/go.mod h1:QuH7wz1igohzCgL76xI1960mFxPPrqgvGtLwR/0cFyQ=
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=
@@ -280,6 +290,10 @@ github.com/gethinode/mod-utils/v2 v2.6.0 h1:r7l/E6fbPZHnjFyJY4T/xzekd7Xp3czNVCMg
github.com/gethinode/mod-utils/v2 v2.6.0/go.mod h1:GTYeknoLujNjfDxI+V9Dcug26CYJSTJ0B/U2dagw9oY= github.com/gethinode/mod-utils/v2 v2.6.0/go.mod h1:GTYeknoLujNjfDxI+V9Dcug26CYJSTJ0B/U2dagw9oY=
github.com/gethinode/mod-utils/v2 v2.7.0 h1:5CKygjsc7X4dFtb90ihWyDVvUp2iqoJE8C7M+jeWYus= github.com/gethinode/mod-utils/v2 v2.7.0 h1:5CKygjsc7X4dFtb90ihWyDVvUp2iqoJE8C7M+jeWYus=
github.com/gethinode/mod-utils/v2 v2.7.0/go.mod h1:GTYeknoLujNjfDxI+V9Dcug26CYJSTJ0B/U2dagw9oY= github.com/gethinode/mod-utils/v2 v2.7.0/go.mod h1:GTYeknoLujNjfDxI+V9Dcug26CYJSTJ0B/U2dagw9oY=
github.com/gethinode/mod-utils/v2 v2.8.0 h1:BdB+onItuO29g5ZLEz/HEwq9c4xBEM4GGqQc3kQ++js=
github.com/gethinode/mod-utils/v2 v2.8.0/go.mod h1:GTYeknoLujNjfDxI+V9Dcug26CYJSTJ0B/U2dagw9oY=
github.com/gethinode/mod-utils/v2 v2.8.1 h1:u7sFbgJ5sBEMYC/GwcMRyjRAd5NxTjBnbld5b0V5n98=
github.com/gethinode/mod-utils/v2 v2.8.1/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

@@ -9,10 +9,18 @@
}} }}
{{ if eq .Type "alert" }} {{ if eq .Type "alert" }}
<blockquote class="blockquote-alert blockquote-alert-{{ .AlertType }}"> {{ $alert := .AlertType }}
{{ $icon := (index $icons $alert) }}
<blockquote class="blockquote-alert blockquote-alert-{{ $alert }}">
<p class="blockquote-alert-heading"> <p class="blockquote-alert-heading">
{{ partial "assets/icon.html" (dict "icon" (printf "%s fa-fw" (index $icons .AlertType))) }} {{ with $icon }}
{{ or (i18n .AlertType) (title .AlertType) }} {{ partial "assets/icon.html" (dict "icon" (printf "%s fa-fw" .)) }}
{{ or (i18n $alert) (title $alert) }}
{{ else }}
{{ title $alert }}
{{ warnf "Unsupported alert type: '%s'. See %s" $alert $.Position }}
{{ end }}
</p> </p>
{{ trim .Text "\n\r" | safeHTML }} {{ trim .Text "\n\r" | safeHTML }}
</blockquote> </blockquote>

View File

@@ -1,5 +1,12 @@
{{ if site.Params.navigation.anchor }} {{ $text := trim .Text " \n\r" }}
<h{{ .Level }} id="{{ .Anchor | safeURL }}" class="heading">{{ .Text | safeHTML }} <a href="#{{ .Anchor | safeURL }}" aria-labelledby="{{ .Anchor | safeURL }}">{{- partial "assets/icon.html" (dict "icon" "fas link anchor") }}</a></h{{ .Level }}>
{{ if and site.Params.navigation.anchor $text }}
<h{{ .Level }} id="{{ .Anchor | safeURL }}" class="heading">
{{- .Text | safeHTML -}}
<a href="#{{ .Anchor | safeURL }}" aria-labelledby="{{ .Anchor | safeURL }}">
{{- partial "assets/icon.html" (dict "icon" "fas link anchor") }}
</a>
</h{{ .Level }}>
{{ else }} {{ else }}
<h{{ .Level }} id="{{ .Anchor | safeURL }}">{{ .Text | safeHTML }}</h{{ .Level }}> <h{{ .Level }} id="{{ .Anchor | safeURL }}">{{ .Text | safeHTML }}</h{{ .Level }}>
{{ end }} {{ end }}

View File

@@ -14,7 +14,7 @@
{{- end -}} {{- end -}}
{{- /* Initialize module configuration */ -}} {{- /* Initialize module configuration */ -}}
{{- $modules := partial "utilities/InitModules.html" (dict "page" .) -}} {{- $modules := partialCached "utilities/InitModules.html" . -}}
{{- $.Scratch.Set "modules" $modules -}} {{- $.Scratch.Set "modules" $modules -}}
{{- $fullCover := or (or (and .IsHome .Site.Params.home.fullCover) .Page.Params.fullCover) .Site.Params.main.footerBelowFold }} {{- $fullCover := or (or (and .IsHome .Site.Params.home.fullCover) .Page.Params.fullCover) .Site.Params.main.footerBelowFold }}
@@ -27,7 +27,7 @@
{{- $.Scratch.Set "sections" $sections -}} {{- $.Scratch.Set "sections" $sections -}}
{{- /* Define main breakpoint */ -}} {{- /* Define main breakpoint */ -}}
{{- $.Scratch.Set "breakpoint" (partial "utilities/GetBreakpoint.html") }} {{- $.Scratch.Set "breakpoint" (partialCached "utilities/GetBreakpoint.html" .) }}
{{- /* Define base URL */ -}} {{- /* Define base URL */ -}}
{{ $lang := site.LanguageCode | default site.Language.Lang }} {{ $lang := site.LanguageCode | default site.Language.Lang }}
@@ -36,7 +36,7 @@
<!doctype html> <!doctype html>
<html lang="{{ .Site.Language.Lang }}" class="no-js"> <html lang="{{ .Site.Language.Lang }}" class="no-js">
<head> <head>
{{- partial "footer/scripts.html" (dict "filename" "js/critical.bundle.js" "match" "js/critical/**.js" "header" true "page" .) -}} {{- partial "footer/scripts.html" (dict "page" . "type" "critical") -}}
{{ block "head" . }}{{ end -}} {{ block "head" . }}{{ end -}}
</head> </head>
@@ -74,7 +74,7 @@
{{- partial "footer/toast-container.html" . -}} {{- partial "footer/toast-container.html" . -}}
{{- partial "assets/symbols.html" . -}} {{- partial "assets/symbols.html" . -}}
{{- partialCached "footer/scripts.html" (dict "header" false "page" . "core" true) }} {{- partialCached "footer/scripts.html" (dict "page" .) -}}
{{- partial "footer/optional-scripts.html" . -}} {{- partial "footer/scripts.html" (dict "page" . "type" "optional") -}}
</body> </body>
</html> </html>

View File

@@ -8,7 +8,7 @@
<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>
{{ if site.Params.main.enableLanguageSelectionStorage }} {{ if site.Params.main.enableLanguageSelectionStorage }}
{{- partial "footer/scripts.html" (dict "filename" "js/critical.bundle.js" "match" "js/critical/**.js" "header" true "page" page) -}} {{- partial "footer/scripts.html" (dict "page" page "type" "critical") -}}
{{ else }} {{ else }}
<script src='{{ partial "utilities/GetStaticURL" (dict "url" "js/alias.js") }}'></script> <script src='{{ partial "utilities/GetStaticURL" (dict "url" "js/alias.js") }}'></script>
{{ end }} {{ end }}

View File

@@ -39,13 +39,22 @@
{{ $element := "" }} {{ $element := "" }}
<!-- Split path between upload dir and sub dir --> <!-- Split path between upload dir and sub dir -->
{{ $newdir := partial "utilities/URLJoin.html" (dict "base" (index (split $dir "upload") 0) "path" "upload") }} {{ $dir = path.Clean (trim .dir "/") }}
{{ $file = partial "utilities/URLJoin.html" (dict "base" (index (split $dir "upload") 1) "path" $file) }} {{ $api := "image/upload" }}
{{ $dir = $newdir }}
<!-- Define the account, optional API segment, and directory -->
{{ $elements := split $dir "/" }}
{{ $account := index $elements 0 }}
{{ $operation := "" }}
{{ if and (in (slice "image" "video") (index $elements 1)) (eq (index $elements 2) "upload") }}
{{ $api = delimit (slice | append (index $elements 1) | append (index $elements 2)) "/" }}
{{ $dir = delimit (after 3 $elements) "/" }}
{{ else }}
{{ $dir = delimit (after 1 $elements) "/" }}
{{ end }}
<!-- Generate image URL --> <!-- Generate image URL -->
{{ if not $error }} {{ if not $error }}
{{ $operation := "" }}
{{ if $format }} {{ if $format }}
{{ $operation = printf "%s,h_%d,w_%d" $transform $height $width }} {{ $operation = printf "%s,h_%d,w_%d" $transform $height $width }}
{{ $file = printf "%s.%s" (strings.TrimSuffix (path.Ext $file) $file) $format }} {{ $file = printf "%s.%s" (strings.TrimSuffix (path.Ext $file) $file) $format }}
@@ -55,7 +64,7 @@
{{ with $anchor }} {{ with $anchor }}
{{ $operation = printf "%s,g_%s" $operation . }} {{ $operation = printf "%s,g_%s" $operation . }}
{{ end }} {{ end }}
{{- $element = partial "utilities/URLJoin.html" (dict "elements" (slice "https://" $host $dir $operation $file)) -}} {{- $element = partial "utilities/URLJoin.html" (dict "elements" (slice "https://" $host $account $api $operation $dir $file)) -}}
{{ end }} {{ end }}
{{ return $element }} {{ return $element }}

View File

@@ -64,7 +64,7 @@
{{- if $isExternal -}} {{- if $isExternal -}}
{{- if $tab -}} {{- if $tab -}}
{{- $target = "_blank" -}} {{- $target = "_blank" -}}
{{- $rel = "noopener noreferrer" -}} {{- $rel = "noopener noreferrer nofollow" -}}
{{- end -}} {{- end -}}
{{- if and $title $cue -}} {{- if and $title $cue -}}

View File

@@ -58,7 +58,7 @@
{{ else }} {{ else }}
{{ $paginator = $args.page.Paginate $list }} {{ $paginator = $args.page.Paginate $list }}
{{ end }} {{ end }}
{{ $list = first $paginator.PageSize (after (mul (sub $paginator.PageNumber 1) $paginator.PageSize) $list) }} {{ $list = first $paginator.PagerSize (after (mul (sub $paginator.PageNumber 1) $paginator.PagerSize) $list) }}
{{ end }} {{ end }}
<!-- Initialize list elements --> <!-- Initialize list elements -->

View File

@@ -38,7 +38,7 @@
{{- if $tab -}} {{- if $tab -}}
{{- $target = "_blank" -}} {{- $target = "_blank" -}}
{{- $rel = "noopener noreferrer" -}} {{- $rel = "noopener noreferrer nofollow" -}}
{{- end -}} {{- end -}}
{{- if $cue -}} {{- if $cue -}}

View File

@@ -42,7 +42,7 @@
{{- if $isExternal }} {{- if $isExternal }}
{{- if $tab -}} {{- if $tab -}}
{{ $externalHref = "target=\"_blank\" rel=\"noopener noreferrer\"" }} {{ $externalHref = "target=\"_blank\" rel=\"noopener noreferrer nofollow\"" }}
{{- end -}} {{- end -}}
{{- if $cue -}} {{- if $cue -}}

View File

@@ -45,7 +45,7 @@
{{- $rel := "" -}} {{- $rel := "" -}}
{{- if and $isExternal $tab -}} {{- if and $isExternal $tab -}}
{{- $target = "_blank" -}} {{- $target = "_blank" -}}
{{- $rel = "noopener noreferrer" -}} {{- $rel = "noopener noreferrer nofollow" -}}
{{- end -}} {{- end -}}
<!-- Inline partial to render the card's body --> <!-- Inline partial to render the card's body -->

View File

@@ -143,7 +143,7 @@
<div class="container-fluid {{ with $background }} bg-{{ . }}{{ end }} p-0"> <div class="container-fluid {{ with $background }} bg-{{ . }}{{ end }} p-0">
<div class="container-xxl {{ $wrapper }}"> <div class="container-xxl {{ $wrapper }}">
{{- partial "assets/section-header.html" (dict "title" $title "description" $description "content" $content) -}} {{- partial "assets/section-header.html" (dict "title" $title "description" $description "content" $content) -}}
{{ if eq $layout "card" }} {{ if eq $layout "card" }}
{{- $partial = "assets/card-group.html" -}} {{- $partial = "assets/card-group.html" -}}
{{- $params = merge $params (dict {{- $params = merge $params (dict

View File

@@ -1,46 +0,0 @@
{{ $page_modules := slice }}
{{ if reflect.IsMap .Params.modules }}
{{ $page_modules = .Params.modules }}
{{ else }}
{{ $page_modules = $page_modules | append .Params.modules }}
{{ end }}
{{ with .Scratch.Get "dependencies" }}{{ $page_modules = append $page_modules . | uniq }}{{ end }}
{{ $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 $config.disableTemplate -}}
{{- if in $config.disableTemplate $mod}}
{{- $skipTemplate = true -}}
{{- end -}}
{{- end -}}
{{ $state := "" }}
{{- with (index $config.modules $mod) -}}
{{- with index . "state" }}{{ $state = . }}{{ end -}}
{{- end -}}
{{ $localize := false }}
{{- if reflect.IsSlice $config.localize -}}
{{- if in $config.localize $mod}}
{{- $localize = true -}}
{{- end -}}
{{- end -}}
{{- partial "footer/scripts.html" (dict
"filename" $filename
"match" $match
"header" false
"skipTemplate" $skipTemplate
"state" $state
"localize" $localize
"page" page
) }}
{{- end -}}

View File

@@ -6,72 +6,163 @@
{{ $error := false }} {{ $error := false }}
<!-- Validate arguments --> <!-- Define inline partials -->
{{ if partial "utilities/IsInvalidArgs.html" (dict "structure" "scripts" "args" . "group" "partial") }} {{ define "partials/match.html" }}
{{- errorf "partial [footer/scripts.html] - Invalid arguments" -}} {{ $result := "" }}
{{ $error = true }} {{ $matches := slice }}
{{ end }} {{ if gt (len .modules) 0 }}
{{ range .modules }}
<!-- Initialize arguments --> {{ $matches = $matches | append (printf "js/modules/%s/**.js" .) }}
{{- $absoluteURL := site.Params.main.canonifyAssetsURLs | default false -}} {{ end }}
{{- $filename := .filename | default "js/main.bundle.js" -}} {{ $result = printf "{%s}" (delimit $matches ",") }}
{{- $match := .match | default "{js/*.js,js/vendor/**.js}" -}}
{{- $page := .page -}}
{{- $header := .header -}}
{{- $core := .core | default false -}}
{{- $skipTemplate := .skipTemplate | default false -}}
{{- $localize := .localize | default false }}
{{- $state := .state | default "async" -}}
{{- if or $header (eq $state "immediate") }}{{ $state = "" }}{{ end -}}
{{- $modules := "" -}}
{{ if $core }}
{{ $config := $page.Scratch.Get "modules" }}
{{ if not $config }}
{{ errorf "partial [footer/scripts.html] - Cannot initialize module configuration" }}
{{ end }} {{ end }}
{{- $modules = $config.core -}} {{ return $result }}
{{- if reflect.IsSlice $config.localize -}} {{ end }}
{{- range $index, $mod := $modules -}}
{{- if in $config.localize $mod}}
{{- $localize = true -}}
{{- end -}}
{{- end -}}
{{- end -}}
{{- end -}}
{{ if $localize }} {{ define "partials/bundle-script.html" }}
{{ $filename = path.Join (path.Dir $filename) (printf "%s.%s%s" (path.BaseName $filename) $page.Language.Lang (path.Ext $filename)) }} {{ $page := .page }}
{{ $match := .match }}
{{ $destination := .destination }}
{{ $cat := .cat }}
{{ $localize := .localize }}
{{ $modules := .modules }}
{{ $skipTemplate := .skipTemplate }}
{{ $absoluteURL := .absoluteURL }}
{{ $state := cond (ne .state "immediate") .state "" }}
{{ if and $cat (ne $cat "other") }}
{{ $destination = path.Join (path.Dir $destination) (printf "%s-%s%s" (path.BaseName $destination) $cat (path.Ext $destination)) }}
{{ end }}
{{ if $localize }}
{{ $destination = path.Join (path.Dir $destination) (printf "%s.%s%s" (path.BaseName $destination) $page.Language.Lang (path.Ext $destination)) }}
{{ end }}
{{- $bundle := partial "utilities/bundle.html" (dict
"match" $match
"filename" $destination
"modules" $modules
"basepath" "js/modules"
"all" true
"debugging" site.Params.debugging.showJS
) -}}
{{- $js := $bundle -}}
{{- if not $skipTemplate -}}
{{- $js = $bundle | resources.ExecuteAsTemplate $destination $page -}}
{{- end -}}
{{- if gt (len $js.Content) 0 -}}
{{ $integrity := "" }}
{{- if hugo.IsProduction -}}
{{ $js = $js | minify | fingerprint -}}
{{ $integrity = $js.Data.Integrity }}
{{ end -}}
{{ partial "templates/script.html" (dict "link" (cond $absoluteURL $js.Permalink $js.RelPermalink) "category" $cat "state" $state "integrity" $integrity) }}
{{ end -}}
{{ end }}
<!-- Initialize arguments -->
{{ $args := partial "utilities/InitArgs.html" (dict "structure" "scripts" "args" .) }}
{{ if $args.err }}
{{ partial "utilities/LogErr.html" (dict
"partial" "footer/scripts.html"
"msg" "Invalid arguments"
"details" $args.errmsg
"file" page.File
)}}
{{ end }}
<!-- Initialize local arguments -->
{{ $patterns := dict
"critical" "js/critical/**.js"
"core" "{js/*.js,js/vendor/**.js}"
}}
{{- $absoluteURL := site.Params.main.canonifyAssetsURLs | default false -}}
{{ $state := "immediate" }}
{{ $config := dict }}
{{ if ne $args.type "critical" }}
{{ $config = $args.page.Scratch.Get "modules" }}
{{ if not $config }}
{{ errorf "partial [footer/scripts.html] - Cannot initialize module configuration" }}
{{ $error = true }}
{{ end }}
{{ end }}
{{ $page_modules := slice }}
{{ if reflect.IsMap $args.page.Params.modules }}
{{ $page_modules = $args.page.Params.modules }}
{{ else }}
{{ $page_modules = $page_modules | append $args.page.Params.modules }}
{{ end }}
{{ with $args.page.Scratch.Get "dependencies" }}{{ $page_modules = append $page_modules . | uniq }}{{ end }}
{{ $modules := slice }}
{{ if eq $args.type "core" }}
{{- $modules = $config.core -}}
{{ else if eq $args.type "optional" }}
{{- $modules = $config.optional | intersect $page_modules -}}
{{ end }}
{{ $localize := false }}
{{ if gt (intersect (or $config.localize slice) $modules | len) 0 }}{{ $localize = true }}{{ end }}
{{ $skipTemplate := false }}
{{ if gt (intersect (or $config.skipTemplate slice) $modules | len) 0 }}{{ $skipTemplate = true }}{{ end }}
{{- $categories := dict "other" slice -}}
{{ range $cat, $val := $config.categories }}
{{ $categories = merge $categories (dict $cat (intersect $val $modules)) }}
{{ end }} {{ end }}
<!-- Main code --> <!-- Main code -->
{{- $bundle := partial "utilities/bundle" (dict {{ if not $error }}
"match" $match <!-- Bundle the critical scripts as single file -->
"filename" $filename {{ if eq $args.type "critical" }}
"modules" $modules {{ partial "partials/bundle-script.html" (dict
"basepath" "js/modules" "page" $args.page
"all" true "match" (index $patterns $args.type)
"debugging" site.Params.debugging.showJS "destination" (printf "js/%s.bundle.js" $args.type)
) -}} "localize" $localize
{{- $js := $bundle -}} "skipTemplate" $skipTemplate
{{- if not $skipTemplate -}} "absoluteURL" $absoluteURL
{{- $js = $bundle | resources.ExecuteAsTemplate $filename $page -}} )}}
{{- end -}} <!-- Bundle the core scripts by category -->
{{ else if eq $args.type "core" }}
{{- if and (not hugo.IsServer) $header -}} {{ range $cat, $val := $categories }}
{{- $pc := site.Config.Privacy.GoogleAnalytics -}} {{ if gt ($val | len) 0 }}
{{- if and (not $pc.Disable) (hasPrefix site.Config.Services.GoogleAnalytics.ID "G-") }} {{ partial "partials/bundle-script.html" (dict
<script async src="https://www.googletagmanager.com/gtag/js?id={{ site.Config.Services.GoogleAnalytics.ID }}"></script> "page" $args.page
{{- end }} "match" (cond (eq $cat "other") (index $patterns $args.type) "")
{{- end -}} "destination" (printf "js/%s.bundle.js" $args.type)
"cat" $cat
{{- if gt (len $js.Content) 0 -}} "modules" $val
{{- if not hugo.IsProduction -}} "localize" $localize
<script src="{{ if $absoluteURL }}{{ $js.Permalink }}{{ else }}{{ $js.RelPermalink }}{{ end }}"{{ with $state }} {{ . | safeHTMLAttr }}{{ end }}></script> "skipTemplate" $skipTemplate
{{ else -}} "absoluteURL" $absoluteURL
{{ $js = $js | minify | fingerprint -}} "state" "async"
<script src="{{ if $absoluteURL }}{{ $js.Permalink }}{{ else }}{{ $js.RelPermalink }}{{ end }}" integrity="{{ $js.Data.Integrity }}" crossorigin="anonymous"{{ with $state}} {{ . | safeHTMLAttr }}{{ end }}></script> )}}
{{ end -}} {{ end }}
{{ end -}} {{ end }}
{{ else }}
<!-- Bundle the core scripts by module name and category -->
{{ range $cat, $val := $categories }}
{{ range $val }}
{{ $modconfig := index $config.modules . }}
{{ partial "partials/bundle-script.html" (dict
"page" $args.page
"destination" (printf "js/%s.js" .)
"cat" $cat
"modules" (slice .)
"localize" $modconfig.localize
"skipTemplate" $modconfig.disabletemplate
"absoluteURL" $absoluteURL
"state" $modconfig.state
)}}
{{ end }}
{{ end }}
{{ end }}
{{ end }}

View File

@@ -20,7 +20,7 @@
</div> </div>
<div class="col col-6 text-sm-start"> <div class="col col-6 text-sm-start">
{{ range .Site.Menus.social -}} {{ range .Site.Menus.social -}}
<a href="{{ .URL }}" {{ if $tab }} target="_blank" rel="noopener noreferrer"{{ end }} aria-label="{{ .Name | safeHTML }}" class="text-decoration-none link-secondary d-inline p-2"> <a href="{{ .URL }}" {{ if $tab }} target="_blank" rel="noopener noreferrer nofollow"{{ end }} aria-label="{{ .Name | safeHTML }}" class="text-decoration-none link-secondary d-inline p-2">
{{ if hasPrefix .Pre "<i" }} {{ if hasPrefix .Pre "<i" }}
{{ .Pre | safeHTML }} {{ .Pre | safeHTML }}
{{ else }} {{ else }}

View File

@@ -1,13 +1,17 @@
<!-- TODO: replace scratch with dict --> <!-- TODO: replace scratch with dict -->
<!-- Adapted from doks --> <!-- Adapted from doks -->
{{ with .Title -}} {{ with .Params.meta.title }}
{{ $.Scratch.Set "title" . -}} {{ $.Scratch.Set "title" . -}}
{{ else -}} {{ else }}
{{ $.Scratch.Set "title" .Site.Title -}} {{ with .Title -}}
{{ end -}} {{ $.Scratch.Set "title" . -}}
{{ else -}}
{{ $.Scratch.Set "title" .Site.Title -}}
{{ end -}}
{{ end }}
{{ $description := or (partial "utilities/GetDescription.html" (dict "page" .)) .Site.Params.main.description }} {{ $description := or (partial "utilities/GetDescription.html" (dict "page" . "meta" true)) .Site.Params.main.description }}
{{ if gt (strings.RuneCount $description) 150 }} {{ if gt (strings.RuneCount $description) 150 }}
{{ $description = print (substr $description 0 150) "..." }} {{ $description = print (substr $description 0 150) "..." }}
{{ end }} {{ end }}

View File

@@ -63,7 +63,7 @@
-}} -}}
{{- $options := (dict "transpiler" $transpiler "targetPath" $target "enableSourceMap" (not hugo.IsProduction) "vars" $vars) -}} {{- $options := (dict "transpiler" $transpiler "targetPath" $target "enableSourceMap" (not hugo.IsProduction) "vars" $vars) -}}
{{- $bundle := partial "utilities/bundle" (dict "match" $source "filename" (printf "scss/bundle-%d.scss" now.UnixNano) "modules" $modules "basepath" "scss" "debugging" site.Params.debugging.showSCSS) -}} {{- $bundle := partial "utilities/bundle.html" (dict "match" $source "filename" (printf "scss/bundle-%d.scss" now.UnixNano) "modules" $modules "basepath" "scss" "debugging" site.Params.debugging.showSCSS) -}}
{{- if gt ($bundle.Content | len) 0 }} {{- if gt ($bundle.Content | len) 0 }}
{{- $css := $bundle | resources.ExecuteAsTemplate $target . | toCSS $options -}} {{- $css := $bundle | resources.ExecuteAsTemplate $target . | toCSS $options -}}

View File

@@ -0,0 +1,26 @@
<!--
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.
-->
<!-- Initialize arguments -->
{{ $args := partial "utilities/InitArgs.html" (dict "structure" "script" "args" .) }}
{{ if $args.err }}
{{ partial "utilities/LogErr.html" (dict
"partial" "templates/script.html"
"msg" "Invalid arguments"
"details" $args.errmsg
"file" page.File
)}}
{{ end }}
<!-- Initialize local arguments -->
{{ $category := cond (ne $args.category "other") $args.category "" }}
<!-- Main code -->
<script src="{{ $args.link }}"
{{- with $category }} data-category="{{ . }}"{{ end -}}
{{- with $args.integrity }}integrity="{{ . }}" crossorigin="anonymous"{{ end }}
{{- with $args.state }} {{ . | safeHTMLAttr }}{{ end -}}>
</script>

View File

@@ -1,26 +1,13 @@
{{ $page := .page }}
{{ $core := slice }} {{ $core := slice }}
{{ $optional := slice }} {{ $optional := slice }}
{{ $excludeSCSS := slice }} {{ $excludeSCSS := slice }}
{{ $disableTemplate := slice }} {{ $disableTemplate := slice }}
{{ $localize := slice }} {{ $localize := slice }}
{{ $category := dict }}
{{ $modules := dict }} {{ $modules := dict }}
{{ range $key, $mod := $page.Site.Params.modules }} {{ range $key, $mod := .Site.Params.modules }}
{{ if eq $key "core" }} {{ if reflect.IsMap $mod }}
{{ 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" }} {{ $integration := index $mod "integration" }}
{{ if eq $integration "core" }} {{ if eq $integration "core" }}
{{ $core = $core | append $key }} {{ $core = $core | append $key }}
@@ -42,6 +29,12 @@
{{ $localize = $localize | append $key }} {{ $localize = $localize | append $key }}
{{ end }} {{ end }}
{{ $categoryKey := "other" }}
{{ with (index $mod "category") }}{{ $categoryKey = . }}{{ end }}
{{ $cat := index $category $categoryKey | default slice }}
{{ $cat = $cat | append $key}}
{{ $category = merge $category (dict $categoryKey $cat) }}
{{ $modules = merge $modules (dict $key $mod) }} {{ $modules = merge $modules (dict $key $mod) }}
{{ else }} {{ else }}
{{ warnf "Unsupported module parameter: %s" $key }} {{ warnf "Unsupported module parameter: %s" $key }}
@@ -55,9 +48,10 @@
"excludeSCSS" $excludeSCSS "excludeSCSS" $excludeSCSS
"disableTemplate" $disableTemplate "disableTemplate" $disableTemplate
"localize" $localize "localize" $localize
"categories" $category
}} }}
{{- if and $page.IsPage (not (in $core "bootstrap")) -}} {{- if and .IsPage (not (in $core "bootstrap")) -}}
{{- errorf "Bootstrap is a required module, please add it to 'modules.core' in your site parameters" -}} {{- errorf "Bootstrap is a required module, please add it to 'modules.core' in your site parameters" -}}
{{- end -}} {{- end -}}

View File

@@ -4,12 +4,12 @@
command = "npm run build:example" command = "npm run build:example"
[build.environment] [build.environment]
DART_SASS_VERSION = "1.77.5" DART_SASS_VERSION = "1.78.0"
HUGO_VERSION = "0.131.0" HUGO_VERSION = "0.134.1"
HUGO_ENV = "production" HUGO_ENV = "production"
HUGO_ENABLEGITINFO = "true" HUGO_ENABLEGITINFO = "true"
NODE_VERSION = "20.16.0" NODE_VERSION = "20.17.0"
NPM_VERSION = "10.8.1" NPM_VERSION = "10.8.2"
# toml-docs-end netlify # toml-docs-end netlify
[[headers]] [[headers]]

53
package-lock.json generated
View File

@@ -1,26 +1,26 @@
{ {
"name": "@gethinode/hinode", "name": "@gethinode/hinode",
"version": "0.27.0-alpha4", "version": "0.27.0-alpha8",
"lockfileVersion": 3, "lockfileVersion": 3,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "@gethinode/hinode", "name": "@gethinode/hinode",
"version": "0.27.0-alpha4", "version": "0.27.0-alpha8",
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@fullhuman/postcss-purgecss": "^6.0.0", "@fullhuman/postcss-purgecss": "^6.0.0",
"autoprefixer": "^10.4.20", "autoprefixer": "^10.4.20",
"cssnano": "^7.0.6", "cssnano": "^7.0.6",
"cssnano-preset-advanced": "^7.0.6", "cssnano-preset-advanced": "^7.0.6",
"hugo-bin": "0.131.1", "hugo-bin": "0.131.2",
"purgecss-whitelister": "^2.4.0" "purgecss-whitelister": "^2.4.0"
}, },
"devDependencies": { "devDependencies": {
"@gethinode/netlify-plugin-dartsass": "^0.3.0", "@gethinode/netlify-plugin-dartsass": "^0.3.0",
"eslint": "^9.9.1", "eslint": "^9.10.0",
"markdownlint-cli2": "^0.14.0", "markdownlint-cli2": "^0.14.0",
"neostandard": "^0.11.4", "neostandard": "^0.11.5",
"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",
@@ -381,9 +381,9 @@
} }
}, },
"node_modules/@eslint/js": { "node_modules/@eslint/js": {
"version": "9.9.1", "version": "9.10.0",
"resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.9.1.tgz", "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.10.0.tgz",
"integrity": "sha512-xIDQRsfg5hNBqHz04H1R3scSVwmI+KUbqjsQKHKQ1DAUSaUjYPReZZmS/5PNiKu1fUvzDd6H7DEDKACSEhu+TQ==", "integrity": "sha512-fuXtbiP5GWIn8Fz+LWoOMVf/Jxm+aajZYkhi6CuEm4SxymFM+eUWzbO9qXT+L0iCkL5+KGYMCSGxo686H19S1g==",
"dev": true, "dev": true,
"engines": { "engines": {
"node": "^18.18.0 || ^20.9.0 || >=21.1.0" "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
@@ -398,6 +398,18 @@
"node": "^18.18.0 || ^20.9.0 || >=21.1.0" "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
} }
}, },
"node_modules/@eslint/plugin-kit": {
"version": "0.1.0",
"resolved": "https://registry.npmjs.org/@eslint/plugin-kit/-/plugin-kit-0.1.0.tgz",
"integrity": "sha512-autAXT203ixhqei9xt+qkYOvY8l6LAFIdT2UXc/RPNeUVfqRF1BV94GTJyVPFKT8nFM6MyVJhjLj9E8JWvf5zQ==",
"dev": true,
"dependencies": {
"levn": "^0.4.1"
},
"engines": {
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
}
},
"node_modules/@fullhuman/postcss-purgecss": { "node_modules/@fullhuman/postcss-purgecss": {
"version": "6.0.0", "version": "6.0.0",
"resolved": "https://registry.npmjs.org/@fullhuman/postcss-purgecss/-/postcss-purgecss-6.0.0.tgz", "resolved": "https://registry.npmjs.org/@fullhuman/postcss-purgecss/-/postcss-purgecss-6.0.0.tgz",
@@ -2427,16 +2439,17 @@
} }
}, },
"node_modules/eslint": { "node_modules/eslint": {
"version": "9.9.1", "version": "9.10.0",
"resolved": "https://registry.npmjs.org/eslint/-/eslint-9.9.1.tgz", "resolved": "https://registry.npmjs.org/eslint/-/eslint-9.10.0.tgz",
"integrity": "sha512-dHvhrbfr4xFQ9/dq+jcVneZMyRYLjggWjk6RVsIiHsP8Rz6yZ8LvZ//iU4TrZF+SXWG+JkNF2OyiZRvzgRDqMg==", "integrity": "sha512-Y4D0IgtBZfOcOUAIQTSXBKoNGfY0REGqHJG6+Q81vNippW5YlKjHFj4soMxamKK1NXHUWuBZTLdU3Km+L/pcHw==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"@eslint-community/eslint-utils": "^4.2.0", "@eslint-community/eslint-utils": "^4.2.0",
"@eslint-community/regexpp": "^4.11.0", "@eslint-community/regexpp": "^4.11.0",
"@eslint/config-array": "^0.18.0", "@eslint/config-array": "^0.18.0",
"@eslint/eslintrc": "^3.1.0", "@eslint/eslintrc": "^3.1.0",
"@eslint/js": "9.9.1", "@eslint/js": "9.10.0",
"@eslint/plugin-kit": "^0.1.0",
"@humanwhocodes/module-importer": "^1.0.1", "@humanwhocodes/module-importer": "^1.0.1",
"@humanwhocodes/retry": "^0.3.0", "@humanwhocodes/retry": "^0.3.0",
"@nodelib/fs.walk": "^1.2.8", "@nodelib/fs.walk": "^1.2.8",
@@ -2459,7 +2472,6 @@
"is-glob": "^4.0.0", "is-glob": "^4.0.0",
"is-path-inside": "^3.0.3", "is-path-inside": "^3.0.3",
"json-stable-stringify-without-jsonify": "^1.0.1", "json-stable-stringify-without-jsonify": "^1.0.1",
"levn": "^0.4.1",
"lodash.merge": "^4.6.2", "lodash.merge": "^4.6.2",
"minimatch": "^3.1.2", "minimatch": "^3.1.2",
"natural-compare": "^1.4.0", "natural-compare": "^1.4.0",
@@ -3668,9 +3680,9 @@
} }
}, },
"node_modules/hugo-bin": { "node_modules/hugo-bin": {
"version": "0.131.1", "version": "0.131.2",
"resolved": "https://registry.npmjs.org/hugo-bin/-/hugo-bin-0.131.1.tgz", "resolved": "https://registry.npmjs.org/hugo-bin/-/hugo-bin-0.131.2.tgz",
"integrity": "sha512-bfUFKhQ6felvBNng06vwimNuvV+88yYwU6xTuAoTmtdY0g13Z03pf9rrg3AualxpMOu+dV/Yl/n90EvutKPzIQ==", "integrity": "sha512-5NrvwHUwu67IQywxXcR9IPc44wT7M0h/gtYxd8b8V1lbUsHywTBCRzKbAFMnbaE/pHey2MEVAzpQt6rY2XTXWA==",
"funding": [ "funding": [
{ {
"type": "github", "type": "github",
@@ -4715,14 +4727,13 @@
"dev": true "dev": true
}, },
"node_modules/neostandard": { "node_modules/neostandard": {
"version": "0.11.4", "version": "0.11.5",
"resolved": "https://registry.npmjs.org/neostandard/-/neostandard-0.11.4.tgz", "resolved": "https://registry.npmjs.org/neostandard/-/neostandard-0.11.5.tgz",
"integrity": "sha512-rBdlVeUdM0NhBc2S7Vr/l98Y/FTYY+YGdOqSgv60HzP3LF7ruX9Mceur4Nc/qkXf7UT1IOjofLS7OSLAObPi2A==", "integrity": "sha512-TgCL4CbPtqyoKoCGjqlK71rdbqTzXS9GFqgwyI69Np/Bo+mXVOLqM6mfXAYjEKK0d/TEDsEDVVeLzbVvkqKlmQ==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"@humanwhocodes/gitignore-to-minimatch": "^1.0.2", "@humanwhocodes/gitignore-to-minimatch": "^1.0.2",
"@stylistic/eslint-plugin": "^2.6.3", "@stylistic/eslint-plugin": "^2.6.4",
"@types/eslint": "^9.6.0",
"eslint-plugin-n": "^17.10.2", "eslint-plugin-n": "^17.10.2",
"eslint-plugin-promise": "^7.1.0", "eslint-plugin-promise": "^7.1.0",
"eslint-plugin-react": "^7.35.0", "eslint-plugin-react": "^7.35.0",

View File

@@ -1,6 +1,6 @@
{ {
"name": "@gethinode/hinode", "name": "@gethinode/hinode",
"version": "0.27.0-alpha4", "version": "0.27.0-alpha8",
"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",
@@ -71,14 +71,14 @@
"autoprefixer": "^10.4.20", "autoprefixer": "^10.4.20",
"cssnano": "^7.0.6", "cssnano": "^7.0.6",
"cssnano-preset-advanced": "^7.0.6", "cssnano-preset-advanced": "^7.0.6",
"hugo-bin": "0.131.1", "hugo-bin": "0.131.2",
"purgecss-whitelister": "^2.4.0" "purgecss-whitelister": "^2.4.0"
}, },
"devDependencies": { "devDependencies": {
"@gethinode/netlify-plugin-dartsass": "^0.3.0", "@gethinode/netlify-plugin-dartsass": "^0.3.0",
"eslint": "^9.9.1", "eslint": "^9.10.0",
"markdownlint-cli2": "^0.14.0", "markdownlint-cli2": "^0.14.0",
"neostandard": "^0.11.4", "neostandard": "^0.11.5",
"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",