Create a static website from Markdown sources
(c), 2014

MDSite is a PHP script that

  • scans a directory tree
  • converts every .md file into .html
  • leaves the sources unchanged
  • can be run locally (PHP console) or on a server

Its purpose is to support you to build small, static web sites with a focus on content, rather than layout tricks.

Contents is written in Multimarkdown, a Markdown extension from Fletcher Penny.

When the contents of a page - its .md file - has changed, MDSite must be run manually, to update the correspondent .html file. If MDSite is run locally, the updated .hmtl files must be transferred onto the web server.

MDSite is available free of charge, but a donation would be appreciated.


  1. The MDSite Zip-package
  2. PHP 5.3 or better, installed locally or on a webserver
  3. A little knowledge in Markdown and HTML
  4. A text editor

Quick start locally

  1. Download the Zip package
  2. Unpack the zip into a new directory (either on your PC or on your server)
  3. Run mdsite once: php -f mdsite.php
  4. Inspect the .html files that have been created: http://yourserver/yourdirectory/

Quick start on a web server

  1. Download the Zip package
  2. Unpack the zip into a new directory
  3. Upload all files onto your server
  4. Ensure that PHP has the rights to create and write files in your directory.
  5. Run mdsite once: http://yourserver/yourdirectory/mdsite.php
  6. Inspect the files, that have been created: index.html

After the first run

  1. Look into the files, and and change them where the comments are
  2. Modify the
  3. Add new .md files for more pages
  4. Run mdsite.php again to update the .html files

How does it work?

MDSite scans the complete directory tree from its own location downwards. All .md files will be converted from Markdown to HTML and written to .html files with the same name: will create index.html and so on.

In addition, each file will be wrapped into and You should use to define styles, menus and stuff, and for imprint and contact.

If you have additional and/or in a subdirectory, their contents will be appended to the header/footer from the directory above. See the example.

The header may contain a label {{menu}}. This label will be replaced by the contents of the file will also be recursively appended. I.e. additional in a subdirectory will be appended to the menu from above.


Local links

If you refer to a local page, use the .html file name. I.e. if you made a new page, use [contact](contact.html) to link to it. Use the full path, where necessary (/contact.html).

Copyright and stuff