From 4e42067b6ed0ac3216e91825395c5b6b255c1858 Mon Sep 17 00:00:00 2001 From: Kai O'Reilly Date: Sat, 17 Aug 2024 17:52:46 -0700 Subject: [PATCH] improve handling of index description in pages pre render data --- cmd/core/web/build.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cmd/core/web/build.go b/cmd/core/web/build.go index 0c61bc4968..d2c82fc493 100644 --- a/cmd/core/web/build.go +++ b/cmd/core/web/build.go @@ -112,6 +112,7 @@ func makeFiles(c *config.Config) error { } } preRenderHTMLIndex := preRenderHTML + preRenderDescriptionIndex := "" pagesPreRenderData := &ppath.PreRenderData{} if strings.HasPrefix(preRenderHTML, "{") { err := jsonx.Read(pagesPreRenderData, strings.NewReader(preRenderHTML)) @@ -119,11 +120,14 @@ func makeFiles(c *config.Config) error { return err } preRenderHTMLIndex = pagesPreRenderData.HTML[""] + if c.About == "" { + preRenderDescriptionIndex = pagesPreRenderData.Description[""] + } if c.Pages == "" { c.Pages = "content" } } - iht, err := makeIndexHTML(c, "", "", "", preRenderHTMLIndex) + iht, err := makeIndexHTML(c, "", "", preRenderDescriptionIndex, preRenderHTMLIndex) if err != nil { return err }