Skip to content

fix 2nd latest post image url formation issue#77

Open
AnanthaRajuC wants to merge 1 commit intocodebygina:masterfrom
jekyll-and-other-blog-designs:fix-2nd-latest-post-image-url-formation
Open

fix 2nd latest post image url formation issue#77
AnanthaRajuC wants to merge 1 commit intocodebygina:masterfrom
jekyll-and-other-blog-designs:fix-2nd-latest-post-image-url-formation

Conversation

@AnanthaRajuC
Copy link

@AnanthaRajuC AnanthaRajuC commented Apr 30, 2021

When the theme was hosted on my GitHub account, the 2nd post image was not being rendered due to a URL formation issue.

Old code in index.html file

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

Fix in index.html file

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

1 participant