Hello everyone!
I’ve just set up my personal blog directly from my Obsidian vault using GitHub Pages, and now you can too! This guide walks you through every step of the process. Whether you’re looking for a simple setup or want to use your own custom domain, this guide has you covered.
MyWebPage
..gitignore
, or license (we’ll handle
these later).blog
or any other name
you prefer.File name: My First Blog Post.md
Content:
---
title: "My First Blog Post"
date: 2025-01-02
tags: [blog, personal]
---
# My First Blog Post
This is the content of my very first blog post! It’s exciting to start this journey.
index.html
Fileblog
folder, create a new file named
index.html
..gitignore
File.gitignore
.blog
folder is
included..gitignore
file: git add blog/
git add .gitignoreOn GitHub, navigate to your repository and go to Settings.
Scroll down to the GitHub Pages section.
In the Source dropdown, select main
as the branch and / (root)
as the folder.
Save your changes. Your blog will be live at
https://YOUR-USERNAME.github.io/MyWebPage
. # Step 8:
(Optional) Set Up a Custom Domain
In the GitHub Pages section of your repository’s
settings, enter your domain name in the Custom domain
field (e.g., www.example.com
).
Add a CNAME
file to the root of your repository:
echo “www.example.com” > CNAME git add CNAME git commit -m “Add CNAME
for custom domain” git push origin main
Update the DNS settings of your domain to point to GitHub Pages. Add the following CNAME record:
www
YOUR-USERNAME.github.io
Your blog is now live and ready to go.
You can add new blog posts by creating markdown files in your blog
folder and linking them in the index.html
file.
If you set up a custom domain, your blog will be accessible at your domain name. Happy blogging!