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 thingy = link_id[0] %}
{% assign link = site.data.links.by_id[thingy] %} {% assign link = site.data.links.by_id[thingy] %}
{% endif %} {% endif %}
<a class="bd-link" href="{{ site.url }}{{ link.path }}"> {% assign link_url = site.url | append: link.path %}
<h2 class="bd-link-name"> {%
<figure class="bd-link-figure"> include elements/link.html
{% if include.icons %} url=link_url
<span class="bd-link-icon has-text-{{ link.color }}"> color=link.color
<i class="{% if link.icon_brand %}fab{% elsif link.icon_regular %}far{% else %}fas{% endif %} fa-{{ link.icon }}"></i> icon_brand=link.icon_brand
</span> icon_regular=link.icon_regular
{% else %} icon=link.icon
<span class="bd-link-counter"></span> name=link.name
{% endif %} subtitle=link.subtitle
</figure> %}
{{ link.name }}
</h2>
<p class="bd-link-subtitle">
{{ link.subtitle }}
</p>
</a>
{% endfor %} {% endfor %}
</nav> </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-content">
<div class="bd-links"> <div class="bd-links">
{% for post in site.posts %} {% for post in site.posts %}
<a class="bd-link bd-is-post" href="{{ post.url }}"> {% assign subtitle = post.date | date_to_string %}
<h2 class="bd-link-name"> {%
<figure class="bd-link-figure"> include elements/link.html
<span class="bd-link-icon has-text-{{ post.color }}"> url=post.url
<i class="{% if post.icon_brand %}fab{% elsif post.icon_regular %}far{% else %}fas{% endif %} fa-{{ post.icon }}"></i> color=post.color
</span> icon_brand=post.icon_brand
</figure> icon_regular=post.icon_regular
{{ post.name }} icon=post.icon
</h2> name=post.name
<time class="bd-link-subtitle" datetime="{{ post.date | date_to_xmlschema }}"> subtitle=subtitle
{{ post.date | date_to_string }} %}
</time>
</a>
{% endfor %} {% endfor %}
</div> </div>
</div> </div>

View File

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