mirror of
https://github.com/jgthms/bulma.git
synced 2025-01-09 15:44:25 +00:00
Add link element
This commit is contained in:
parent
a88b024dcc
commit
d72f51ece7
@ -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>
|
||||
|
17
docs/_includes/elements/link.html
Normal file
17
docs/_includes/elements/link.html
Normal 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>
|
@ -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>
|
||||
|
@ -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>
|
||||
|
Loading…
Reference in New Issue
Block a user