I am slowly progressing in Hugo, now building a blog (without a theme - it is a one-shot).
The problem I am having is that with my home page (layouts/index.html
) …
{{ define "main" }}
<main>
This is the home page, but better
<ul>
<!-- Ranges through content/posts/*.md -->
{{ range .Pages }}
<li>
<a href="{{.Permalink}}">{{.Date.Format "2006-01-02"}} | {{.Title}}</a>
</li>
{{ end }}
</ul>
</main>
{{ end }}
… I get the following output
this is the header
before main aaa
This is the home page, but better
- 2022-05-01 | Posts
after main
This is the footer
2022-05-01 | Posts
i supposed to be the test page I created at content/posts/postone.md
:
---
title: "Post one"
date: 2022-05-01T22:12:06+02:00
draft: false
---
## this is the title of the post
### This is the first paragraph
Some text here with a --> and with a [some text]({{< ref "postone.md" >}})
Some **text** with a link to {{< gist wazaa gistId >}}
a link vers [google](https://google.com)
But in the output it is a link to http://localhost:1313/posts/
!
Interestingly enough, the date is correct so it was somehow processed, just the output is wrong (points to the posts directory instead of the actual post(s)).
Would anyone know where the mistake is?