refactor: use base64 encode protect email address
parent
552dafbebf
commit
880c35f9d1
|
@ -0,0 +1,5 @@
|
|||
document.querySelectorAll('a[data-href]').forEach((element) => {
|
||||
element.href = atob(element.dataset.href);
|
||||
delete element.dataset.href;
|
||||
})
|
||||
|
|
@ -5,8 +5,7 @@ img.shields-icon {
|
|||
|
||||
a.github-profile {
|
||||
color: inherit;
|
||||
cursor: pointer;
|
||||
text-decoration: none;
|
||||
text-decoration: none !important;
|
||||
display: inline-block;
|
||||
vertical-align: middle;
|
||||
img {
|
||||
|
|
|
@ -22,6 +22,9 @@ hostName = "https://mtf.wiki"
|
|||
custom_css = [
|
||||
"customize.scss"
|
||||
]
|
||||
custom_js = [
|
||||
"customize.js"
|
||||
]
|
||||
|
||||
[markup]
|
||||
[markup.goldmark]
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{{- if hasPrefix .Destination "mailto:" -}}
|
||||
{{- $badge := replace (replace .Text "-" "--") "_" "__" -}}
|
||||
<a href="{{ .Destination }}"><img class="shields-icon" src="https://img.shields.io/badge/email-{{ $badge }}-blue?style=flat-square" /></a>
|
||||
<a class="email" data-href="{{ .Destination | base64Encode }}"><img class="shields-icon" src="https://img.shields.io/badge/email-{{ $badge }}-blue?style=flat-square" /></a>
|
||||
{{- else -}}
|
||||
<a href="{{ .Destination }}"{{ with .Title}} title="{{ . }}"{{ end }}{{ if hasPrefix .Destination "http" }} target="_blank"{{ end }}>
|
||||
{{- .Text | safeHTML -}}
|
||||
|
|
Loading…
Reference in New Issue