This guide will walk you through the process of setting up a Hugo site and deploying it on Vercel, using the sample content from the hugo-template repo and the hugo-coder theme.
- Node.js installed on your machine
- Homebrew installed (for macOS users)
- A GitHub account
- Git installed on your machine
-
Install the Vercel CLI globally:
npm i -g vercel
-
Log in to Vercel using your GitHub account:
vercel login --github
-
Install Hugo using Homebrew (for macOS users):
brew install hugo
-
Clone the hugo-template repo:
git clone https://github.com/bsidio/hugo-template.git
-
Navigate to the cloned directory:
cd hugo-template
3.1 Add the hugo-coder theme as a Git submodule:
git submodule update --init --recursive
To add new theme
git submodule add https://github.com/luizdepra/hugo-coder.git themes/hugo-coder
-
Edit the
hugo.toml
file and set thetheme
property to"hugo-coder"
:theme = 'hugo-coder'
-
Create a new content file:
hugo new content/about.md
-
Start the Hugo server with drafts enabled:
hugo server --buildDrafts
-
Open your browser and navigate to
http://localhost:1313
to see your site.
-
Initialize your Hugo site as a Git repository (if not already done):
git init
-
Add and commit your changes:
git add . git commit -m "Initial commit"
-
Deploy your site to Vercel:
vercel
Follow the prompts to configure your deployment settings.
-
Once the deployment is complete, you'll receive a URL where your site is live.
That's it! You've successfully set up a Hugo site with the hugo-coder theme and deployed it on Vercel using the sample content from the hugo-template repo.