How to install Hugo in ubuntu
Quickloss3
Update Server: apt update && apt upgrade -y
Install Hugo: wget https://github.com/gohugoio/hugo/releases/download/v0.79.0/hugo_0.79.0_Linux-64bit.deb dpkg -i hugo_0.79.0_Linux-64bit.deb hugo version
Create a Website: hugo new site example.com cd example.com hugo new main.md nano content/main.md Add the following lines at the end of file:
Test Page
This is my first test page.
Download and Install a Theme: cd themes wget https://github.com/digitalcraftsman/hugo-strata-theme/archive/master.zip apt install unzip -y unzip master.zip mv hugo-strata-theme-master hugo-strata-theme
I'm replacing angled bracket with square bracket
cat hugo-strata-theme/exampleSite/config.toml ] ../config.toml nano ../config.toml Change the base URL and define your page name as shown below:
baseurl = "/" [[menu.main]] name = "main" url = "main" weight = 5
nano /root/example.com/layouts/index.html Add the following lines:
{{ define "main" }} {{ if not .Site.Params.about.hide }} {{ partial "about" . }} {{ end }}
{{ if not .Site.Params.portfolio.hide }} {{ partial "portfolio" . }} {{ end }}
{{ if not .Site.Params.recentposts.hide }} {{ partial "recent-posts" . }} {{ end }}
{{ if not .Site.Params.contact.hide }} {{ partial "contact" . }} {{ end }} {{ end }}
Build Your Website: cd /root/example.com hugo
hugo server --bind=0.0.0.0 --baseUrl=http://server_ip -D -F ... https://www.youtube.com/watch?v=7pjEN3HuiAk
15572352 Bytes