From 73ec3e3016bb81bddca21840559335efb320bebe Mon Sep 17 00:00:00 2001 From: Matt Baer Date: Wed, 31 Jul 2019 22:53:10 -0400 Subject: [PATCH] Support toning down WriteFreely promotion This adds a new `wf_modesty` config option that removes the copious mentions of WriteFreely in places like the About page and site footers. WriteFreely remains boastful and bumptious by default; but enabling the modesty option will tone it down and likely lead to less confusion among average users. Ref T676 --- config/config.go | 1 + pages/about.tmpl | 2 ++ templates/include/footer.tmpl | 20 ++++++++++++++------ templates/user/include/footer.tmpl | 4 ++++ 4 files changed, 21 insertions(+), 6 deletions(-) diff --git a/config/config.go b/config/config.go index 8009208..46b3e19 100644 --- a/config/config.go +++ b/config/config.go @@ -66,6 +66,7 @@ type ( JSDisabled bool `ini:"disable_js"` WebFonts bool `ini:"webfonts"` Landing string `ini:"landing"` + WFModesty bool `ini:"wf_modesty"` // Users SingleUser bool `ini:"single_user"` diff --git a/pages/about.tmpl b/pages/about.tmpl index 0fae12b..7c502dc 100644 --- a/pages/about.tmpl +++ b/pages/about.tmpl @@ -12,6 +12,7 @@

{{.SiteName}} is home to {{largeNumFmt .AboutStats.NumPosts}} {{pluralize "article" "articles" .AboutStats.NumPosts}} across {{largeNumFmt .AboutStats.NumBlogs}} {{pluralize "blog" "blogs" .AboutStats.NumBlogs}}.

{{end}} + {{if not .WFModesty}}

About WriteFreely

WriteFreely is a self-hosted, decentralized blogging platform for publishing beautiful, simple blogs.

It lets you publish a single blog, or host a community of writers who can create multiple blogs under one account. You can also enable federation, which allows people in the fediverse to follow your blog, bookmark your posts, and share them with others.

@@ -23,5 +24,6 @@

WriteFreely

+ {{end}} {{end}} diff --git a/templates/include/footer.tmpl b/templates/include/footer.tmpl index 32a7e68..16434b9 100644 --- a/templates/include/footer.tmpl +++ b/templates/include/footer.tmpl @@ -1,13 +1,21 @@ {{define "footer"}} - +
- {{if .SingleUser}} + {{if or .SingleUser .WFModesty}} {{else}}
diff --git a/templates/user/include/footer.tmpl b/templates/user/include/footer.tmpl index 36a69fa..a2b2f06 100644 --- a/templates/user/include/footer.tmpl +++ b/templates/user/include/footer.tmpl @@ -12,7 +12,11 @@ {{if and (not .SingleUser) .LocalTimeline}}reader{{end}} writer's guide privacy + {{if .WFModesty}} +

powered by writefreely

+ {{else}} writefreely {{.Version}} + {{end}}