diff options
| author | Jieiku | 2022-07-21 13:18:15 -0700 |
|---|---|---|
| committer | Jieiku | 2022-07-21 13:18:15 -0700 |
| commit | 72ed630089e1aaa7d8ed88fd3b4d03d55af52326 (patch) | |
| tree | 463d7986b0d12467515bdb2893fbc8bb00a827fb /templates | |
| parent | ef6a407d837940704f5bb6137b77954f63eb74df (diff) | |
| download | abridge-72ed630089e1aaa7d8ed88fd3b4d03d55af52326.tar.gz abridge-72ed630089e1aaa7d8ed88fd3b4d03d55af52326.tar.bz2 abridge-72ed630089e1aaa7d8ed88fd3b4d03d55af52326.zip | |
email obfuscation
Diffstat (limited to 'templates')
| -rw-r--r-- | templates/macros/head.html | 28 | ||||
| -rw-r--r-- | templates/macros/social.html | 8 |
2 files changed, 27 insertions, 9 deletions
diff --git a/templates/macros/head.html b/templates/macros/head.html index b942f3e..8ebceb5 100644 --- a/templates/macros/head.html +++ b/templates/macros/head.html @@ -88,18 +88,24 @@ {%- if config.extra.js_prestyle %} <script defer src="{{ get_url(path=config.extra.js_prestyle, trailing_slash=false, cachebust=true) | safe }}"{%- if config.extra.integrity %} integrity="sha384-{{ get_file_hash(path=config.extra.js_prestyle, sha_type=384, base64=true) | safe }}"{%- endif %}></script> {%- endif %} - {%- endif %} - {%- if config.extra.js_codecopy %} - <script defer src="{{ get_url(path=config.extra.js_codecopy, trailing_slash=false, cachebust=true) | safe }}"{%- if config.extra.integrity %} integrity="sha384-{{ get_file_hash(path=config.extra.js_codecopy, sha_type=384, base64=true) | safe }}"{%- endif %}></script> {%- endif %} - {%- if config.extra.js_theme %} {%- if config.extra.js_themeButton %} <script defer src="{{ get_url(path=config.extra.js_themeButton, trailing_slash=false) | safe }}"{%- if config.extra.integrity %} integrity="sha384-{{ get_file_hash(path=config.extra.js_themeButton, sha_type=384, base64=true) | safe }}"{%- endif %}></script> {%- endif %} {%- endif %} + {%- if config.extra.js_email %} + {%- if config.extra.social.mail_encode %} + <script defer src="{{ get_url(path=config.extra.js_email, trzailing_slash=false, cachebust=true) | safe }}"{%- if config.extra.integrity %} integrity="sha384-{{ get_file_hash(path=config.extra.js_email, sha_type=384, base64=true) | safe }}"{%- endif %}></script> + {%- endif %} + {%- endif %} + + {%- if config.extra.js_codecopy %} + <script defer src="{{ get_url(path=config.extra.js_codecopy, trailing_slash=false, cachebust=true) | safe }}"{%- if config.extra.integrity %} integrity="sha384-{{ get_file_hash(path=config.extra.js_codecopy, sha_type=384, base64=true) | safe }}"{%- endif %}></script> + {%- endif %} + {%- if config.extra.js_search_index %} <script defer src="{{ get_url(path=config.extra.js_search_index, trailing_slash=false, cachebust=true) | safe }}"{%- if config.extra.integrity %} integrity="sha384-{{ get_file_hash(path=config.extra.js_search_index, sha_type=384, base64=true) | safe }}"{%- endif %}></script> {%- endif %} @@ -123,16 +129,22 @@ {%- endif %} {%- endif %} - {%- if config.extra.js_codecopy %} - <script defer src="{{ get_url(path=config.extra.js_codecopy, trailing_slash=false, cachebust=true) | safe }}"{%- if config.extra.integrity %} integrity="sha384-{{ get_file_hash(path=config.extra.js_codecopy, sha_type=384, base64=true) | safe }}"{%- endif %}></script> - {%- endif %} - {%- if config.extra.js_theme %} {%- if config.extra.js_themeButton or config.extra.js_bundle %} <script defer src="{{ get_url(path=config.extra.js_themeButton, trailing_slash=false) | safe }}"{%- if config.extra.integrity %} integrity="sha384-{{ get_file_hash(path=config.extra.js_themeButton, sha_type=384, base64=true) | safe }}"{%- endif %}></script> {%- endif %} {%- endif %} + {%- if config.extra.js_email %} + {%- if config.extra.social.mail_encode %} + <script defer src="{{ get_url(path=config.extra.js_email, trailing_slash=false, cachebust=true) | safe }}"{%- if config.extra.integrity %} integrity="sha384-{{ get_file_hash(path=config.extra.js_email, sha_type=384, base64=true) | safe }}"{%- endif %}></script> + {%- endif %} + {%- endif %} + + {%- if config.extra.js_codecopy %} + <script defer src="{{ get_url(path=config.extra.js_codecopy, trailing_slash=false, cachebust=true) | safe }}"{%- if config.extra.integrity %} integrity="sha384-{{ get_file_hash(path=config.extra.js_codecopy, sha_type=384, base64=true) | safe }}"{%- endif %}></script> + {%- endif %} + {%- endif %} diff --git a/templates/macros/social.html b/templates/macros/social.html index e2786ef..0c704bf 100644 --- a/templates/macros/social.html +++ b/templates/macros/social.html @@ -5,7 +5,13 @@ {%- if config.generate_feed -%}{%- if config.extra.social.feed -%} <li><a href="{{ get_url(path=config.feed_filename, trailing_slash=false) | safe }}" target="_blank" title="Atom/RSS Feed"><i type="Button" class="svg rss" title="Atom/RSS Feed"></i></a></li>{% endif -%}{% endif -%} {%- if social_config.mail -%} - <li><a href="mailto:{{ social_config.mail }}" target="_blank" title="Mail"><i type="Button" class="svg mail" title="Mail"></i></a></li>{% endif -%} + {%- if social_config.mail_encode -%} + {%- set base64_email = "abridge" ~ social_config.mail -%} + <li class="js"><a class="m-protected" href="#" target="_blank" title="{{ base64_email | base64_encode }}"><i type="Button" class="svg mail" title="Mail"></i></a></li> + {%- else -%} + <li><a href="mailto:{{ social_config.mail }}" target="_blank" title="Mail"><i type="Button" class="svg mail" title="Mail"></i></a></li> + {%- endif -%} + {% endif -%} {%- if social_config.mastodon -%} <li><a href="{{ social_config.mastodon }}/" target="_blank" title="Mastodon"><i type="Button" class="svg mastodon" title="Mastodon"></i></a></li>{% endif -%} {%- if social_config.element -%} |
