-
Notifications
You must be signed in to change notification settings - Fork 331
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
Move the "blog listing logic" out of index.jade #45
Comments
I had a little look into this to see if I could figure out how to implement it myself and I have created a wintersmith-archive plugin: https://github.com/vitch/wintersmith-archive I've never written coffee script before so it's quite possibly a dumb implementation (not understanding coffee script made it tricky for me to get my head around the wintersmith sourcecode as well). But hopefully it is a starting point to discuss whether it is possible to move logic from templates into a To use add to your project and then reference in {
"template": "archive.jade",
"filename": "archive.html"
} Then
What do you think? Do you like the idea of making the templates dumber and simpler and having any required logic in a |
@vitch I just went through this myself. I ended up hacking wintersmith-swig to allow me to pass a custom filters module, then created a file with swig filters to handle most of the logic that is currently done in the Jade template. I'd be happy to share some of the code here next time I'm at my computer; don't have access to it right now unfortunately. Would that help? |
@vitch Also, your plugin looks good as long as I want the specific configuration (sorted by date, etc) you return. My solution allows you to define that in your app. However, it's not very "wintersmithy" whereas yours is, so maybe we can find a way to combine approaches? |
@joefiorini I actually moved to DocPad in the meantime... This was one of the problems I ran into while evaluating wintersmith so I decided to have a looks at some other options and I'm currently preferring that... Agree that my plugin is limited to the specific requirements at hand. It would be great to have it configurable in some manner (rather than a separate plugin for each way you want to slice the data)... |
Fixed in 2.0, now everything is PERFECT! ⛵ |
Firstly, thanks for wintersmith - it looks like a really nice approach to the static site generation problem.
I'm trying to use wintersmith and the swig plugin to build a blog. However it seems like on the default generated site the logic to gather the articles for the homepage and archive page is included in the
.jade
templates. I can't see how I could replicate this with a swig template.Should I be creating a content plugin which somehow massages the data into a format which can be output by a logic-less templating language? Or is there some other way to make it so that the index/archive templates are passed just the data they need already sorted/ filtered?
The text was updated successfully, but these errors were encountered: