weblog.js
is a minimal blogging using Node.js. Using Marked.js and gray-matter.
See the blog post for more details.
- Clone this repository and install dependencies
https://github.com/w3teal/weblog.js.git cd weblog.js npm install
- Build the website
npm start
Instead of using the default content
and public
directory, you can configure it in const inputDir
/outputDir
in weblog.config.json. (In the output folder, you can also use that directory as asset storage)
You can create your own custom layout by changing on the function buildHTML
part in weblog.js.
You can use the default title
, date
, and description
data as frontmatter and reusable in layout. You can also add another data as you want, for example:
---
title: More data
+ ifykyk: Apple
---
You can use the ifykyk
data as ${ifykyk}
in layout.
You can add ${_listing}
to post you want. e.g. _content/_index.md
, the listing will be shown at that page (index.html
).
If you just want to add listing to adjusted latest posts, you can use e.g. ${_listing latest 2}
. File example
- Publish the repository with your desired client, like i use GitHub Desktop.
- Deploy
- For easier deploy, i recommend you to use Vercel. Just go to your Vercel dashboard, Click "Add New" > "Project" and click "Import" to the repo. That will automically serving
public
folder as root folder.
- For easier deploy, i recommend you to use Vercel. Just go to your Vercel dashboard, Click "Add New" > "Project" and click "Import" to the repo. That will automically serving
This project is not actively developed, and most updates are here for my blog at w3teal.is-a.dev. Use this project at your own risk, updates are not guaranteed! (But if you don't expect that, and just want to use a light and stable SSG, this might be for you).