diff options
| author | a73x <[email protected]> | 2024-09-08 18:55:40 +0100 |
|---|---|---|
| committer | a73x <[email protected]> | 2024-09-08 18:55:40 +0100 |
| commit | 71995ed10e69c4675e9fda50d43f3523af48d86c (patch) | |
| tree | dcce1ec17b5630b6f0c4031ac7815add9905682a /markdown | |
| parent | 933ef3568992802a565d2e6a8d1c7fb231139663 (diff) | |
chore(template): refactor how paths are made
Diffstat (limited to 'markdown')
| -rw-r--r-- | markdown/markdown.go | 8 |
1 files changed, 5 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, |
