Because the repo contains submodules, you need to clone it recursively:
git clone https://github.com/chapimenge3/blog.git
cd blog
git submodule update --init --recursive
To run the project you need to install hugo. You can find the instructions here.
hugo server -D
The Blog posts are located in the content/posts
directory. But one feature I added is categories, it means that you filter by category of blog post.
You might be wondering why i am talking about categories, well, it's because the categories are also located in the content/posts
directory. So, to add a new post, you need to create a new directory in the content/posts
directory with the name of the category you want to add the post to. Then, create a new file with the name of the post you want to add. The file should have the .md
extension. But if only the category you want to add the post to doesn't exist, you can create it and add the post in it.
With this in mind, the command to add a new post is:
hugo new posts/<category>/<post-name>.md
Adding category is as simple as creating directory/folder inside of content/posts
directory. The name of the directory/folder will be the name of the category.
The site is currently linked to Github pages. So to deploy the site, you need to push the changes to the main
branch. The site will be automatically deployed to Github pages.
The instruction detail can be found ./.github/workflows/hugo.yml.
To add a custom domain name, follow the below steps:
- Go to Github repository > Settings > Pages > Custom domain
- Add your custom domain name
To add a custom root domain name, follow the Github documentation.
To add Google Analytics, follow the below steps:
- Go to Google Analytics
- Create a new property
- Copy the tracking ID
- open
config.toml
file - Add the tracking ID to the
googleAnalytics
field
To add Disqus, follow the below steps:
- Go to Disqus
- Create a new site
- Copy the shortname
- open
config.toml
file - Add the shortname to the
disqusShortname
field
That's it. You are good to go.