Fix blank site.teaser bug

- Use `assign` instead of capture and then check if variable is `nil` or not.
- Close #412
This commit is contained in:
Michael Rose 2016-08-01 10:27:54 -04:00
parent f3fd789041
commit 3e2e7daa51

View file

@ -3,7 +3,7 @@
{% if post.header.teaser %} {% if post.header.teaser %}
{% capture teaser %}{{ post.header.teaser }}{% endcapture %} {% capture teaser %}{{ post.header.teaser }}{% endcapture %}
{% else %} {% else %}
{% capture teaser %}{{ site.teaser }}{% endcapture %} {% assign teaser = site.teaser %}
{% endif %} {% endif %}
{% if post.id %} {% if post.id %}
@ -14,7 +14,7 @@
<div class="{{ include.type | default: "list" }}__item"> <div class="{{ include.type | default: "list" }}__item">
<article class="archive__item" itemscope itemtype="http://schema.org/CreativeWork"> <article class="archive__item" itemscope itemtype="http://schema.org/CreativeWork">
{% if include.type == "grid" and teaser != blank %} {% if include.type == "grid" and teaser %}
<div class="archive__item-teaser"> <div class="archive__item-teaser">
<img src= <img src=
{% if teaser contains "://" %} {% if teaser contains "://" %}