A lightweight PHP-based website engine that converts markdown files into a beautiful, responsive website. Perfect for personal wikis, documentation sites, or simple blogs.
This code was entirely generated through AI (Claude-3.5-Sonnet in Cursor IDE compose agent mode) prompts. While I personally use it, anyone else choosing to use this code does so entirely at their own risk. No warranty or guarantee is provided, and you should thoroughly review and test the code before using it in any production environment.
- 🚀 Simple Setup - Just PHP and markdown files, no database required
- 🔗 Wiki-style Links - Use
[[page name]]
for internal links - 🖼️ Media Support - Easy embedding of images and videos with
![[filename]]
- 📱 Responsive Design - Looks great on all devices
- 🎨 Clean Typography - Using Lexend Deca font for optimal readability
- 🔒 Secure - Built-in path traversal protection
- 🛠️ Configurable - Easy to customize with settings at the top of index.php
- PHP 8.0 or higher
- Apache with mod_rewrite (or equivalent URL rewriting for your web server)
- Write permissions for the markdown directory
-
Download the Files
git clone [your-repo-url] # or download and extract the ZIP file
-
Set Up the Directory Structure
your-website/ ├── index.php ├── Parsedown.php ├── .htaccess └── markdown/ ├── index.md └── share/
-
Get Parsedown
- Download
Parsedown.php
from Parsedown's GitHub - Place it in your root directory
- Download
-
Create .htaccess Create a file named
.htaccess
with:RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ index.php/$1 [L,QSA]
-
Configure Settings Edit the
$CONFIG
array inindex.php
:$CONFIG = [ 'site_title' => "Your Website", 'markdown_dir' => __DIR__ . '/markdown', 'media_base_url' => 'https://your-domain.com/markdown', 'debug_mode' => false ];
-
Create Your First Page Create
markdown/index.md
with some content:# Welcome to My Website This is my new markdown-powered website! Check out my [[about]] page.
- Create
.md
files in themarkdown
directory - Use standard markdown syntax
- Files are accessible via their names (e.g.,
about.md
is accessed as/about
)
-
Internal Links
[[page name]] # Links to page-name.md
-
Images
![[image.jpg]] # Regular image ![[image.jpg|500]] # Image with 500px width
-
Videos
![[video.mp4]] # Video with default size ![[video.mp4|720]] # Video with 720px width
- Place all media files in the
markdown/share/
directory - Supported formats:
- Images: jpg, png, gif, etc.
- Videos: mp4
The default style uses a dark theme with the Lexend Deca font. You can customize the appearance by editing the CSS in index.php
.
Set debug_mode
to true
in the config to see detailed error messages during setup.
- Built-in protection against directory traversal attacks
- Sanitized file paths
- HTML-escaped output
This project is open source and available under the MIT License.
Contributions are welcome! Please feel free to submit a Pull Request.
If you encounter any issues or have questions, please open an issue on GitHub.