Skip to content

Commit

Permalink
Improve "Subscribe" link in footer (jekyll#698)
Browse files Browse the repository at this point in the history
Merge pull request 698
  • Loading branch information
ashmaroli authored Dec 22, 2022
1 parent 1e6da7d commit 2f032a4
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 15 deletions.
2 changes: 1 addition & 1 deletion _includes/footer.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<div class="footer-col-wrapper">
<div class="footer-col">
<p class="feed-subscribe">
<a href="{{ 'feed.xml' | relative_url }}">
<a href="{{ site.feed.path | default: 'feed.xml' | absolute_url }}">
<svg class="svg-icon orange">
<use xlink:href="{{ 'assets/minima-social-icons.svg#rss' | relative_url }}"></use>
</svg><span>Subscribe</span>
Expand Down
4 changes: 2 additions & 2 deletions _includes/social-item.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<li>
<a rel="me" href="{{ entry.user_url }}" target="_blank" title="{{ entry.title | default: entry.platform }}">
<li>{% assign entry = include.item %}
<a {% unless entry.platform == 'rss' %}rel="me" {% endunless %}href="{{ entry.user_url }}" target="_blank" title="{{ entry.title | default: entry.platform }}">
<svg class="svg-icon grey">
<use xlink:href="{{ '/assets/minima-social-icons.svg#' | append: entry.platform | relative_url }}"></use>
</svg>
Expand Down
2 changes: 1 addition & 1 deletion _includes/social.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<ul class="social-media-list">
{%- for entry in site.minima.social_links -%}
{%- include social-item.html -%}
{%- include social-item.html item = entry -%}
{%- endfor -%}
</ul>
3 changes: 3 additions & 0 deletions _includes/svg_symbol.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<symbol id="{{ include.key }}" fill-rule="evenodd" clip-rule="evenodd" stroke-linejoin="round" stroke-miterlimit="1.414" viewBox="0 0 16 16">
{%- include social-icons/{{ include.key }}.svg -%}
</symbol>
11 changes: 0 additions & 11 deletions assets/minima-social-icons.html

This file was deleted.

18 changes: 18 additions & 0 deletions assets/minima-social-icons.liquid
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
permalink: /assets/minima-social-icons.svg
---

<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
{% comment %}
Iterate through {{ site.minima.social_links }} and render platform related SVG-symbol
unless the platform is "rss" because we need the "rss" symbol for the `Subscribe` link
in the footer and therefore inject the "rss" icon outside the iteration loop.
{% endcomment %}
{% for entry in site.minima.social_links %}
{%- assign symbol_id = entry.platform -%}
{%- unless symbol_id == "rss" -%}
{%- include svg_symbol.html key = symbol_id -%}
{% endunless %}
{%- endfor -%}
{%- include svg_symbol.html key = "rss" -%}
</svg>

0 comments on commit 2f032a4

Please sign in to comment.