A reusable PHP Markdown blog script. This project demonstrates clean PHP architecture, reusable helpers, secure content rendering, and responsive Bootstrap design.
- Markdown-driven blog posts and static pages
- Shared helper functions for metadata parsing, slug routing, and navigation
- Responsive UI with Bootstrap and custom styling
- Safe output escaping and secure Markdown rendering
- Simple file-based architecture for easy customization
Homepage - Post listing with reading time
Post page - Markdown rendering with featured image and reading time
- Copy the repository files to a PHP-capable web server directory.
- Ensure the web server user can read the
posts/,pages/,includes/, andassets/directories. - Open
config.phpand update the following values:site_urlblog_nametaglineshort_nameauthor_namefooter_text
- (Optional) Replace
default_imagewith your own fallback image URL. - Visit
index.phpin your browser to verify the homepage loads.
- Create a new Markdown file in
posts/for each blog entry. - Create a new Markdown file in
pages/for each static page. - Add a YAML-style front matter block at the top of each Markdown file.
- Use the
slugvalue to link to posts and pages from the site. - To view a page, open
page.php?slug=your-page-slugin your browser. - To view a post, open
post.php?slug=your-post-slugin your browser.
---
title: Sample Post
date: 2026-04-30
slug: sample-post
excerpt: A short summary shown on the homepage.
image: https://example.com/image.jpg
---
Your markdown content here.- The homepage automatically lists posts from the
posts/folder. - Static pages are generated from files in the
pages/folder.- Privacy and terms are served from Markdown pages inpages/.- No database is required; the site is file-based.
index.php— homepage listing of blog postspost.php— individual post pagespage.php— static page rendererincludes/functions.php— shared helper functionsincludes/header.php/includes/footer.php— common layout partialsconfig.php— site configuration and brandingassets/css/style.css— custom stylingposts/— markdown blog postspages/— markdown portfolio pages
- Use this script as a starter for portfolios, documentation, or project demos.
- Customize the content and metadata to match your own branding or site.
- Keep the project generic so it can be reused across multiple PHP-powered websites.
MIT License
Copyright (c) 2026 PHP Markdown Blog
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
This project uses Parsedown by Emanuil Rusev for Markdown parsing.

