gohugo windows
- Download GoHugo:
- Visit the official GoHugo website: https://gohugo.io/
- Navigate to the "Getting Started" section.
- Click on the "Latest Releases" link.
Download the Windows version of the extended version of Hugo.
Extract Hugo:
- Locate the downloaded ZIP file.
- Right-click on the file and select "Extract All..."
Choose a destination folder and click "Extract."
Set Environment Variables:
- Open the Start menu and search for "Environment Variables."
- Select "Edit the system environment variables."
- Click the "Environment Variables..." button.
- Under "System variables," find the "Path" variable and click "Edit..."
Click "New" and add the path to the "bin" folder inside the extracted Hugo directory.
Verify Installation:
- Open a new command prompt or PowerShell window.
- Type
hugo version
and press Enter. Verify that the installed Hugo version is displayed without errors.
Create a New Hugo Site:
- Choose or create a directory for your new Hugo site.
- Open a command prompt or PowerShell window.
- Navigate to the chosen directory using the
cd
command. Run the command
hugo new site <sitename>
to create a new Hugo site.Choose a Theme:
- Navigate to the themes directory inside your Hugo site folder.
Run the command
git clone <theme-repository-url>
to clone a Hugo theme from a Git repository.Configure the Site:
- Open the
config.toml
file in the root of your Hugo site folder using a text editor. Configure basic settings such as the site title, baseURL, and theme.
Create Content:
- Use the
hugo new <section-name>/<content-title>.md
command to create new content. Open the created Markdown file in a text editor and add your content.
Start the Hugo Server:
- Run the command
hugo server -D
to start the Hugo development server. Open a web browser and navigate to the provided local server address (usually http://localhost:1313) to preview your site.
Build the Site:
- When satisfied with your changes, stop the Hugo server.
- Run the command
hugo
to build the final static site. The generated site files will be available in the "public" folder within your Hugo site directory.
Deploy the Site:
- Copy the contents of the "public" folder to your web server or hosting provider to deploy your Hugo site.