我的网站上有一个管理面板,管理员可以在上面添加文章。我希望他们将带有图片的内容上传到网站时-内容的标题也将是图片标题。谁能帮助我更改脚本?现在,这是我的脚本:
我将非常感谢您的帮助。谢谢
<article class="post">
<div>
<img alt="" class="img-responsive"
src="{{ article.card_image_thumbnail.url }}" style="margin-bottom:18px;">
</div>
<h1 class=" fa-font-justify-fix " <a
href="/article/{{ article.slug }}/">{{ article.title }} </a></h1>
<div> <p class=" fa-font-justify-fix "> {{ article.description|striptags|truncatewords:30 }} </p></div>
<hr>
<div class="post-meta">
<span><i class="fa fa-calendar"></i> {{ article.publish_date|date:"M d" }}</span>
<span><i class="fa fa-eye"></i> {{ article.hitcounter_set.first.hitcount }}</span>
<a href="/article/{{ article.slug }}/" class="read-more pull-right"> More detail
<i class="fa fa-angle-left"></i></a>
</div>
</article>