From 2aaa280bfdc602d39eba94355dd5ad6a9b5e9d76 Mon Sep 17 00:00:00 2001 From: Max Mehl Date: Thu, 19 Sep 2024 11:15:20 +0200 Subject: [PATCH] use modified cloakemail shortcode plugin that implements the partial functionality --- .gitmodules | 3 ++ config.yaml | 2 +- themes/hugo-cloak-email | 1 + .../openrail/layouts/partials/cloakemail.html | 42 ------------------- 4 files changed, 5 insertions(+), 43 deletions(-) create mode 160000 themes/hugo-cloak-email delete mode 100644 themes/openrail/layouts/partials/cloakemail.html diff --git a/.gitmodules b/.gitmodules index 7120c1e..772e979 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,6 @@ [submodule "themes/hugomods-images"] path = themes/hugomods-images url = https://github.com/hugomods/images.git +[submodule "themes/hugo-cloak-email"] + path = themes/hugo-cloak-email + url = https://github.com/martignoni/hugo-cloak-email.git diff --git a/config.yaml b/config.yaml index 42f5c2e..5ac1dd2 100644 --- a/config.yaml +++ b/config.yaml @@ -2,7 +2,7 @@ ## Basic Configuration ## ----------------------------------------------- -theme: ["openrail", "hugomods-images"] +theme: ["openrail", "hugomods-images", "hugo-cloak-email"] title: OpenRail Association copyright: "{year}" diff --git a/themes/hugo-cloak-email b/themes/hugo-cloak-email new file mode 160000 index 0000000..226f4d1 --- /dev/null +++ b/themes/hugo-cloak-email @@ -0,0 +1 @@ +Subproject commit 226f4d1891b961a7bd8f696775d40982a0fb3310 diff --git a/themes/openrail/layouts/partials/cloakemail.html b/themes/openrail/layouts/partials/cloakemail.html deleted file mode 100644 index 3b65a3e..0000000 --- a/themes/openrail/layouts/partials/cloakemail.html +++ /dev/null @@ -1,42 +0,0 @@ -{{/* - SPDX-FileCopyrightText: Copyright © 2019 onwards, Nicolas Martignoni - SPDX-License-Identifier: GPL-3.0-only -*/}} -{{/* Get address, protocol and other parameters */}} -{{- $address := .address -}} -{{- $protocol := .protocol | default "mailto" -}} -{{- $class := .class -}} -{{- $displaytext := .display -}} -{{- $parts := split $address "@" -}} -{{- $user := (index $parts 0) -}} -{{- $domain := (index $parts 1) | default "" -}} -{{- $query := .query | default "" -}} -{{/* Compute md5 fingerprint */}} -{{- $fingerprint := md5 (print $address $protocol (index (seq 999 | shuffle) 0)) | truncate 8 "" -}} -{{/* Set via CSS what is displayed when Javascript is disabled. Query is never displayed */}} - - -{{/* Alter display with Javascript by changing DOM */}} - -{{/* The end */}}