Skip to content

Commit

Permalink
Add encoded email address to contact page
Browse files Browse the repository at this point in the history
  • Loading branch information
helenclx committed Dec 27, 2024
1 parent 7f97b1a commit 50b42a5
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/.htaccess.njk
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ RewriteRule ^ /%1 [NE,L,R]
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteRule ^(.*)/?$ /$1.php [L]

# Redirect obfuscated email links to mailto link
RewriteRule ^.*{{ sitemeta.siteAuthor.emailDecoyUrl }}.*$ "mailto:{{ sitemeta.siteAuthor.email }}" [R=301,L]

# Block bad bots
RewriteCond %{HTTP_USER_AGENT} ({{ robots.htaccess }}) [NC]
RewriteRule .* https://nocommercialuse.org/ [L]
2 changes: 2 additions & 0 deletions src/_data/sitemeta.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ export const siteUrl = "https://" + siteDomain || "http://localhost:8080";
export const siteAuthor = {
name: "Helen Chong",
email: "contact@helenchong.dev",
emailEncoded: '<span class="email-encoded">contact@helenchong<b>.nospam</b>.dev</span>',
emailDecoyUrl: "emailme/",
url: siteUrl + "/about",
fediverse: {
handle: "@helenchong@social.lol",
Expand Down
1 change: 1 addition & 0 deletions src/assets/css/utility.css
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
.text-center { text-align: center; }
.text-bold { font-weight: 700; }
.el-top-margin { margin-top: 1.5em; }
.email-encoded b { display: none; }

.inline-icon {
display: inline-block;
Expand Down
1 change: 1 addition & 0 deletions src/slashes/headerlinks/contact.njk
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ eleventyNavigation:

<p>Alternately, you can contact me through other methods:</p>
<ul>
<li>Email me directly to <a rel="nofollow, noindex" href="{{ sitemeta.siteAuthor.emailDecoyUrl }}">{{ sitemeta.siteAuthor.emailEncoded | safe }}</a></li>
<li>Fediverse: Ping me or send me a private mention to my Mastodon account at <a href="{{ sitemeta.siteAuthor.fediverse.url }}">{{ sitemeta.siteAuthor.fediverse.handle }}</a></li>
<li>Matrix: Message <code>{{ sitemeta.siteAuthor.matrix }}</code></li>
<li>Signal: Message <code>{{ sitemeta.siteAuthor.signal }}</code></li>
Expand Down

0 comments on commit 50b42a5

Please sign in to comment.