From 804259f5f9932fbcec50d5d7f88be4dc0f5592d2 Mon Sep 17 00:00:00 2001 From: James Panther <4462786+jpanther@users.noreply.github.com> Date: Mon, 24 Feb 2025 11:09:55 +1100 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Ensure=20vendor=20scripts=20use?= =?UTF-8?q?=20`fingerprintAlgorithm`=20site=20param?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes: #1015 --- CHANGELOG.md | 1 + layouts/partials/vendor.html | 11 ++++++----- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 14d8db0..913fcd1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -24,6 +24,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), ### Fixed - Incorrect links generated for translated content when site is in multi-host mode ([#990](https://github.com/jpanther/congo/pull/990)) +- Vendor script includes do not use the `fingerprintAlgorithm` site parameter ([#1015](https://github.com/jpanther/congo/issues/1015)) - Minor documentation errors and omissions ([#985](https://github.com/jpanther/congo/pull/985), [#1005](https://github.com/jpanther/congo/pull/1005), [#1007](https://github.com/jpanther/congo/pull/1007), [#1012](https://github.com/jpanther/congo/pull/1012)) - References to deprecated `twitter` shortcodes and replaced them with `x` diff --git a/layouts/partials/vendor.html b/layouts/partials/vendor.html index e3e7297..3ee1094 100644 --- a/layouts/partials/vendor.html +++ b/layouts/partials/vendor.html @@ -1,9 +1,10 @@ +{{ $algorithm := .Site.Params.fingerprintAlgorithm | default "sha256" }} {{/* Mermaid */}} {{ if .Page.HasShortcode "mermaid" }} {{ $mermaidLib := resources.Get "lib/mermaid/mermaid.min.js" }} {{ $mermaidConfig := resources.Get "js/mermaid.js" }} {{ $mermaidConfig := $mermaidConfig | resources.Minify }} - {{ $mermaidJS := slice $mermaidLib $mermaidConfig | resources.Concat "js/mermaid.bundle.js" | resources.Fingerprint "sha512" }} + {{ $mermaidJS := slice $mermaidLib $mermaidConfig | resources.Concat "js/mermaid.bundle.js" | resources.Fingerprint $algorithm }} {{ $katexRenderJS := resources.Get "lib/katex/auto-render.min.js" }} - {{ $katexRenderJS := $katexRenderJS | resources.Fingerprint "sha512" }} + {{ $katexRenderJS := $katexRenderJS | resources.Fingerprint $algorithm }}