The Stochastic Game

Ramblings of General Geekery

Posts with tag 'cookbook'

    Blog Archives in PieCrust

    The question has come up a couple times already via email or Twitter, so here’s a quick recipe to write a nice looking archive page for your PieCrust blog. There are 2 main types of blog archives: monthly archives and yearly archives. We’ll look at them one at a time after the break. Yearly archives This is the simplest one. Because PieCrust exposes your posts sorted by year in the blog.
    Read more...

    Navigation menu in PieCrust

    Here’s another post in the PieCrust cookbook series, this time focusing on a classic web-design pattern: the navigation menu. It’s really just a bunch of links that you can put somewhere around each page’s content, but the trick here is to tell the user which page he’s currently on. This is pretty easy to do using Twig macros and the data exposed by PieCrust, assuming of course you’re using PieCrust’s default template engine.
    Read more...

    Article drafts in PieCrust

    A common feature of a blog engine is to let the user work on an article for a while before actually publishing it. Thanks to pagination filtering, it’s pretty easy to do in PieCrust. All you have to do is add the following to your blog’s home page’s configuration header: posts_filters: not: has_tags: draft This will skip any post that has the draft tag. You will probably need to add some similar filtering to other pages such as the _tag or _category pages.
    Read more...

    Using Mercurial to publish a PieCrust website

    These days, all the cool hipster kids want to deploy stuff by pushing a Git or Mercurial repository up to their server. And that’s pretty cool indeed, because you basically update your website by doing something like: hg push myserver So here’s how you can do it with PieCrust (although 90% of this article has nothing to do with PieCrust): Installing Git/Mercurial/whatever on your server Setting up your SSH keys Pushing your repository Defining hooks/triggers Keep reading for the meaty details…
    Read more...

    Enabling Disqus' developer mode

    This is the second post of a series of things I learned while using PieCrust. From the Disqus documentation: [You can tell] the Disqus service that you are testing the system on an inaccessible website, e.g. secured staging server or a local environment. If disqus_developer is off or undefined, Disqus’ default behavior will be to attempt to read the location of your page and validate the URL. If unsuccessful, Disqus will not load.
    Read more...

    Previewing a baked site in IIS/Apache

    This is the first post of a series of things I learned while using PieCrust. If you’re using PieCrust as a static website generator, you know you can use the built-in development server to preview your site as you’re modifying it. This is all pretty nice but there are plenty of good reasons to not go that way, the top ones being: The development server doesn’t run any custom scripts you may have.
    Read more...