Updates to markd

Posted January 23rd, 2012

After releasing the first version of markd over the weekend, I'm following it up with a reasonable amount of changes and new features.

There is now support for Pages. They're created from a file/directory hierarchy in your content/pages directory. Along with this a menu with support to up to 2 levels deep can be generated. This might be easier to explain by example. Let's assume you have a directory structure that looks like this:

/content
    /pages
        /about.md
        /Projects
            /markd.md
        /contact.md

This would generate code that looks like this:

<ul class="nav">
    <li><a href="about.html">About</a></li>
    <li class="dropdown" data-dropdown="dropdown">
        <a class="dropdown-toggle" href="#">Projects</a>
        <ul class="dropdown-menu">
            <li><a href="markd.html">markd</a></li>
        </ul>
    </li>
    <li><a href="contact">Contact</a></li>
</ul>

The link names are pulled from the directory name (e.g. "Projects") or from the Title in the markdown file (e.g. "About"). Essentially all you need to do is create a structure and markd will take care of making a menu system for it and linking things up properly.

Also with the support of pages comes support for page templates. If you need a page to look different, then create a corresponding template file with the same file name inside your theme. For example, if you wanted your "about.md" page to use a special template, then you can create an "about.tpl" inside the theme and alter the HTML for that page only. If there's not a specific page template in the theme directory, then it will default to using a generic "page.tpl" from the theme directory.

There's also a simple (for the time being) hook system that was introduced which allows themes/plugins to do some manipulation of the generated site. Along with markd comes a plugin called Twitter Timeline Widget to show how this can be used to add something to the sidebar of posts/pages. There is another example in the default theme which depending on whether a JotForm ID is provided, it will either add the Contact Me button (that you see on the right hand side of this page) or not. This is a little crude at the moment, but I hope to flush it out and make things a little smoother as time goes on.

A lot of other tweaks were made along the way with these features, but you can read commits over on github if you really need to know about that boring stuff :)

Up next:

  • Support for categories
  • Restructuring of pages in the published site (need to build a directory structure rather than cramming it all into the site root)
  • Child theme system (mainly for me to be able to apply customizations to the default theme)
  • Post formats (make things like Links or Tweets look different)
  • Future dated posts won't be published until the proper time even if their published status is set to true

Apparently pictures are needed

Posted January 21st, 2012

Carrie told me I needed pictures on my site, so here's a repeat of an old post, "Sleeping Dog"

image

Welcome To My New Site

Posted January 20th, 2012

Complete

So here it is. I've been working on a static site generator for the past couple of weeks and I finally have things put together enough to start running my site off of it. The project is called markd and it's hosted on github.

The overview of how the system works is you create files (posts) that are written in Markdown syntax. markd will then generate a static HTML version of your blog from those files. It makes everything you see here.

I would say it's still very alpha at the moment, and even when it is stable it will still be something of more interest to developers rather than the average blogger. The installation and setup instructions basically don't exist, but will be coming in the future.

Here are the basic reasons why I wrote it:

  • I needed a new hobby project :)
  • Having a static HTML site just seemed to make sense for various reasons
  • It was a bit of an exercise in some development areas that I wanted to work out
  • Creating Markdown files is so easy and the way I have this all set up, makes writing a new post both simple and something I can easily enjoy in my favorite text editor
  • Really, it's just something that I had a strong interest in and decided to run with it. I'm happy with how it's turned out.

If you're curious how it works, here is how I have things set up:

  • I write blog posts in a text editor, with the Markdown syntax. They're saved on Dropbox so I can access them from any computer.
  • I run markd which is a PHP-CLI set of scripts that generates the HTML for my home page, single post pages, archives, etc.
  • Those files are then automatically published to my web server using a set of not-included shell scripting.

I'm enjoying working on it and have plans for things to do in the future like enhancing the theme engine, adding hooks for a plugin system and support for some different post formats. At this point you might be thinking this is starting to sound a lot like WordPress, or many of the other blogging engines, including the others that create static sites. Well, you'd be correct.

I wanted this project to do things the way I wanted them done. It's definitely taking hints from WordPress, and I also intend to take some hints from the Carrington Theme Framework for the theme engine.

I'm looking forward to where this might go. Who knows, maybe working on markd might get me blogging frequently again since I'll be developing it and want to try things out.

Finding my previous content

Posted January 20th, 2012

When I switched over to markd, I considered migrating all of my content to it, but at the time of this writing, I'm just not sure that I feel like it's worth it. So for an archive of my postings before this post, please use the link below.

My previous content can be found here.

RSS