mirror of https://github.com/scrapy/scrapy.git
Add blog templatetag call to retrieve last two post and display in homepage
--HG-- extra : convert_revision : svn%3Ab85faa78-f9eb-468e-a121-7cced6da292c%4010
This commit is contained in:
parent
b5fe965315
commit
f91f073363
|
|
@ -37,26 +37,17 @@
|
|||
|
||||
<div class="box">
|
||||
<h3>Scrapy Weblog</h3>
|
||||
{% load lastblogentry %}
|
||||
{% get_latest_blog_entries 2 as entries %}
|
||||
|
||||
<div class="post">
|
||||
<h4><a href="#">post title</a></h4>
|
||||
<p class="author">by <a href="#">Molvo</a> on May 14, 2008</p>
|
||||
<p class="abstract">
|
||||
Nullam ullamcorper, sem quis interdum imperdiet, velit leo convallis ante, eget fringilla lacus
|
||||
interdum imperdiet, velit leo convallis ante, eget fringilla...
|
||||
</p>
|
||||
<a href="#" class="more">» Read More</a>
|
||||
</div>
|
||||
|
||||
<div class="post last">
|
||||
<h4><a href="#">post title</a></h4>
|
||||
<p class="author">by <a href="#">Molvo</a> on May 14, 2008</p>
|
||||
<p class="abstract">
|
||||
Nullam ullamcorper, sem quis interdum imperdiet, velit leo convallis ante, eget fringilla lacus
|
||||
interdum imperdiet, velit leo convallis ante, eget fringilla...
|
||||
</p>
|
||||
<a href="#" class="more">» Read More</a>
|
||||
{% for entry in entries %}
|
||||
<div class="post{% if forloop.last %} last{% endif %}">
|
||||
<h4><a href="{{ entry.get_absolute_url }}">{{ entry.headline }}</a></h4>
|
||||
<p class="author">by {{ entry.author }} on {{ entry.pub_date|date:"M d, Y"}}</p>
|
||||
<p class="abstract">{{ entry.summary }}</p>
|
||||
<a href="{{ entry.get_absolute_url }}" class="more">» Read More</a>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Reference in New Issue