Build Your Own Blog Website in 10 Minutes
1 What is Hugo
Hugo is one of the most popular open-source static site generators. Users can quickly build their own websites using Hugo.
2 Setup Steps
2.1 Install Hugo
On a Mac, you can use the following command to install Hugo:
brew install hugo
After installation, you can check if it’s installed properly using hugo version
:
2.2 Create a Blog Website with Hugo
Once Hugo is installed, you can use it to create your own blog website.
Use hugo new site my-blog
to create a site named my-blog.
After running this command, a directory named my-blog will be created in the current directory.
Then, navigate into that directory and initialize it with git.
cd my-blog
git init
2.3 Choose a Theme
After creating the website, you need to choose a theme. There are many themes available for selection: hugo themes Here, I am choosing the hugo-theme-even theme. At this point, it needs to be added as a submodule under themes/even.
git submodule add https://github.com/olOwOlo/hugo-theme-even.git themes/even
After that, copy
themes/even/exampleSite/config.toml
to the current directory and overwrite hugo.toml
cp themes/even/exampleSite/config.toml hugo.toml
2.4 Create a Blog Post
Once the theme is configured, you can create your own blog post.
Use hugo new content/content/post/my-first-post.md
to create a blog post.
You can see that a new md file will appear under content/post/
after executing this command.
2.5 Run Hugo
Once the previous configurations are done, you can start a Hugo server using hugo server
.
Click the link to access the blog website address.
At this point, you will notice that the previously created blog does not appear; the reason is that the blog created earlier is set as
draft
, and it will not be displayed in hugo server
mode.
To show it, you need to use hugo server -D
.
With this, you can complete the setup of your blog website.
2.6 Save the Local Blog to GitHub
- Log in to GitHub and create a new repository (e.g., heyjude-blog).
- Add the local repository as a remote:
git remote add origin https://github.com/yourusername/myblog.git
git push
This way, you can save your blog to GitHub.