Hi there!
This one is not full complete product, but probably you are looking for some startup template to adapt on your need
The idea was born when i decided to create my own blog.
WordPress looks outdated and all headless CMS looks like overhead.
So this is simple API that able to convert Markdown files into html pages. Yes, it's possible to do it without API at all, but I wanted some options to extend API by my own For example it's still possible to connect database and collect comments
Also, I'm looking for some safe place to store all data (texts and images) and Github looks perfect. As a bonus I have backups for every change I made.
- Fork repository
- Extend supportedEntities in config with your own entities (you can add your own entities such as Pages, Notes, e.t.c.)
- Create entity or use existed in source folder.
- Add your Markdown page
- Mare sure that all attachments placed in their folder and they accessible from your md file
- Add in meta section any json data you want (see example in ./source/posts/example-post.md)
- Simply run docker container and your new entity will be accessible by
${host}/api/${entity
&${host}/api/${entity/:slug
- If you don't want to use docker - call
npm run build
command on your server before application starts
To run Docker - build image docker build . -t app/markdown-blog
and run docker run -p 3000:3000 -d app/markdown-blog
Only GET entity requests implemented:
- GET
/posts
- GET
/posts/:slug
where slug is equal to filename
GET /posts accepts only pagination parameters:
- page - integer
- limit - integer
- Scan source directory and find all .md files
- Separate meta & md section
- md converted to html
- meta parsed as json
- using git timestamps detecting when file was added/modified
- all data (html, meta and timestamps) converted to json file and placed in public folder
- all attachments paths in html replaced to [[CDN_URL]] keyword
- all attachments move to public folder as they are
- All jsons from public directory load into memory
- Build index by slugs and timestamps to fast search entities
- Running express application to serve files