Create a minimalist markdown blogging platform via Github Actions
First visit the template repository at: zonemeen.github.io, then click on Use this template
on the right side of this repository.
Then name the repository according to your github username
: yourname.github.io
.
At the bottom are the specific configurations.
Create a repository(deployed via GitHub Pages, usually named yourname.github.io) on GitHub to host your blog, with the following directory structure:
โโโ about.md
โโโ site.json
โโโ posts
โโโ better-javascript.md
โโโ Vue vs React.md
โโโ technique-in-typescript.md
โโโ static
โโโ resume.pdf
โโโ assets
โโโ me.jpg
about.md
is the markdown file containing the content for your about page.
site.json
contains the configuration of the blog. Given below is the sample JSON configuration.
{
"title": "zonemeen",
"subtitle": "I'm a passionate, self-taught, career-changed front-end developer since 2021",
"owner": {
"name": "zonemeen",
"email": "miqilin18@gmail.com"
},
"social": [
{
"type": "Github",
"url": "https://github.com/zonemeen"
},
{
"type": "Twitter",
"url": "https://twitter.com/zonemeen"
}
],
"seo": {
"title": "zonemeen's blog",
"description": "A front-end engineer's article sharing",
"author": "zonemeen",
"keywords": [
"blog",
"javascript",
"typescript",
"passionate",
"self-taught",
"career-changed",
"front-end developer"
]
},
"cname": "zonemeen.github.io"
}
And cname
is your personal domain if applicable.
posts/
is the directory containing all your blog posts in Markdown format. It supports the following front-matter at the top of each blog post
---
title: Your first blog on GitHub Pages
date: 2022-06-20
permalink: /first-blog-ghpages
---
Content for your bog post
Where title
is the blog post title shown on the homepage as well as on the artical detail page. date
is the blog post date. permalink
is the path to the artical detail page.
The contents of the static
folder will be copied at the root of your blog and will be accessible via http://[blogurl]/filename
Once you have set up your blog repository, you need to configure the GitHub actions in your repository. Create the GitHub actions automated deployment process file at .github/workflows/deploy.yml
with the following content
name: Build and Deploy
on: [push]
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Deploy
uses: zonemeen/gitpress@v1.0.27 # Visit https://github.com/marketplace/actions/gitpress-deploy-blog-action, use latest version
with:
branch: gh-pages # Optional branch for GitHub Pages