MCPcopy Index your code
hub / github.com/writefreely/writefreely / getAboutPage

Function getAboutPage

pages.go:21–37  ·  view source on GitHub ↗
(app *App)

Source from the content-addressed store, hash-verified

19var defaultPageUpdatedTime = time.Date(2018, 11, 8, 12, 0, 0, 0, time.Local)
20
21func getAboutPage(app *App) (*instanceContent, error) {
22 c, err := app.db.GetDynamicContent("about")
23 if err != nil {
24 return nil, err
25 }
26 if c == nil {
27 c = &instanceContent{
28 ID: "about",
29 Type: "page",
30 Content: defaultAboutPage(app.cfg),
31 }
32 }
33 if !c.Title.Valid {
34 c.Title = defaultAboutTitle(app.cfg)
35 }
36 return c, nil
37}
38
39func defaultAboutTitle(cfg *config.Config) sql.NullString {
40 return sql.NullString{String: "About " + cfg.App.SiteName, Valid: true}

Callers 2

handleViewAdminPageFunction · 0.85
handleTemplatedPageFunction · 0.85

Calls 3

defaultAboutPageFunction · 0.85
defaultAboutTitleFunction · 0.85
GetDynamicContentMethod · 0.65

Tested by

no test coverage detected