Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix bug can not show the second latest post's image #17

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

thinhdanggroup
Copy link

Hello,

Current, I am using your theme on my website. But the second latest post has the wrong URL ( the post's image can not render like below picture ), it uses a second_post.image | absolute_url instead of {{second_post.baseurl}}/{{ second_post.image }}. I think this is someone's mistake.

image

@pongsoft
Copy link

pongsoft commented Dec 20, 2022

Hello,

Are you sure that your amendment works?

{{second_post.baseurl}}/{{ second_post.image }} does not work for me. I resolved with the following fix.

THIS:

<img class="w-100" src="{% if second_post.image contains "://" %}{{ second_post.image }}{% else %}{{ second_post.image | absolute_url }}{% endif %}" alt="{{ second_post.title }}">

WAS REPLACED WITH:

<img class="w-100" src="{% if second_post.image contains "://" %}{{ second_post.image }}{% else %}{{site.baseurl}}/{{ second_post.image }}{% endif %}" alt="{{ second_post.title }}">

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants