blog image path rendering fix

This commit is contained in:
timurgordon
2022-08-11 17:20:02 +03:00
parent 7e827e010e
commit 098060c65d
3 changed files with 4353 additions and 5 deletions

File diff suppressed because one or more lines are too long

View File

@@ -52,7 +52,8 @@
</div>
<div class="my-2 sharethis-inline-share-buttons"></div>
</section>
<img class="mb-8 mx-auto" src={{"/" ~ page.extra.imgPath}} alt="">
{% set img_url = get_url(path='/' ~ page.relative_path | replace(from='_', to='-') | replace(from='index.md', to=page.extra.imgPath)) %}
<img class="mb-8 mx-auto" src={{img_url}} alt="{{page.title ~ 'Picture'}}">
<div id="article">{{ page.content | safe }}</div>

View File

@@ -6,8 +6,9 @@
<div class="flex flex-col rounded-lg shadow-lg overflow-hidden">
<div class="flex-1 border-b">
<a href="{{ post.permalink }}" class="block">
{% set img_url = get_url(path='/' ~ post.relative_path | replace(from='_', to='-') | replace(from='index.md', to=post.extra.imgPath)) %}
<div class="flex-shrink-0">
<img class="h-48 w-full mx-auto object-cover" src=/{{post.extra.imgPath}} alt="" />
<img class="h-48 w-full mx-auto object-cover" src={{img_url}} alt="{{post.title ~ ' Picture'}}" />
</div>
<div class="flex-1 bg-white p-6 flex flex-col justify-between">