Creating New Hugo Site

In This page we will learn about different methods of creating new website with hugo.

Create from Template

  1. Download the zip file of template/exampleSite from github or any website.
  2. 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

  1. local Setup
  2. create folder with the name of your website
  3. open folder with Visual Studio Code
  4. then open terminal by pressing CTRL + `
  5. Type the command hugo new site .

or

  1. local setup
  2. open terminal
  3. go to the directory where you want to put your website
  4. type the command hugo new site digitalstudio-ltd --format yaml

Add website to version control

  1. git init .
  2. git add *
  3. 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

Next