Create Markdown Post for blog and website using Mustache Template System.
Don't use this Directly - Fork this repo and Modify according to your Needs also not Recommended for Production use.
- Express.js for Server and API
- Mustache.JS for Template
- Slugify for Generate SEO Friedly Filename and Slug
- Auto Date Generation
- Handlebar for HTML Template page
- CSRF Token - https://expressjs.com/en/resources/middleware/csurf.html
- axios HTTP Client for Post data
- HTTP basic auth - https://github.com/LionC/express-basic-auth
- Bulma CSS Framework
- Express Validator
- Clone or Download the repo
git clone https://github.com/mskian/create-markdown-post.git
cd create-markdown-post
yarn
- Start the Dev server
yarn dev
- Start the Production Server
yarn start
- Post New Content
http://localhost:3005/api
- Post via API - it Require Basic HTTP Auth - Update password in
config.js
file
http://localhost:3005/api?title=This%20is%20Example%20Post%20title&description=This%20is%20Example%20Post%20Meta%20Description%20-%20post%20via%20HTTP%20Client%20via%20API.&postcontent=This%20is%20Example%20Post%20Meta%20Description%20-%20post%20via%20HTTP%20Client%20via%20API.&tag=Test
-
if you want to update HTTP auth username find this line
users: { 'admin':sitedata.password },
inindex.js
- Default usernameadmin
and password123456789
-
Post via Javascript Markdown Editor - refer: https://github.com/mskian/svelte-markdown-editor - Example:
/views/editor.hbs
http://localhost:3005/markdown
- Modify the Post template Content data on
index.js
- Add storage path, Markdown Extension, Password and Manual URL Slug Generation Name in
config.json
- if you want add custom slug in Markdown File -
template.md
---
title: "{{title}}"
date: {{date}}
description: "{{description}}"
tags:
- "{{tag}}"
slug: "{{seo_url}}"
---
{{postcontent}}
- Example Post - https://github.com/mskian/create-markdown-post/tree/main/posts
- Modify Template Content data -
Line 179 in bbaa511
- HTTP Username -
Line 202 in bbaa511
MIT