Update Server:
apt update && apt upgrade -y
Install Hugo:
wget https://github.com/gohugoio/hugo/rele...
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/h...
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
Смотрите видео How to install Hugo in ubuntu онлайн без регистрации, длительностью часов минут секунд в хорошем качестве. Это видео добавил пользователь Quickloss3 29 Январь 2023, не забудьте поделиться им ссылкой с друзьями и знакомыми, на нашем сайте его посмотрели 640 раз и оно понравилось 14 людям.