summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--markdown/markdown.go8
-rw-r--r--pages/pages.go1
2 files changed, 6 insertions, 3 deletions
diff --git a/markdown/markdown.go b/markdown/markdown.go
index 1a529f6..cc2abf1 100644
--- a/markdown/markdown.go
+++ b/markdown/markdown.go
@@ -60,11 +60,13 @@ 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)
- if path == "/index" {
- path = "/"
+ path = strings.Replace(path, ".md", "", 1)
+ if path == "index" {
+ path = ""
}
+ path = "/" + path
+
mc := Content{
Body: string(rest),
Path: path,
diff --git a/pages/pages.go b/pages/pages.go
index 610444c..8adb9e1 100644
--- a/pages/pages.go
+++ b/pages/pages.go
@@ -96,6 +96,7 @@ func Collect() ([]Page, error) {
}
sortNavBar(gs.Nav)
+
pages := []Page{}
for _, content := range contents {
page, err := renderTemplate(gs, content)