Create includes for greater layout flexibility
This commit is contained in:
@ -22,7 +22,7 @@
|
||||
alt="{{ page.title }}">
|
||||
</div>
|
||||
{% endif %}
|
||||
<h2 class="archive__item-title" itemprop="headline">{% if post.id %}{{ post.title | markdownify | remove: "<p>" | remove: "</p>" }}{% else %}{{ post.title }}{% endif %}</h2>
|
||||
<h2 class="archive__item-title" itemprop="headline">{% if post.id %}{{ post.title | markdownify | remove: "<p>" | remove: "</p>" }}{% else %}{{ post.title }}{% endif %}{% if post.link %}<i class="fa fa-star" aria-hidden="true"></i>{% endif %}</h2>
|
||||
{% if site.read_time and post.read_time %}<p class="page__meta"><i class="fa fa-clock-o" aria-hidden="true"></i> {% include read-time.html %}</p>{% endif %}
|
||||
{% if post.excerpt %}<p class="archive__item-excerpt" itemprop="description">{{ post.excerpt | markdownify | strip_html | truncate: 160 }}</p>{% endif %}
|
||||
</article>
|
||||
|
12
_includes/page__hero.html
Normal file
12
_includes/page__hero.html
Normal file
@ -0,0 +1,12 @@
|
||||
<div class="page__hero">
|
||||
<img src=
|
||||
{% if page.header.image contains "http" %}
|
||||
"{{ page.header.image }}"
|
||||
{% else %}
|
||||
"{{ page.header.image | prepend: "/images/" | prepend: base_path }}"
|
||||
{% endif %}
|
||||
alt="{{ page.title }}" class="page__hero-image">
|
||||
{% if page.header.caption %}
|
||||
<span class="page__hero-caption">{{ page.header.caption | markdownify | remove: "<p>" | remove: "</p>" }}</span>
|
||||
{% endif %}
|
||||
</div>
|
20
_includes/sidebar.html
Normal file
20
_includes/sidebar.html
Normal file
@ -0,0 +1,20 @@
|
||||
{% if page.author_profile or page.sidebar %}
|
||||
<div class="sidebar sticky">
|
||||
{% if page.author_profile %}{% include author-profile.html %}{% endif %}
|
||||
{% if page.sidebar %}
|
||||
{% for s in page.sidebar %}
|
||||
{% if s.image %}
|
||||
<img src=
|
||||
{% if s.image contains "http" %}
|
||||
"{{ s.image }}"
|
||||
{% else %}
|
||||
"{{ s.image | prepend: "/images/" | prepend: base_path }}"
|
||||
{% endif %}
|
||||
alt="{% if s.image_alt %}{{ s.image_alt }}{% endif %}">
|
||||
{% endif %}
|
||||
{% if s.title %}<h3>{{ s.title }}</h3>{% endif %}
|
||||
{% if s.text %}{{ s.text | markdownify }}{% endif %}
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endif %}
|
Reference in New Issue
Block a user