Write Markdown and have it published and hosted on Cloudflare Workers
Project description
Workdown
A system to write Markdown and have it published and hosted via Cloudflare Workers
Pre-requisites
- Python 3
- Install
wrangler
- virtualenv
Usage
git clone
this repository- cd into the directory
- Configure wrangler.toml with your Cloudflare details, make sure your route ends in a wildcard e.g.
route = "https://example.com/*".
- Create a KV Namespace and bind in to
pages
in yourwrangler.toml
file. - Start a python virtualenv
python3 -m venv .env
- Enter the virtualenv
source .env/bin/activate
- Install dependences
pip install -r requirements.txt
- Make a markdown file ending in
.md
in thecontent/
directory If you want it to be your main page, name itindex.md
. - Run
python workdown.py
- Done!
Assets
Text-based assets, e.g. CSS, javascript, etc should go in the assets/
directory. They will be available as their full filename under assets
. For example if you make main.css
, it will be example.com/assets/main.css
Partials
Here is where you can customize the header and footer of pages in HTML. Currently all partials apply to all pages generated. Good things to do here would be if you have a static CSS file in assets/
or would like to include a a fonts CDN, add it into the <head>
in the assets/header.html
so it will be usable on your pages.
Notes
The path for content will be the name of the markdown file with no extension. For example if you make contact.md
, it will be example.com/contact
.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.