Charles W. Reace's Simple (I Hope) Blog Framework
The intent here is something where I can just upload markdown files for each article, and this will organize them by date and parse the markdown into HTML. As a result, there is no admin interface, as the only "admin" you need to do is use (S)FTP or whatever other method you prefer to upload your post files.
Download or pull this repo.
For now, it will only work from your
web root directory. (I have an open issue to change that.) (fixed!) Edit the
/.config.json file with desired values for your site.
Posts are stored as markdown files in the /posts directory. You need
a home page file called
home.md there. Any other posts should start
with a date, be all lower-case, and using underscores where you would
logically have a space, e.g.
2016-08-38_my_new_post.md. (Note that the
date portion controls the sorting, so use a "Y2K-compliant" style date
in YYYY-MM-DD format.) The Parsedown package
is used to convert the file to HTML. Additionally, I added code to
convert " -- " (space, double-hypen, space) to HTML entities for
thin-space, em-dash, thin-space. The CSS (in
makes any image tags within the post float left.
If you use the
/static/img/ directory for images in your posts, use
a relative URL (no leading slash), such as
The /static/img directory should contain an image file named
to be used as the background image in the page's banner. (I used a
2,048px × 532px jpeg which seemed to work pretty well). You can also
favicon.ico file there to be used as the blog's favicon.
You can use this directory to upload images you want to use in your
posts, if desired.
cwrBlog makes use of Bootstrap for styling and multiple screen size
support. There are a few items in
/config.json that are used for
values in the head and foot views.
banner_titleis the site "name" displayed in the banner at the top of every page
title_part_oneis used for the title element within the head section
copyright_nameis who you want to list as owning the copyright to the blog content
copyright_yearis the earliest year you want listed in the copyright statement
Right Column content
/views/right_column.php file for whatever you'd like to appear in that
column (google search, links to other sites, whatever you like).
I added a few PHPUnit tests, more as a way to sanity-check things when I make any changes. To run them, you'll need to install PHPUnit.phar, then run it from the base project directory:
> phpunit tests
Trying to decide if I want to add reader comment capability, and if so, how.