diff options
author | Alan Pearce | 2024-06-18 20:19:05 +0200 |
---|---|---|
committer | Alan Pearce | 2024-06-18 20:19:05 +0200 |
commit | 1f9f24e2cef08f40fe2597b3644d08b28e31d370 (patch) | |
tree | b5157b49e8777335b54738ceada783450e8570e4 /internal/builder/builder.go | |
parent | b27c96688785372787eb5c3c71a32767fab71ac4 (diff) | |
download | website-1f9f24e2cef08f40fe2597b3644d08b28e31d370.tar.lz website-1f9f24e2cef08f40fe2597b3644d08b28e31d370.tar.zst website-1f9f24e2cef08f40fe2597b3644d08b28e31d370.zip |
pass rendered html to homepage
Diffstat (limited to 'internal/builder/builder.go')
-rw-r--r-- | internal/builder/builder.go | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/internal/builder/builder.go b/internal/builder/builder.go index 141bd6f..b4ade4a 100644 --- a/internal/builder/builder.go +++ b/internal/builder/builder.go @@ -206,7 +206,15 @@ func build(outDir string, config config.Config) (*Result, error) { r.Hashes = append(r.Hashes, h) log.Debug("rendering homepage") - if err := renderToFile(homepage(config, posts), publicDir, "index.html"); err != nil { + _, text, err := content.GetPost(path.Join("content", "_index.md")) + if err != nil { + return nil, err + } + content, err := content.RenderMarkdown(text) + if err != nil { + return nil, err + } + if err := renderToFile(homepage(config, posts, content), publicDir, "index.html"); err != nil { return nil, err } // it would be nice to set LastMod here, but using the latest post |