Draft is a PHP static site creator written in Driftphp. This is running my personal blog https://developernaren.com
This is a hobby project for me. I wanted to try out async PHP. When I heard about reactphp.I wanted to get into it as soon as I could, but there were no starter template of sorts to get started. With Driftphp, I felt there finally is a framework that I can comfortably start working with it.
Draft is a static site generator. It can parse .html and .md files and generate a full html page.
It supports html as layouts and content can be either html and md files.
Layouts should be in Drift/draft/layouts and pages should be in Drift/draft/pages.
Routing are dependent upon the folder structure.
For example.
- File
Drift/draft/pages/index.htmlorDrift/draft/pages/index.mdwould be displayed at/ - File
Drift/draft/pages/readme.htmlorDrift/draft/pages/readme.mdwould be displayed at/readme - File
Drift/draft/pages/blogs/index.htmlorDrift/draft/pages/blogs/index.mdwould be displayed at/blogs - File
Drift/draft/pages/blogs/draft.htmlorDrift/draft/pages/blogs/draft.mdwould be displayed at/blogs/draft
We include 'meta' for post in a <draft> tag. Meta here means whatever you want to be replaced in the content of the page.
{content}in the layout andlayoutin the<draft>tag are reserved and cannot be used to replace the contents in the page
The syntax in the template is {meta}.
For example if you want to add title to a page {title}, add a
title: This is the test title
in your draft tag. and in your layout. You would add
...
<title>{title}</title>
...This will generate
<title>This is the test title</title>in the HTML.
Example draft tag
```
<draft>
description: this is the best description
title: This is the test title
layout: blog.html
</draft>
```
Refer to this file for example
- Refactor to make it adaptable
- Tests
- Cache Support
- Build process to generate static html pages
- Configurable
- Options
- Base Route
- Layout path
- Cache Path and driver
- Better Seo support
- Hot reload for md changes
- Options
I feel like there is only so much a static site generator should be able to do, but feel free to add things you would like to see here.