summaryrefslogtreecommitdiff
path: root/markdown
diff options
context:
space:
mode:
authora73x <[email protected]>2024-09-03 08:52:12 +0100
committera73x <[email protected]>2024-09-03 08:52:12 +0100
commit17b008f72f284ea989fddb2b6b52c2ca558c985a (patch)
treeacb286b07dd62fc0e539ae466536132b3c9b7c94 /markdown
parent1c0e1cc8c6a51457907ce028599c2bcad82d0bfd (diff)
chore(html): refactor nav to be more dynamic
Diffstat (limited to 'markdown')
-rw-r--r--markdown/markdown.go5
1 files changed, 4 insertions, 1 deletions
diff --git a/markdown/markdown.go b/markdown/markdown.go
index 658e527..1a529f6 100644
--- a/markdown/markdown.go
+++ b/markdown/markdown.go
@@ -60,7 +60,10 @@ func parseMarkdownFile(embedded fs.FS, path string) (Content, error) {
if err != nil {
return Content{}, fmt.Errorf("failed to parse frontmatter: %v", err)
}
- path = strings.Replace(path, ".md", "", 1)
+ path = "/" + strings.Replace(path, ".md", "", 1)
+ if path == "/index" {
+ path = "/"
+ }
mc := Content{
Body: string(rest),