chore: improve email protect
parent
f50fb32988
commit
1d6df79e17
|
@ -3,6 +3,7 @@
|
|||
"editor.codeActionsOnSave": {
|
||||
"source.fixAll": true
|
||||
},
|
||||
"editor.wordWrap": "on",
|
||||
"markdownlint.config": {
|
||||
"single-h1": false,
|
||||
"no-inline-html": false,
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
document.querySelectorAll('a[data-href]').forEach((element) => {
|
||||
element.href = atob(element.dataset.href);
|
||||
delete element.dataset.href;
|
||||
})
|
||||
|
||||
document.querySelectorAll('a[href^="mailto:"]').forEach((element) => {
|
||||
element.href = atob(element.href.replace(/^mailto:/, ''));
|
||||
});
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{{- if hasPrefix .Destination "mailto:" -}}
|
||||
{{- $text := replace (replace .Text "-" "--") "_" "__" -}}
|
||||
{{- $icon := resources.GetRemote (printf "https://img.shields.io/badge/email-%s-blue.svg?style=flat-square" $text) -}}
|
||||
<a class="email" data-href="{{ .Destination | base64Encode }}"><img class="shields-icon" src="{{ $icon.Permalink }}" /></a>
|
||||
<a href="mailto:{{ .Destination | base64Encode }}"><img class="shields-icon" src="{{ $icon.Permalink }}" /></a>
|
||||
{{- else -}}
|
||||
<a href="{{ .Destination }}"{{ with .Title}} title="{{ . }}"{{ end }}{{ if hasPrefix .Destination "http" }} target="_blank"{{ end }}>
|
||||
{{- .Text | safeHTML -}}
|
||||
|
|
Loading…
Reference in New Issue