python - Flask博客中想实现对每个文章生成一个几百字的介绍
迷茫
迷茫 2017-04-18 10:34:41
0
1
483

我的想法很简单,就是想用flatpages + markdown来生成文章页面。现在就是想在index页面有个文章列表,这个列表上可以展示一下文章的前面部分一段内容。当时想着可以在网页里面设置一个标记,标记部分就可以做为介绍,放到index页面上。不过感觉这种方法笨笨的,不知道有没有更好的方法?

迷茫
迷茫

业精于勤,荒于嬉;行成于思,毁于随。

reply all(1)
Peter_Zhu

I searched for information on the Internet and found that it can be done using the filter in Jinja2:
{{ post.html|truncate(250) }}The first 250 characters can be intercepted and used as a summary.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!