Closed luckypoem closed 10 years ago
Hey there! The reason the files are in ascending order is just because that's how they get sorted by Python. There's a | reverse
filter in Jinja, though, or you can grab the most recent with posts[-1]
.
The NoneType
error is because there's no folder site/static/image/thewedding/
. Just delete that part, it should compile.
hi. u said "There's a | reverse filter in Jinja, though, or you can grab the most recent with posts[-1]." could u pls explain how to operate concretely? modify which files? how to modify? tks a lot!
<!-- most recent blog -->
<a href="{{ site.blogs[-1].url }}">{{ site.blogs[-1].title }}</a>
<!-- blog pages -->
<ol>
{% for blog in site.blogs|reverse %}
<li><span>{{ blog.created_at | date }}</span> › <a href="{{ blog.url }}">{{ blog.title }}</a></li>
{% endfor %}
</ol>
Also, the pagination extension supports a reverse
option, too.
https://github.com/colinta/StrangeCase/blob/master/strange_case/extensions/paginated.py
hi. the post http://sc.brite.biz.st/blogs/2014_06_15_0840_jingle_bell.html the newest post, why the newly published post doesn't appear in the foremost of the homepage while appear in the hindermost of the site? the whole site's posts are completely arranged reversible to the publishing time. how to let posts arranged as per the publishing time??(that is : the newest post is in the foremost of the site,the oldest post is in the hindermost of the site) tks a lot.
another issue: as3:~/StrangeCase-site/strange_case/tests# git clone https://github.com/colinta/colinta.com colinta.com-site as3:~/StrangeCase-site/strange_case/tests# cd colinta.com-site as3:~/StrangeCase-site/strange_case/tests/colinta.com-site# ls config.yaml fabfile.py includes layouts site as3:~/StrangeCase-site/strange_case/tests/colinta.com-site# scase inflect is required.
how to fix the TypeError: 'NoneType' object is not iterable? tks