-
Notifications
You must be signed in to change notification settings - Fork 179
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Granular date and time control when publishing articles #52
Comments
If you upgrade to Middleman 3.0, this should work better. In 3.0, you can put a full DateTime in the frontmatter "date" field, and the extension sorts based on that. |
Any way you could give me an example of how to achieve this and parse it in an article view? Many thanks in advance. Ryan Merrill On Thursday, June 21, 2012 at 12:23 PM, Ben Hollis wrote:
|
Nothing to do, really. You make a blog post, like this (in a file called
Then your original snippet becomes: <% blog.articles[0...5].each do |article| %>
<article>
Title: <%= article.title %>
Date: <%= article.date %>
</article>
<% end %> And without doing anything, the articles will already be sorted by date. |
@procload did that work for you? |
Sure did. Sorry for not replying. Thanks a bunch for the help. |
Specifically when publishing multiple articles on one day. I currently I have a loop that looks like the following:
Which lists the 5 most recent articles on my index page, but when I publish more than one article per day it sorts them in chronological order, where I would like them to be reverse chron, like a blog typically is. Is there an easy way to reorder this so it works in a typical blog format, with the newest article of that day appearing first?
The text was updated successfully, but these errors were encountered: