aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBryan Brattlof <hello@bryanbrattlof.com>2020-04-25 21:11:43 -0400
committerBryan Brattlof <hello@bryanbrattlof.com>2020-04-25 21:18:26 -0400
commit33988d5a36b640a1966a5907c40e1b7c0d3fd4d3 (patch)
treeb0d0e3850e5631805d8dcd3dc167710cfd8490ff
parent648711e7afeaa7acfc1317c83caff60eb06773bb (diff)
downloadbryanbrattlof.com-33988d5a36b640a1966a5907c40e1b7c0d3fd4d3.tar.gz
bryanbrattlof.com-33988d5a36b640a1966a5907c40e1b7c0d3fd4d3.tar.bz2
add support for external links in footer
if the links defined in the pelican config start with 'http' we can assume they will point to an external domain and don't need to be prefaced with SITEURL in the footer template
-rw-r--r--templates/sections/footer.html37
1 files changed, 16 insertions, 21 deletions
diff --git a/templates/sections/footer.html b/templates/sections/footer.html
index b595524..bfdf9fc 100644
--- a/templates/sections/footer.html
+++ b/templates/sections/footer.html
@@ -1,34 +1,29 @@
<footer>
{%- if LOGO_IMAGE -%}
- <img src="{{ SITEURL }}/{{ LOGO_IMAGE }}"
- alt="{{ SITENAME }}"
- >
+ <img src="{{ SITEURL }}/{{ LOGO_IMAGE }}" alt="{{ SITENAME }}">
{%- endif -%}
<ul>
{% for name, url in LINKS %}
- <li><a href="{{ SITEURL }}/{{ url }}">{{ name }}</a></li>
+ <li><a href="{% if not url.startswith('http') %}{{SITEURL}}/{% endif -%}
+ {{url}}">{{ name }}</a></li>
{% endfor %}
</ul>
{%- if HONEYPOT_ADDR -%}
- <!--!email_off-->
- <p class="contact">
- If you wish to contact me,
- <a href="mailto:{{ HONEYPOT_ADDR }}" rel="nofollow">
- {{ HONEYPOT_ADDR }}
- </a>
- is <strong>not</strong> the address to use.
- </p>
- <!--!/email_off-->
+ <p class="contact">
+ If you wish to contact me,
+ <a href="mailto:{{ HONEYPOT_ADDR }}">{{ HONEYPOT_ADDR }}</a>
+ is <strong>not</strong> the address to use.
+ </p>
{%- endif -%}
{%- if LICENSE -%}
- <p>
- My work is powered by
- <a href="https://getpelican.com">Pelican</a>, and licensed under a
- <a href="{{ LICENSE[1] }}" rel="license">{{ LICENSE[0] }}</a>
- </p>
+ <p>
+ My work is powered by
+ <a href="https://getpelican.com">Pelican</a>, and licensed under a
+ <a href="{{ LICENSE[1] }}" rel="license">{{ LICENSE[0] }}</a>
+ </p>
{%- else -%}
- <p>
- Powered by <a href="https://getpelican.com">Pelican</a>
- </p>
+ <p>
+ Powered by <a href="https://getpelican.com">Pelican</a>
+ </p>
{%- endif -%}
</footer>