I decided to use the Jamstack approach to building a website.
I chose Hugo as my static site generator.
Install Homebrew
- In terminal, run:
/bin/bash -c "$(curl -fsSL
https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh
)"
Install Hugo
- In terminal, run
brew install hugo
Install Go
- Install Go from here: https://go.dev/dl/
- Check if you have installed it by running
go version
in terminal.
Install Visual Studio Code
- Download Visual Studio Code here: https://code.visualstudio.com/
- Install.
Install code to launch VSC in terminal
- Open terminal.
- Press CMD +SHIFT + P
- Type
shell command
- Select Install code command in path
Create a new site
- In terminal, navigate to your desktop by running:
cd desktop
- In terminal, run
hugo new site mywebsite
(substitute “mywebsite” with the name of your site) - This will create a project folder in your desktop with the name you gave it.
Choose a theme
- Go to https://themes.gohugo.io/ and choose a theme.
- A good theme with very good documentation great for beginners is Congo.
Install Congo
- Navigate into the project folder by running:
cd desktop/mywebsite
- Initialize modules for your website by running:
hugo mod init mywebsite
- Open the site directory in VSC using the terminal by running
code .
- In VSC, create a new file
config/_default/module.toml
- Inside the file, copy and paste this:
- In the terminal, run
hugo server
to download the theme. - In your browser, type http://localhost:1313/ to see your new hugo site.
Set up theme configuration files
- Download the theme config files from Github
- Copy the files into your config/_default/ folder
Update Congo theme
- In terminal, navigate to your project directory.
- Run
hugo mod get -u
Personalize your theme
- In VSC, delete the config.toml file in the root directory.
- Go to config/_default/config.toml
- Change the baseURL to the URL you will be using for the site.
- Change the title to the name of the site.
- In VSC, go to params.toml
- Uncomment darMode and keep “auto”.
- Uncomment description and paste: Laman ng website na ito ang mga sulat ni Henry David Thoreau na isinalin sa Filipino.
- Set the following to false: showDate, showAuthor, showBreadcrumbs, showEdit, editAppendPath, showHeadingAnchors, showPagination, showReadingTime, showWordCount, showBreadcrumbs, showSummary, groupByYear = false, showTermCount = false
Setup menu
- In terminal, create two pages by running the following:
hugo new Tungkol-sa-KNU.md
hugo new Makipag-ugnayan.md
- In VSC, go to each new file created and set draft to false
- In VSC, go to menus.toml and copy paste the following:
[[main]]
name = "Tungkol sa KNU"
pageRef = "Tungkol-sa-KNU
”
weight = 10
[[main]]
name = "Mga Salin"
url = "
https://www.craft.do/s/LXnNJVva6enIph
"
weight = 20
[[main]]
name = "Makipag-ugnayan"
pageRef = "Makipag-ugnayan
”
weight = 30
Create a homepage
- In VSC, be sure that the configuration for the homepage in params.toml is set to “page”.
- Create an _index.md file under content.
Create a favicon for the site
- Go to https://favicon.io/
- Upload the favicon image.
- Download the files generated by the tool.
- Upload the following files to the static folder in your site’s root directory:
- Create a new file:
layouts/partials/favicons.html