Simplify image assigns

This commit is contained in:
Michael Rose 2021-07-05 20:59:07 -04:00
parent 2d64c6f69f
commit ffd9d1b070
3 changed files with 3 additions and 15 deletions

View File

@ -10,11 +10,7 @@
<a href="{{ post.url | relative_url }}" rel="bookmark">{{ title }}</a>
</h3>
{% if post.image.thumbnail %}
{% assign entry_image = post.image.thumbnail %}
{% unless entry_image contains '://' %}
{% assign entry_image = entry_image | relative_url %}
{% endunless %}
{% assign entry_image = entry_image | escape %}
{% assign entry_image = post.image.thumbnail | relative_url | escape %}
<img class="entry-image u-photo" src="{{ entry_image }}" alt="">
{% endif %}
</header>

View File

@ -1,8 +1,4 @@
{% if site.logo contains '://' %}
{% assign site_logo = site.logo %}
{% else %}
{% assign site_logo = site.logo | relative_url %}
{% endif %}
<header id="masthead">
<div class="inner">

View File

@ -1,10 +1,6 @@
<header class="intro">
{% if page.image %}
{% assign intro_image = page.image.path | default: page.image %}
{% unless intro_image contains '://' %}
{% assign intro_image = intro_image | relative_url %}
{% endunless %}
{% assign intro_image = intro_image | escape %}
{% assign intro_image = page.image.path | default: page.image | relative_url | escape %}
<div class="intro-image">
<img src="{{ intro_image }}" alt="{{ page.title }}">
</div>