Add link element

This commit is contained in:
Jeremy Thomas 2018-04-10 22:50:18 +01:00
parent a88b024dcc
commit d72f51ece7
4 changed files with 50 additions and 43 deletions

View File

@ -13,22 +13,16 @@
{% assign thingy = link_id[0] %}
{% assign link = site.data.links.by_id[thingy] %}
{% endif %}
<a class="bd-link" href="{{ site.url }}{{ link.path }}">
<h2 class="bd-link-name">
<figure class="bd-link-figure">
{% if include.icons %}
<span class="bd-link-icon has-text-{{ link.color }}">
<i class="{% if link.icon_brand %}fab{% elsif link.icon_regular %}far{% else %}fas{% endif %} fa-{{ link.icon }}"></i>
</span>
{% else %}
<span class="bd-link-counter"></span>
{% endif %}
</figure>
{{ link.name }}
</h2>
<p class="bd-link-subtitle">
{{ link.subtitle }}
</p>
</a>
{% assign link_url = site.url | append: link.path %}
{%
include elements/link.html
url=link_url
color=link.color
icon_brand=link.icon_brand
icon_regular=link.icon_regular
icon=link.icon
name=link.name
subtitle=link.subtitle
%}
{% endfor %}
</nav>

View File

@ -0,0 +1,17 @@
<a class="bd-link" href="{{ include.url }}">
<h2 class="bd-link-name">
<figure class="bd-link-figure">
{% if include.icon %}
<span class="bd-link-icon has-text-{{ include.color }}">
<i class="{% if include.icon_brand %}fab{% elsif include.icon_regular %}far{% else %}fas{% endif %} fa-{{ include.icon }}"></i>
</span>
{% else %}
<span class="bd-link-counter"></span>
{% endif %}
</figure>
{{ include.name }}
</h2>
<p class="bd-link-subtitle">
{{ include.subtitle }}
</p>
</a>

View File

@ -38,19 +38,17 @@ breadcrumb:
<div class="bd-content">
<div class="bd-links">
{% for post in site.posts %}
<a class="bd-link bd-is-post" href="{{ post.url }}">
<h2 class="bd-link-name">
<figure class="bd-link-figure">
<span class="bd-link-icon has-text-{{ post.color }}">
<i class="{% if post.icon_brand %}fab{% elsif post.icon_regular %}far{% else %}fas{% endif %} fa-{{ post.icon }}"></i>
</span>
</figure>
{{ post.name }}
</h2>
<time class="bd-link-subtitle" datetime="{{ post.date | date_to_xmlschema }}">
{{ post.date | date_to_string }}
</time>
</a>
{% assign subtitle = post.date | date_to_string %}
{%
include elements/link.html
url=post.url
color=post.color
icon_brand=post.icon_brand
icon_regular=post.icon_regular
icon=post.icon
name=post.name
subtitle=subtitle
%}
{% endfor %}
</div>
</div>

View File

@ -33,19 +33,17 @@ breadcrumb:
<div class="bd-links">
{% for link_id in site.data.links.more %}
{% assign link = site.data.links.by_id[link_id] %}
<a class="bd-link bd-is-post" href="{{ site.url }}{{ link.path }}">
<h2 class="bd-link-name">
<figure class="bd-link-figure">
<span class="bd-link-icon has-text-{{ link.color }}">
<i class="{% if link.icon_brand %}fab{% elsif link.icon_regular %}far{% else %}fas{% endif %} fa-{{ link.icon }}"></i>
</span>
</figure>
{{ link.name }}
</h2>
<p class="bd-link-subtitle">
{{ link.subtitle }}
</p>
</a>
{% assign link_url = site.url | append: link.path %}
{%
include elements/link.html
url=link_url
color=link.color
icon_brand=link.icon_brand
icon_regular=link.icon_regular
icon=link.icon
name=link.name
subtitle=link.subtitle
%}
{% endfor %}
</div>
</div>