Jekyll Collections & Python Markdown Editor

10/28/16

Tags Jekyll

I finally got around to implementing collections in Jekyll. Collections are groups of files that are related that aren’t blog posts or stand-alone pages. It allows me to have a folder of markdown files that can be iterated over like posts. The idea is once a collection has been implemented you can easily add to it. This site now has a project and article collections. Honestly the trickiest thing about it was setting up the configuration defaults. Here’s the syntax:

collections:
  projects:
    output: true
    permalink: /projects/:path.html
  articles:
    output: true
    permalink: /articles/:path.html
defaults:
  -
    scope:
      path: ""
      type: projects
    values:
      layout: "project"
      css_name: "project"

This post, and likely more to follow, was written using the Python markdown-editor, handily available through PyPI. It’s a basic markdown editor that runs from the command line. It does most of what I need (spellcheck would be nice, my spelling is atrocious). It allows md to be written in the browser and displays an HTML preview in the side bar.

It isn’t necessarily better than writing md through Atom, which has spellcheck and can be customized in so many ways through packages, but I wanted something were I could whip up posts on the fly without a lot of distractions. Markdown-editor can be imported for use, so it’s as customizable as you are a Pythonista.