Hugo Static website builder
Debian
Derivatives of the Debian distribution of Linux include elementary OS, KDE neon, Linux Lite, Linux Mint, MX Linux, Pop!_OS, Ubuntu, Zorin OS, and others. To install the extended edition of Hugo:
sudo snap install hugoTo enable or revoke access to removable media:
sudo snap connect hugo:removable-mediasudo snap disconnect hugo:removable-mediaRun these commands to create a Hugo site with the Ananke theme.
hugo new site quickstartcd quickstartgit initgit submodule add
https://github.com/theNewDynamic/gohugo-theme-ananke.git themes/anankeecho "theme = 'ananke'" >>
hugo.tomlhugo serverADD different theme
Minimum Hugo Version: 0.110.0
Run from the root of your Hugo site:
git clone
https://github.com/apvarun/blist-hugo-theme.
git themes/blistAlternatively, you can include this repository as a git submodule. This makes it easier to update this theme if you have your Hugo site in git as well:
git submodule add
https://github.com/apvarun/blist-hugo-theme.
git themes/blistConfiguring theme to a hugo website
- Copy
package.jsonandpackage-lock.jsonto the root folder of your website - Run
npm installto install required packages for theme - Run
npm i -g postcss-clito use PostCSS with Hugo build - Set
theme = 'blist'in config.toml - Run
npm startto start your local server
Make sure to commit the above changes to your repository.
Install Apache on computer
sudo
apt update
sudo
apt install apache2https://ubuntu.com/tutorials/install-and-configure-apache#1-overview
Hugo theme
https://themes.gohugo.io/Add content
hugo new content posts/my-first-post.mdHugo created the file in the content/posts directory. Open the file with your editor.
+++title = 'My First Post'date = 2024-01-14T07:07:07+01:00draft = true+++Save the file, then start Hugo’s development server to view the site. You can run either of the following commands to include draft content.
hugo server --buildDraftshugo server -DRun Hugo
hugo server -DBuild Website
hugoWhen you publish your site, Hugo creates the entire static site in the public directory in the root of your project. This includes the HTML files, and assets such as images, CSS files, and JavaScript files.
Configure Hugo
Summarize Installation and Usage of Hugo on Debian-based Systems
This document outlines the installation process and basic usage of Hugo, a static site generator, on Debian-based Linux distributions.
Installation:
The extended edition of Hugo can be installed using the snap package manager.
sudo snap install hugoEnabling/Disabling Removable Media Access:
Grant or revoke access to removable media for Hugo:
- Enable:
sudo snap connect hugo:removable-media - Disable:
sudo snap disconnect hugo:removable-media
Creating a New Site:
- Create a new Hugo site named “quickstart”:
hugo new site quickstart- Navigate to the newly created directory:
cd quickstart- Initialize a Git repository for version control:
git init- Install the Ananke theme using Git submodules:
git submodule add
https://github.com/theNewDynamic/gohugo-theme-ananke.
git themes/ananke- Configure the site to use the Ananke theme by adding a line to
hugo.toml:
echo "theme = 'ananke'" >> hugo.toml- Start the Hugo development server:
hugo serverAdding Content:
- Create a new Markdown file for your content:
hugo new content posts/my-first-post.md- Edit the content of
my-first-post.mdwith your preferred editor. - (Optional) Include draft content in the development server by running one of these commands:
hugo server --buildDraftshugo server -DBuilding and Running the Site:
- Build the entire static website:
hugo- The built website will be located in the
publicdirectory. - Start the development server to view the site during development:
hugo server -DFurther Configuration:
Refer to the official Hugo documentation (https://gohugo.io/getting-started/configuration/) for detailed configuration options.
