diff --git a/static/css/lightbox.css b/assets/css/lightbox.css similarity index 100% rename from static/css/lightbox.css rename to assets/css/lightbox.css diff --git a/static/js/lightbox.js b/assets/js/lightbox.js similarity index 100% rename from static/js/lightbox.js rename to assets/js/lightbox.js diff --git a/assets/js/link-interaction.js b/assets/js/link-interaction.js new file mode 100644 index 0000000..29f9099 --- /dev/null +++ b/assets/js/link-interaction.js @@ -0,0 +1,47 @@ +"use strict"; + +document.addEventListener("DOMContentLoaded", function () { + const listener = new Listener(); + + listener.decode = function () { + const a = document.getElementById("link-interaction"); + + a.setAttribute( + "href", + a + .getAttribute("href") + .replace("o", "qual.luck1288") + .replace("-", "@") + .replaceAll("R-", "j") + .replace("/", "tunjyf.com") + .replace("t", "mailto:e"), + ); + }; + + listener.on(); +}); + +// Listener + +function Listener() {} + +Listener.prototype.decode = null; + +Listener.prototype.on = function () { + this.listener = this.__onInteraction.bind(this); + + document.addEventListener("mouseenter", this.listener, true); + document.addEventListener("focus", this.listener, true); +}; + +Listener.prototype.off = function () { + document.removeEventListener("mouseenter", this.listener, true); + document.removeEventListener("focus", this.listener, true); + + delete this.listener; +}; + +Listener.prototype.__onInteraction = function () { + this.off(); + this.decode(); +}; diff --git a/assets/js/text-interaction.js b/assets/js/text-interaction.js new file mode 100644 index 0000000..1949b0d --- /dev/null +++ b/assets/js/text-interaction.js @@ -0,0 +1,45 @@ +"use strict"; + +document.addEventListener("DOMContentLoaded", function () { + const listener = new Listener(); + + listener.decode = function () { + const email = document.getElementById("text-interaction").firstChild; + + email.nodeValue = email.nodeValue + .replace("ity ", ".") + .replaceAll("Y", "y1288") + .replace(" ", "@") + .replace("north", "qtztsjo") + .replace(" side", "smprqmgtunj") + .replaceAll(" ", ".") + .replace(".stream", "yf"); + }; + + listener.on(); +}); + +// Listener + +function Listener() {} + +Listener.prototype.decode = null; + +Listener.prototype.on = function () { + this.listener = this.__onInteraction.bind(this); + + document.addEventListener("mouseenter", this.listener, true); + document.addEventListener("focus", this.listener, true); +}; + +Listener.prototype.off = function () { + document.removeEventListener("mouseenter", this.listener, true); + document.removeEventListener("focus", this.listener, true); + + delete this.listener; +}; + +Listener.prototype.__onInteraction = function () { + this.off(); + this.decode(); +}; diff --git a/config/_default/config.toml b/config/_default/config.toml index 985244c..c53c5f3 100644 --- a/config/_default/config.toml +++ b/config/_default/config.toml @@ -132,3 +132,9 @@ taxonomy = [ "HTML" ] name = "date" weight = 10 +# [module] +# [[module.mounts]] +# source = 'assets' +# target = 'assets' +# # excludeFiles = ['posts/**/*.drawio'] +# excludeFiles = ['js/*-interaction.js', 'js/lightbox.js'] diff --git a/content/about/index.md b/content/about/index.md index b7a0207..0a14e21 100644 --- a/content/about/index.md +++ b/content/about/index.md @@ -4,7 +4,7 @@ date: 2019-08-21 coverCaption: > Längenfeld at the evening. Photo taken near [Astlehn/Fischbach](https://www.openstreetmap.org/?mlat=47.062377833333336&mlon=10.959586666666667#map=15/47.062377833333336/10.959586666666667). -lastmod: 2024-12-26T15:26:56+0000 +lastmod: 2024-12-26T18:00:04+0000 comment: false showDate: false @@ -123,7 +123,8 @@ any time (although it is online since 2019 -- I used other domain names before t **_These are new keys since Dec 24 2024!_** {.lead} -Use equal.luck1288+nospam@qtztsjosmprqmgtunjyf.com.example.com +Use equality luckY north side stream.com to send me emails. Feel free to encrypt your message with OpenPGP: diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html index 2fe202e..97cfd87 100644 --- a/layouts/_default/baseof.html +++ b/layouts/_default/baseof.html @@ -47,8 +47,6 @@ {{- partial "search.html" . -}} {{ end }} - - diff --git a/layouts/partials/extend-head.html b/layouts/partials/extend-head.html index 6556b19..e592460 100644 --- a/layouts/partials/extend-head.html +++ b/layouts/partials/extend-head.html @@ -1,2 +1,55 @@ {{ partial "plausible_head.html" . }} + +{{ with resources.Get "js/text-interaction.js" }} + {{ if hugo.IsDevelopment }} + {{ with . | js.Build }} + + {{ end }} + {{ else }} + {{ $opts := (dict "minify" true "targetPath" "js/txt.js") }} + {{ with . | js.Build $opts | fingerprint }} + + {{ end }} + {{ end }} +{{ end }} + +{{ with resources.Get "js/link-interaction.js" }} + {{ if hugo.IsDevelopment }} + {{ with . | js.Build }} + + {{ end }} + {{ else }} + {{ $opts := (dict "minify" true "targetPath" "js/lnk.js") }} + {{ with . | js.Build $opts | fingerprint }} + + {{ end }} + {{ end }} +{{ end }} + +{{ with resources.Get "js/lightbox.js" }} + {{ if hugo.IsDevelopment }} + {{ with . | js.Build }} + + {{ end }} + {{ else }} + {{ $opts := (dict "minify" true "targetPath" "js/lightbox.js") }} + {{ with . | js.Build $opts | fingerprint }} + + {{ end }} + {{ end }} +{{ end }} + +{{ with resources.Get "css/lightbox.css" }} + {{ if hugo.IsDevelopment }} + {{ with . }} + + {{ end }} + {{ else }} + {{ with . | fingerprint }} + + {{ end }} + {{ end }} +{{ end }} + +