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

Conversation

realAhmedRoach
Copy link

If the image feature is on another space in the internet, it can be displayed as a feature image.

For example if a site is on sitea.com, and the image is on siteb.com, sitea.com can link to that image. Without this, an outside image will look like this: http://sitea.com/images/http://siteb.com/image.jpg

mpark pushed a commit to mpark/mpark.github.io that referenced this pull request May 12, 2016
@soanseng
Copy link

@theTechnoKid Thank you for adding this code here! I had the same issue. Thank you!

@katcaola
Copy link

katcaola commented May 6, 2017

@theTechnoKid I was actually going to implement this myself! I'm glad I checked the open pull requests! Great minds think alike 😸

I would also suggest you make the change to _includes/navigation.html before this gets merged. That way you can have your "About" avatar hosted as well.

{% 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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants