Skip to content
This repository has been archived by the owner on Aug 28, 2019. It is now read-only.

Image feature can be on another site #143

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions _layouts/post-index.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,11 @@
{% if page.image.credit %}<div class="image-credit">Image source: <a href="{{ page.image.creditlink }}">{{ page.image.credit }}</a></div><!-- /.image-credit -->{% endif %}
{% if page.image.feature %}
<div class="entry-image">
<img src="{{ site.url }}/images/{{ page.image.feature }}" alt="{{ page.title }}">
{% if page.image.feature contains 'http://' or page.image.feature contains 'https://' %}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would {% if post.image.feature contains 'http' %} be a shorter way to say this? It covers both the http:// and https://. Although it makes it so that images can't be named something like https-ssl-example.png. Thoughts @theTechnoKid ?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Even better is to shorten it to ://. I use that in my other themes as it covers both cases.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the feedback! I'll fix that.

<img src="{{ page.image.feature }}" alt="{{ page.title }}">
{% else %}
<img src="{{ site.url }}/images/{{ page.image.feature }}" alt="{{ page.title }}">
{% endif %}
</div><!-- /.entry-image -->
{% endif %}
<div class="header-title">
Expand All @@ -40,4 +44,4 @@ <h2>{{ page.title }}</h2>
{% include scripts.html %}

</body>
</html>
</html>