Creating New Hugo Site
In This page we will learn about different methods of creating new website with hugo.
Create from Template
- Download the zip file of template/exampleSite from github or any website.
- Then we extract that and run
hugo server -D
-D. (The -D arg is for showing drafts).
Create from Scratch
Create a Skelton/Folders Structure for New Hugo Website
- local Setup
- create folder with the name of your website
- open folder with Visual Studio Code
- then open terminal by pressing CTRL + `
- Type the command
hugo new site .
or
- local setup
- open terminal
- go to the directory where you want to put your website
- type the command
hugo new site digitalstudio-ltd --format yaml
Add website to version control
- git init .
- git add *
- git commit -m “Create website skeleton”
Hugo Structure
Developer Templates Author Content
Default Hugo Folders
Default
archetypes content data layouts themes static
Not created by Hugo until needed
config assets public resources _vendor go.mod go.sum
Part of JAMSTACK
node_modules .github api package.json package-lock.json package.hugo.json
–port
–disableFastRender and –disableLiveReload, respectively
Restart the dev server, clear the browser cache, and use hugo server –noHTTPCache –disableFastRender to help in these cases