Disclaimer: parts of this guide covers a piece of software called Markblog, of which I am the author.
This guide assumes that you are:
git
This guide will go through an easy way to get setup a blog. Afterwards, you will be able to blog with the following workflow:
To build our blog from Markdown, we will use Markblog. This is an open source tool written with Deno.
In order to deploy our website, we will use Github Pages. Github Pages is free and works - unsurprisingly - seamlessly with projects on Github. Additionally, Github Actions will be used to automate the deployment process. If these tools are unfamiliar, this might seem like a lot. But stick with me, it is all relatively simple when it comes together 😅
master
as source. cd $HOME/Documents
git clone https://github.com/<your-username>/<your-repository-name>
cd <your-repository-name>
markblog init
./style.css
to make your page look the way you wantMarkblog has created two files for you: index.md
and ./posts
.
Anything you write in index.md
will appear on the front-page of your blog.
./posts
is where you will write new posts on your blog.
Let's take a break from the setup, and write something!
index.md
, write a sentence or two about the blog. Or don't - it's up to you 🤗./posts
called my_first_post.md
. ./posts/my_first_post.md
. Or don't - still up to you 🍨After this step, we will have achieved the workflow outlined at the beginning! This section is long and somewhat cumbersome. However, this is automation! In other words, we only have to do this once!
ACCESS_TOKEN
, with the key from step 4.mkdir -p ./github/workflows
. touch ./github/workflows/deploy.yml
deploy.yml
: name: deploy
on:
push:
branches: [writing]
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- uses: denolib/setup-deno@master
with:
deno-version: 1.15.3
- name: Build
run: deno --allow-read --allow-write --unstable https://raw.githubusercontent.com/olaven/markblog/master/mod.ts build
- name: Deploy
uses: JamesIves/github-pages-deploy-action@releases/v3
with:
ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }}
BRANCH: master
FOLDER: . # The folder the action should deploy.
git checkout -b writing
git add . && git commit -m "initial blog setup"
git push --set-upstream origin writing
Congratulations 👏 🎊 Within a few minutes, your blog should go live.
Your next post is just an .md
-file away! To publish it, just push it
onto the writing
-branch, and your automation will do the rest 🍇 🍏
(If you are unsure about the URL, have a look at the "Github Pages"-seciton of your Github-repository 😃)
Check out Markblog's documentation for more information about how to customize your blog. See my blog(github repo) for a live example.
Thanks for reading!