Hello guys,
I try to build a little author page where every author can write a little description and below there will be a list of all of his written posts. The URL looks like: “/content/author/{nameslug}/index.md”
In the markdown file I specify the type called author. The HTML file for that lies under “/layouts/author/single.html”. And everything works fine.
The problem is, that if I try to enter “localhost:1313/author/” i’ll get an 404 Error, which makes sense because there is no index file. So I decided to create a “/content/author/index.md” which has also the specified “type: author”. If I open this page I’ll get an overview of the authors which I coded in the single.html file. But now i can’t reach my author pages on “localhost:1313/author/{nameslug}” it just says 404 Error, but the files are existend?
shorted:
“/content/author/{nameslug}/index.md”:
---
type: author
id: ts
name: Tobias
---
my description
“/content/author/index.md”:
---
type: author
---
“/layouts/author/single.html”:
{{ define "main" }}
{{ $lastUrlElement := index (last 1 (split (delimit (split .Permalink "/") "," "") ",")) 0 }}
{{ if in $lastUrlElement "author" }}
<h1>authorList View</h1>
{{ else }}
<h1>authorPage View</h1>
{{ end }}
{{ end }}
But the authorPage (“localhost:1313/author/{nameslug}”) will result in an 404 not found error. If I delete the index.md under “/content/index.md” everything works but the: “localhost:1313/author” page results in an 404 error.
Thank you in advance
Regards