if share-img not provided, use cover-img or thumbnail. Also make sure all images work with both relative and absolute paths

This commit is contained in:
Dean Attali 2020-07-07 05:14:01 +00:00
parent 88464eb569
commit b2b6922a8f
5 changed files with 35 additions and 22 deletions

View file

@ -9,7 +9,7 @@ layout: page
<div class="posts-list">
{% for post in posts %}
<article class="post-preview">
<a href="{{ post.url | relative_url }}">
<a href="{{ post.url | absolute_url }}">
<h2 class="post-title">{{ post.title }}</h2>
{% if post.subtitle %}
@ -40,8 +40,8 @@ layout: page
{% assign thumbnail=thumbnail | strip %}
{% if thumbnail != "" %}
<div class="post-image">
<a href="{{ post.url | relative_url }}">
<img src="{{ thumbnail | relative_url }}">
<a href="{{ post.url | absolute_url }}">
<img src="{{ thumbnail | absolute_url }}">
</a>
</div>
{% endif %}
@ -50,7 +50,7 @@ layout: page
{{ post.excerpt | strip_html | xml_escape | truncatewords: excerpt_length }}
{% assign excerpt_word_count = post.excerpt | number_of_words %}
{% if post.content != post.excerpt or excerpt_word_count > excerpt_length %}
<a href="{{ post.url | relative_url }}" class="post-read-more">[Read&nbsp;More]</a>
<a href="{{ post.url | absolute_url }}" class="post-read-more">[Read&nbsp;More]</a>
{% endif %}
</div>
</div>
@ -60,7 +60,7 @@ layout: page
Tags:
{% if site.link-tags %}
{% for tag in post.tags %}
<a href="{{ '/tags' | relative_url }}#{{- tag -}}">{{- tag -}}</a>
<a href="{{ '/tags' | absolute_url }}#{{- tag -}}">{{- tag -}}</a>
{% endfor %}
{% else %}
{{ post.tags | join: ", " }}
@ -76,12 +76,12 @@ layout: page
<ul class="pagination main-pager">
{% if paginator.previous_page %}
<li class="page-item previous">
<a class="page-link" href="{{ paginator.previous_page_path | relative_url }}">&larr; Newer Posts</a>
<a class="page-link" href="{{ paginator.previous_page_path | absolute_url }}">&larr; Newer Posts</a>
</li>
{% endif %}
{% if paginator.next_page %}
<li class="page-item next">
<a class="page-link" href="{{ paginator.next_page_path | relative_url }}">Older Posts &rarr;</a>
<a class="page-link" href="{{ paginator.next_page_path | absolute_url }}">Older Posts &rarr;</a>
</li>
{% endif %}
</ul>