diff options
author | Alan Pearce | 2025-01-25 00:04:17 +0100 |
---|---|---|
committer | Alan Pearce | 2025-01-25 00:04:17 +0100 |
commit | b1677cfd7cb2a30afaf581d4477e9c00d62a73c2 (patch) | |
tree | f78b356b531e8b5d5e4eb9dbb50a6a772dfbb616 | |
parent | f31f62dc9b2036bddf91dc9f99479773347acfaf (diff) | |
download | website-b1677cfd7cb2a30afaf581d4477e9c00d62a73c2.tar.lz website-b1677cfd7cb2a30afaf581d4477e9c00d62a73c2.tar.zst website-b1677cfd7cb2a30afaf581d4477e9c00d62a73c2.zip |
fix post URL generation
-rw-r--r-- | internal/content/posts.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/internal/content/posts.go b/internal/content/posts.go index 467f36f..f8e2d16 100644 --- a/internal/content/posts.go +++ b/internal/content/posts.go @@ -99,8 +99,8 @@ func ReadPosts(config *Config, log *log.Logger) ([]Post, Tags, error) { fn := f.Name() if !f.IsDir() && path.Ext(fn) == ".md" { output := path.Join(config.InputDir, outputReplacer.Replace(fn)) - url := urlReplacer.Replace(strings.TrimPrefix("/", fn)) - log.Debug("reading post", "post", fn) + url := path.Join("/", config.InputDir, urlReplacer.Replace(fn)) + "/" + log.Debug("reading post", "post", fn, "url", url) matter, content, err := GetPost(path.Join(subdir, fn)) if err != nil { return nil, nil, err |