PMBlog is a small tool that turns Markdown files into static HTML. It can publish articles and pages, and it supports custom templates. PHP might not be the most comfortable language for this kind of job, but it is easy to set up and more than adequate for a small or medium-sized blog.

The project is now at version 4.0. It uses the Twig template engine with permission support, and the repository has moved to GitHub. You are welcome to keep using it.

Official site: http://lizheming.github.io/PMBlog Project repository: http://github.com/lizheming/PMBlog

Installation

  1. Set up a local PHP environment.
  2. Download the code and edit config.php.
  3. Visit index.php, and the static files will be generated in the html directory.

Markdown file rules

By default, the Markdown filename becomes the filename of the output static page — hello-world.md will produce hello-world.html. Using Chinese characters in filenames is not recommended.

Markdown files support several custom fields:

  • title: Hello World sets the title of the article (required).
  • date: 2013年2月11日 sets the publication date. If this field is omitted, the program uses the file's creation time as the publication time (optional).
  • type: page marks the article as a page. It accepts only page or post; the default is post (optional).
  • status: draft marks the article as a draft; drafts are not output. It accepts only draft, and other values are invalid. By default, an article is published (optional).
  • tags: tag1, tag2 sets the keywords for the article, separated by half-width commas (optional).

So for now, the simplest possible file is just a title: field followed by the body text.