1
0
mirror of https://github.com/writeas/writefreely synced 2025-01-05 20:47:30 +01:00

Include About/Privacy page content in page description

This commit is contained in:
Matt Baer 2018-11-21 15:04:47 -05:00
parent be2c7ef86b
commit 77e79acd06
3 changed files with 7 additions and 2 deletions

7
app.go
View File

@ -20,6 +20,7 @@ import (
"github.com/gorilla/schema"
"github.com/gorilla/sessions"
"github.com/manifoldco/promptui"
"github.com/writeas/go-strip-markdown"
"github.com/writeas/web-core/converter"
"github.com/writeas/web-core/log"
"github.com/writeas/writefreely/config"
@ -97,8 +98,9 @@ func handleViewHome(app *app, w http.ResponseWriter, r *http.Request) error {
func handleTemplatedPage(app *app, w http.ResponseWriter, r *http.Request, t *template.Template) error {
p := struct {
page.StaticPage
Content template.HTML
Updated string
Content template.HTML
PlainContent string
Updated string
AboutStats *InstanceStats
}{
@ -124,6 +126,7 @@ func handleTemplatedPage(app *app, w http.ResponseWriter, r *http.Request, t *te
return err
}
p.Content = template.HTML(applyMarkdown([]byte(c)))
p.PlainContent = shortPostDescription(stripmd.Strip(c))
if updated != nil {
p.Updated = updated.Format("January 2, 2006")
}

View File

@ -1,4 +1,5 @@
{{define "head"}}<title>About {{.SiteName}}</title>
<meta name="description" content="{{.PlainContent}}">
{{end}}
{{define "content"}}
<div class="content-container snug">

View File

@ -1,4 +1,5 @@
{{define "head"}}<title>{{.SiteName}} Privacy Policy</title>
<meta name="description" content="{{.PlainContent}}">
{{end}}
{{define "content"}}<div class="content-container snug">
<h1>Privacy Policy</h1>