Merge pull request #2837 from schneekluth/feat-email-shortcode

Shortcode for obfuscated mailto email link
This commit is contained in:
Nuno C.
2026-04-13 22:29:29 +01:00
committed by GitHub
3 changed files with 29 additions and 2 deletions
+9 -2
View File
@@ -79,7 +79,14 @@
"{{< /chart >}}" "{{< /chart >}}"
], ],
"description": "Use the Chart.js library to embed charts into articles using simple structured data. Blowfish chart Shortcode. Documentation: https://blowfish.page/docs/shortcodes/#chart ", "description": "Use the Chart.js library to embed charts into articles using simple structured data. Blowfish chart Shortcode. Documentation: https://blowfish.page/docs/shortcodes/#chart ",
}, },
"email": {
"prefix": ["BFS-email", "HSC-email", "email"],
"body": [
"{{< email email=\"mailto:${1:hello@test.com}\" text=\"${2:text}\" subject=\"${3:Reply to awesome article}\" >}}$0",
],
"description": "Creates an obfuscated mailto link. Documentation: https://blowfish.page/docs/shortcodes/#email ",
},
"figure": { "figure": {
"prefix": ["BFS-figure", "HSC-figure", "figure"], "prefix": ["BFS-figure", "HSC-figure", "figure"],
"body": [ "body": [
@@ -255,4 +262,4 @@
"description": "Typewriter-Like text. Blowfish typeit Shortcode. Documentation: https://blowfish.page/docs/shortcodes/#typeit https://www.typeitjs.com/docs/vanilla/usage/ ", "description": "Typewriter-Like text. Blowfish typeit Shortcode. Documentation: https://blowfish.page/docs/shortcodes/#typeit https://www.typeitjs.com/docs/vanilla/usage/ ",
}, },
} }
@@ -376,6 +376,18 @@ This shortcode is for importing code from external sources easily without copyin
<br/><br/><br/> <br/><br/><br/>
## Email
Creates an obfuscated mailto link:
```md
{{</* email email="mailto:hello@test.com" text="text" subject="Reply to awesome article" */>}}
```
{{< email email="mailto:hello@test.com" text="text" subject="Reply to awesome article" >}}
<br/><br/><br/>
## Figure ## Figure
Blowfish includes a `figure` shortcode for adding images to content. The shortcode replaces the base Hugo functionality in order to provide additional performance benefits. Blowfish includes a `figure` shortcode for adding images to content. The shortcode replaces the base Hugo functionality in order to provide additional performance benefits.
+8
View File
@@ -0,0 +1,8 @@
<a
class="email-link"
href="#"
data-email="{{ .Get "email" | base64Encode }}"
{{ with .Get "subject" }}data-subject="{{ . }}"{{ end }}>
{{- .Get "text" -}}
</a>
{{- /**/ -}}