Skip to content

Commit

Permalink
improve handling of index description in pages pre render data
Browse files Browse the repository at this point in the history
  • Loading branch information
kkoreilly committed Aug 18, 2024
1 parent 82d4b90 commit 4e42067
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion cmd/core/web/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,18 +112,22 @@ func makeFiles(c *config.Config) error {
}
}
preRenderHTMLIndex := preRenderHTML
preRenderDescriptionIndex := ""
pagesPreRenderData := &ppath.PreRenderData{}
if strings.HasPrefix(preRenderHTML, "{") {
err := jsonx.Read(pagesPreRenderData, strings.NewReader(preRenderHTML))
if err != nil {
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
}
Expand Down

0 comments on commit 4e42067

Please sign in to comment.