Code: Alles auswählen
hugo new site aspweb-test
cd aspweb-test
Code: Alles auswählen
git init
git submodule add https://github.com/theNewDynamic/gohugo-theme-ananke.git themes/ananke
echo 'theme = "ananke"' >> config.toml
Code: Alles auswählen
nano content/posts/aspweb-test.md
Code: Alles auswählen
hier ein Beispiel von mir
+++
date = '2025-05-25T17:50:19+02:00'
draft = false
title = 'aspweb'
+++
Das ist **meine erste Webseite** mit Hugo
Code: Alles auswählen
nano layouts/posts/index.html
Code: Alles auswählen
<!DOCTYPE html>
<html>
<head>
<title>{{ .Site.Title }}</title>
</head>
<body>
<h1>{{ .Site.Title }}</h1>
<ul>
{{ range where .Site.RegularPages "Type" "posts" }}
<li><a href="{{ .RelPermalink }}">{{ .Title }}</a></li>
{{ end }}
</ul>
</body>
</html>
Code: Alles auswählen
nano layouts/posts/single.html
Code: Alles auswählen
<!DOCTYPE html>
<html>
<head>
<title>{{ .Title }} | {{ .Site.Title }}</title>
</head>
<body>
<article>
<h1>{{ .Title }}</h1>
{{ .Content }}
</article>
</body>
</html>
Code: Alles auswählen
nano layouts/posts/_default/single.html
Code: Alles auswählen
<!DOCTYPE html>
<html>
<head>
<title>{{ .Title }} | {{ .Site.Title }}</title>
</head>
<body>
<article>
<h1>{{ .Title }}</h1>
{{ .Content }}
</article>
</body>
</html>
Code: Alles auswählen
hugo --minify
Auf Testwebserver kopieren
Code: Alles auswählen
rsync -avz --delete public/ [email protected]:/home/asp/nginx-php-server/html
PS. mein Test-Webserver hat die IP 192.168.31.21 und läuft auf Port 8085
Code: Alles auswählen
192.168.31.21:8085
Wenn du keinen Webserver hast, kannst du auch einen virtuellen Webserver starten
Code: Alles auswählen
hugo server --bind=0.0.0.0 --baseURL=http://localhost:8085 --port=8085
Code: Alles auswählen
localhost:8085