Comments (5)
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.
from middleman-blog.
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
[email protected] (mailto:[email protected])
440.452.6174
On Thursday, June 21, 2012 at 12:23 PM, Ben Hollis wrote:
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.
Reply to this email directly or view it on GitHub:
#52 (comment)
from middleman-blog.
Nothing to do, really. You make a blog post, like this (in a file called 2012-06-21-my-awesome-post.html.markdown
):
---
title: My awesome post
date: 2012-06-21 10:00
---
Hey guys my day was awesome!
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.
from middleman-blog.
@procload did that work for you?
from middleman-blog.
Sure did. Sorry for not replying. Thanks a bunch for the help.
from middleman-blog.
Related Issues (20)
- Add more informations in head of article HOT 2
- Extension should not fail to activate if middleman-core/cli is missing
- Paging on untagged posts HOT 1
- How to make paginate work with localize blog? HOT 2
- Cyrillic tags stopped working in 4.0.2 HOT 2
- Support i18n mount_at_root option in permalinks HOT 3
- 4.0.2 regression bug when specifying the blog in the front-matter HOT 7
- feed.xml error on multi-blog site HOT 1
- RuntimeError flag --blog HOT 1
- 4.0.2 on RubyGems.org has different dependencies to the git repo HOT 3
- Very poor and outdated blog template which does not match with default template HOT 4
- Iterating through blog.tags spits out extraneous frontmatter HOT 5
- How to get links to all calendar/tag pages HOT 5
- Calendar and tag pages without .html aren't rendered within layout automatically HOT 1
- How to configure URLs of articles with underscore HOT 6
- `middleman article` generates incorrect yaml when the title contains characters that should be escaped HOT 1
- Middleman blog frontmatter evaluating files under build directory HOT 3
- preserve i18n locale on non-localized article page HOT 2
- YAML error on Ruby 3.1.0 HOT 7
- Paginate is showing as false even if set in config.rb to true HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from middleman-blog.