🔒 Add config parameter fingerprintAlgorithm

This parameter allows users to choose their algorithm for html integrity checks. This mainly affects Hugo's fingerprint
This commit is contained in:
Served Smart
2025-06-02 12:40:58 +02:00
parent 0b06a64139
commit dc36597427
15 changed files with 28 additions and 20 deletions
+2
View File
@@ -30,6 +30,8 @@ highlightCurrentMenuArea = true
smartTOC = true
smartTOCHideUnfocusedChildren = false
fingerprintAlgorithm = "sha512" # Valid values are "sha512" (default), "sha384", "sha256"
[header]
layout = "fixed" # valid options: basic, fixed, fixed-fill, fixed-gradient, fixed-fill-blur
@@ -186,6 +186,7 @@ Many of the article defaults here can be overridden on a per article basis by sp
| `highlightCurrentMenuArea` | _Not set_ | Marks menu entries in the main menu when selected |
| `smartTOC` | _Not set_ | Activate smart Table of Contents, items in view will be highlighted. |
| `smartTOCHideUnfocusedChildren` | _Not set_ | When smart Table of Contents is turned on, this will hide deeper levels of the table when they are not in focus. |
| `fingerprintAlgorithm` | `"sha512"` | This configures the fingerprint or resources.Fingerprint used in .Data.Integrity for files provided by the theme. Valid values are `sha512` (default), `sha384`, `sha256` |
### Header
@@ -186,6 +186,7 @@ Blowfish は、テーマの機能を制御する多数の設定パラメータ
| `highlightCurrentMenuArea` | _未設定_ | メインメニューのメニュー項目が選択されているときにマークを付けます。 |
| `smartTOC` | _未設定_ | スマート目次をアクティブにします。表示されている項目が強調表示されます。 |
| `smartTOCHideUnfocusedChildren` | _未設定_ | スマート目次がオンになっている場合、フォーカスされていないときに、テーブルのより深いレベルが非表示になります。 |
| `fingerprintAlgorithm` | `"sha512"` | This configures the fingerprint or resources.Fingerprint used in .Data.Integrity for files provided by the theme. Valid values are `sha512` (default), `sha384`, `sha256` |
### ヘッダー(Header)
@@ -192,6 +192,7 @@ Many of the article defaults here can be overridden on a per article basis by sp
| `highlightCurrentMenuArea` | _Not set_ | Marks menu entries in the main menu when selected |
| `smartTOC` | _Not set_ | Activate smart Table of Contents, items in view will be highlighted. |
| `smartTOCHideUnfocusedChildren` | _Not set_ | When smart Table of Contents is turned on, this will hide deeper levels of the table when they are not in focus. |
| `fingerprintAlgorithm` | `"sha512"` | This configures the fingerprint or resources.Fingerprint used in .Data.Integrity for files provided by the theme. Valid values are `sha512` (default), `sha384`, `sha256` |
### Header
@@ -190,6 +190,7 @@ Blowfish 提供了大量控制主题功能的配置参数,下面的表格中
| `highlightCurrentMenuArea` | 无 | 当菜单被选择时,标记主菜单中的菜单项。 |
| `smartTOC` | 无 | 开启智能目录,视图中的项目将会被高亮显示。 |
| `smartTOCHideUnfocusedChildren` | 无 | 当开启智能目录,如果目录级别不再被聚焦时,将会隐藏更深层次的目录。 |
| `fingerprintAlgorithm` | `"sha512"` | This configures the fingerprint or resources.Fingerprint used in .Data.Integrity for files provided by the theme. Valid values are `sha512` (default), `sha384`, `sha256` |
### 页头
@@ -1,4 +1,4 @@
{{ $jsHome := resources.Get "js/home.js" | resources.Minify | resources.Fingerprint "sha512" }}
{{ $jsHome := resources.Get "js/home.js" | resources.Minify | resources.Fingerprint (.Site.Params.fingerprintAlgorithm | default "sha512") }}
<div id="background">
{{ partial "home/background.html" . }}
</div>