diff options
| author | Alejandro Soto <alejandro@34project.org> | 2025-09-13 15:01:06 -0600 |
|---|---|---|
| committer | Alejandro Soto <alejandro@34project.org> | 2025-09-13 15:01:06 -0600 |
| commit | f4fcda54638685899c730b3fa90a87d80d6dbef5 (patch) | |
| tree | 0737e627cce304c3a9c4e757bc5f6571a7456091 /sysret.org/themes/tabi-lean/templates/partials/footer.html | |
| parent | d8b9cf1f61cc07d625f1c37ccc28adfd58918416 (diff) | |
| parent | 2c13119932765c6d788f08fb53abc244407c0d80 (diff) | |
Merge commit '6a7d3111b31e73fc66af5360149d41f690fbcaa4'
Diffstat (limited to 'sysret.org/themes/tabi-lean/templates/partials/footer.html')
| -rw-r--r-- | sysret.org/themes/tabi-lean/templates/partials/footer.html | 127 |
1 files changed, 127 insertions, 0 deletions
diff --git a/sysret.org/themes/tabi-lean/templates/partials/footer.html b/sysret.org/themes/tabi-lean/templates/partials/footer.html new file mode 100644 index 0000000..db4bd85 --- /dev/null +++ b/sysret.org/themes/tabi-lean/templates/partials/footer.html @@ -0,0 +1,127 @@ +{%- set separator = config.extra.separator | default(value="•") -%} + +{%- set rel_attributes = macros_rel_attributes::rel_attributes() | trim -%} + +{%- set blank_target = macros_target_attribute::target_attribute(new_tab=config.markdown.external_links_target_blank) -%} + +{#- Feed icon -#} +{%- set feed_url = feed_utils::get_feed_url() -%} +{%- set should_show_feed = feed_utils::should_show_footer_feed_icon() == "true" -%} + +{%- set should_show_footer_icons = should_show_feed or config.extra.socials or config.extra.email -%} + +<footer> + <section> + <nav class="socials nav-navs"> + {%- if should_show_footer_icons -%} + <ul> + {%- if should_show_feed -%} + <li> + <a class="nav-links no-hover-padding social" rel="{{ rel_attributes }}" {{ blank_target }} href="{{ get_url(path=feed_url, lang=lang, trailing_slash=false) | safe }}"> + <img loading="lazy" alt="feed" title="feed" src="{{ get_url(path='/social_icons/rss.svg') }}"> + </a> + </li> + {%- endif -%} + + {# Mail icon #} + {%- if config.extra.email -%} + {%- set email_already_encoded = (config.extra.email is not containing("@")) -%} + {%- set email_needs_decoding = email_already_encoded or config.extra.encode_plaintext_email -%} + + {%- if email_already_encoded -%} + {%- set encoded_email = config.extra.email -%} + {# Verify the pre-encoded e-mail is valid (i.e. contains an '@') #} + {%- set decoded_email = encoded_email | base64_decode -%} + {%- if '@' not in decoded_email -%} + {{ throw(message="ERROR: The provided e-mail appears to be base64-encoded, but does not decode to a valid e-mail address.")}} + {%- endif -%} + {%- elif config.extra.encode_plaintext_email -%} + {%- set encoded_email = config.extra.email | base64_encode -%} + {%- endif -%} + + <li class="{% if email_needs_decoding %}js{% endif %}"> + {%- if email_needs_decoding -%} + <a class="nav-links no-hover-padding social" href="#" data-encoded-email="{{ encoded_email | safe }}"> + {%- else -%} + <a class="nav-links no-hover-padding social" href="mailto:{{ config.extra.email | safe }}"> + {%- endif -%} + <img loading="lazy" alt="email" title="email" src="{{ get_url(path='social_icons/email.svg') }}"> + </a> + </li> + {%- endif -%} + + {%- if config.extra.socials %} + {% for social in config.extra.socials %} + <li> + <a class="nav-links no-hover-padding social" rel="{{ rel_attributes }} me" {{ blank_target }} href="{{ social.url | safe }}"> + <img loading="lazy" alt="{{ social.name }}" title="{{ social.name }}" src="{{ get_url(path='social_icons/' ~ social.icon ~ '.svg') }}"> + </a> + </li> + {% endfor %} + {% endif %} + </ul> + {% endif %} + </nav> + + {# Footer menu #} + <nav class="nav-navs"> + {%- if config.extra.footer_menu %} + <small> + <ul> + {% for menu in config.extra.footer_menu %} + <li> + {%- set trailing_slash = menu.trailing_slash | default(value=true) -%} + + {%- if menu.url == "sitemap.xml" -%} + {%- set url = get_url(path=menu.url, trailing_slash=trailing_slash) -%} + {%- elif menu.url is starting_with("http") -%} + {%- if menu.trailing_slash -%} + {%- set url = menu.url ~ "/" -%} + {%- else -%} + {%- set url = menu.url -%} + {%- endif -%} + {%- else -%} + {%- set url = get_url(path=menu.url, lang=lang, trailing_slash=trailing_slash) -%} + {%- endif -%} + + <a class="nav-links no-hover-padding" href="{{ url }}"> + {{ macros_translate::translate(key=menu.name, default=menu.name, language_strings=language_strings) }} + </a> + </li> + {% endfor %} + </ul> + </small> + {% endif %} + </nav> + + <div class="credits"> + <small> + {% include "partials/copyright.html" %} + + {# Shows "Powered by Zola & tabi" notice #} + {{ macros_translate::translate(key="powered_by", default="Powered by", language_strings=language_strings) }} + <a rel="{{ rel_attributes }}" {{ blank_target }} href="https://www.getzola.org">Zola</a> + {{ macros_translate::translate(key="and", default="&", language_strings=language_strings) }} + <a rel="{{ rel_attributes }}" {{ blank_target }} href="https://github.com/welpo/tabi">tabi</a> + + {# Shows link to remote repository #} + {%- if config.extra.remote_repository_url and config.extra.show_remote_source | default(value=true) -%} + {{ separator }} + <a rel="{{ rel_attributes }}" {{ blank_target }} href="{{ config.extra.remote_repository_url }}"> + {{ macros_translate::translate(key="site_source", default="Site source", language_strings=language_strings) }} + </a> + {%- endif -%} + </small> + </div> + </section> + + {# Load the decoding script if email is encoded #} + {%- if email_needs_decoding -%} + <script src="{{ get_url(path='js/decodeMail.min.js') }}" async></script> + {%- endif -%} + + {# Modal structure for search #} + {%- if config.build_search_index -%} + {% include "partials/search_modal.html" %} + {%- endif -%} +</footer> |
