mirror of
				https://github.com/welpo/tabi.git
				synced 2025-11-04 01:50:24 +01:00 
			
		
		
		
	Adds two options, both defaulting to true if the remote repo URL is set: * `show_remote_changes`: links the commit history of a post next to the updated date. (#109) * `show_remote_source`: links to the site's repository on the footer.
		
			
				
	
	
		
			89 lines
		
	
	
	
		
			4.7 KiB
		
	
	
	
		
			HTML
		
	
	
	
	
	
			
		
		
	
	
			89 lines
		
	
	
	
		
			4.7 KiB
		
	
	
	
		
			HTML
		
	
	
	
	
	
{% set separator = config.extra.separator | default(value="•") %}
 | 
						|
<footer>
 | 
						|
    <section>
 | 
						|
        <nav class="socials nav-navs">
 | 
						|
            {%- if config.extra.socials %}
 | 
						|
                <ul>
 | 
						|
                    {%- if config.generate_feed and config.extra.feed_icon -%}
 | 
						|
                    <li>
 | 
						|
                        <a rel="noopener noreferrer" target="_blank" class="nav-links no-hover-padding social" href={{ get_url(path=config.feed_filename, lang=lang, trailing_slash=false) | safe }}>
 | 
						|
                        <img 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 rel="noopener noreferrer" target="_blank" class="nav-links no-hover-padding social" href="#" data-encoded-email="{{ encoded_email | safe }}">
 | 
						|
                            {%- else -%}
 | 
						|
                                <a rel="noopener noreferrer" target="_blank" class="nav-links no-hover-padding social" href="mailto:{{ config.extra.email | safe }}">
 | 
						|
                            {%- endif -%}
 | 
						|
                                <img alt="email" title="email" src="{{ get_url(path='social_icons/email.svg') }}">
 | 
						|
                            </a>
 | 
						|
                        </li>
 | 
						|
                    {%- endif -%}
 | 
						|
 | 
						|
                    {% for social in config.extra.socials %}
 | 
						|
                        <li>
 | 
						|
                            <a rel="noopener noreferrer me" target="_blank" class="nav-links no-hover-padding social" href={{ social.url | safe }}>
 | 
						|
                                <img alt={{ social.name }} title={{ social.name }} src="{{ get_url(path='social_icons/' ~ social.icon ~ '.svg') }}">
 | 
						|
                            </a>
 | 
						|
                        </li>
 | 
						|
                    {% endfor %}
 | 
						|
                </ul>
 | 
						|
            {% endif %}
 | 
						|
        </nav>
 | 
						|
        <div class="credits">
 | 
						|
            {# Shows "Powered by Zola & tabi" #}
 | 
						|
            {# Shows link to remote repository if repository is set and `show_remote_source` is not false #}
 | 
						|
            {% set show_source = config.extra.show_remote_source | default(value=true) %}
 | 
						|
            <small>
 | 
						|
                {%- if lang != config.default_language -%} 
 | 
						|
                    {{ trans(key="powered_by" | safe, lang=lang) }} 
 | 
						|
                {%- else -%} 
 | 
						|
                    Powered by
 | 
						|
                {%- endif -%} 
 | 
						|
                 <a href="https://www.getzola.org" target="_blank">Zola</a> 
 | 
						|
        
 | 
						|
                {%- if lang != config.default_language -%}
 | 
						|
                    {{ trans(key="and" | safe, lang=lang) }} 
 | 
						|
                {%- else -%} 
 | 
						|
                    &
 | 
						|
                {%- endif -%} 
 | 
						|
                 <a href="https://github.com/welpo/tabi" target="_blank">tabi</a>
 | 
						|
 | 
						|
                {%- if config.extra.remote_repository_url and show_source -%}
 | 
						|
                 {{ separator }}
 | 
						|
                    <a href="{{ config.extra.remote_repository_url }}" target="_blank">
 | 
						|
                        {%- if lang != config.default_language -%}
 | 
						|
                            {{ trans(key="site_source" | safe, lang=lang) }}
 | 
						|
                        {%- else -%}
 | 
						|
                            Site source
 | 
						|
                        {%- endif -%}
 | 
						|
                    </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 -%}
 | 
						|
</footer>
 |