I'm having trouble displaying an image next to text, it keeps showing up below. Here's the code snippet:
<div class="container">
<div class="row">
<div class="col-md-8">
<h1>This is my first post</h1>
<div> <p><strong>Lorem Ipsum</strong> is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard …
</div>
<div class="col-md-4">
<img src="/media/post/Screenshot_from_2022-07-17_23-55-13.png" class="img-thumbnail" >
</div>
<div><a href="/blog/first-post" >Read More..</a></div>
<div class="col-md-8">
<h1>this is second post</h1>
<div> <p><strong>Lorem Ipsum</strong> is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard …
</div>
<div class="col-md-4">
<img src="/media/post/0a61bddab956.png" class="img-thumbnail" >
</div>
<div><a href="/blog/2nd-post" >Read More..</a></div>
</div>
</div>
Here is how it appears: https://i.sstatic.net/YHgtV.png
EDIT. I copied this from view-source and some text got cut off. I am actually using Django jina 2 template code
{% for post in context %}
<div class="col-md-8">
<h1>{{ post.title}}</h1>
{{ post.content |truncatewords:20 | safe}}
</div>
<div class="col-md-4">
<img src="/media/{{post.image}}" class="img-thumbnail" >
</div>
<div><a href="/blog/{{post.slug}}" >Read More..</a></div>
{% endfor %}
And here is the base.html file code:
<div class="container">
<div class="row">
{%block content %}
{%endblock%}
</div>
</div>
I suspect that truncatewords:20
is causing the issue.
By replacing it with truncatewords_html:20
, the issue has been resolved