+
{{template "footer" .}}
{{end}}
From bf4f8793832df63f2e426ac9edc556029d6a738b Mon Sep 17 00:00:00 2001
From: Matt Baer
Date: Mon, 4 Nov 2019 14:06:24 -0500
Subject: [PATCH 05/17] Update hosting options in README
Now: Write.as Pro and Write.as for Teams
---
README.md | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/README.md b/README.md
index 4f0b6bb..68da89b 100644
--- a/README.md
+++ b/README.md
@@ -47,15 +47,15 @@ It's designed to be flexible and share your writing widely, so it's built around
## Hosting
-We offer two kinds of hosting services that make WriteFreely deployment painless: [Write.as](https://write.as) for individuals, and [WriteFreely.host](https://writefreely.host) for communities. Besides saving you time, as a customer you directly help fund WriteFreely development.
+We offer two kinds of hosting services that make WriteFreely deployment painless: [Write.as Pro](https://write.as/pro) for individuals, and [Write.as for Teams](https://write.as/for/teams) for businesses. Besides saving you time and effort, both services directly fund WriteFreely development and ensure the long-term sustainability of our open source work.
-### [![Write.as](https://write.as/img/writeas-wf-readme.png)](https://write.as/)
+### [![Write.as Pro](https://writefreely.org/img/writeas-pro-readme.png)](https://write.as/pro)
-Start a personal blog on [Write.as](https://write.as), our flagship instance. Built to eliminate setup friction and preserve your privacy, Write.as helps you start a blog in seconds. It supports custom domains (with SSL) and multiple blogs / pen names per account. [Read more here](https://write.as/pricing).
+Start a personal blog on [Write.as](https://write.as), our flagship instance. Built to eliminate setup friction and preserve your privacy, Write.as helps you start a blog in seconds. It supports custom domains (with SSL) and multiple blogs / pen names per account. [Read more here](https://write.as/pro).
-### [![WriteFreely.host](https://writefreely.host/img/wfhost-wf-readme.png)](https://writefreely.host)
+### [![Write.as for Teams](https://writefreely.org/img/writeas-for-teams-readme.png)](https://write.as/for/teams)
-[WriteFreely.host](https://writefreely.host) makes it easy to start a close-knit community — to share knowledge, complement your Mastodon instance, or publish updates in your organization. We take care of the hosting, upgrades, backups, and maintenance so you can focus on writing.
+[Write.as for Teams](https://write.as/for/teams) gives your organization, business, or [open source project](https://write.as/for/open-source) a clutter-free space to share updates or proposals and build your collective knowledge. We take care of hosting, upgrades, backups, and maintenance so your team can focus on writing.
## Quick start
From e1149cd1e95154e4e72aca606e5582ad5dcbc7cf Mon Sep 17 00:00:00 2001
From: Matt Baer
Date: Thu, 7 Nov 2019 17:24:04 +0900
Subject: [PATCH 06/17] Fix URLs in CSV exports
This includes the instance's hostname in calls to export a CSV file and
PublicPost.CanonicalURL().
It also fixes a panic in that method during CSV export caused by draft
posts.
---
account.go | 2 +-
export.go | 5 +++--
posts.go | 6 +++---
read.go | 2 +-
4 files changed, 8 insertions(+), 7 deletions(-)
diff --git a/account.go b/account.go
index 920fc9d..180e9b0 100644
--- a/account.go
+++ b/account.go
@@ -625,7 +625,7 @@ func viewExportPosts(app *App, w http.ResponseWriter, r *http.Request) ([]byte,
// Export as CSV
if strings.HasSuffix(r.URL.Path, ".csv") {
- data = exportPostsCSV(u, posts)
+ data = exportPostsCSV(app.cfg.App.Host, u, posts)
return data, filename, err
}
if strings.HasSuffix(r.URL.Path, ".zip") {
diff --git a/export.go b/export.go
index 3b5ac49..592bc0c 100644
--- a/export.go
+++ b/export.go
@@ -20,7 +20,7 @@ import (
"github.com/writeas/web-core/log"
)
-func exportPostsCSV(u *User, posts *[]PublicPost) []byte {
+func exportPostsCSV(hostName string, u *User, posts *[]PublicPost) []byte {
var b bytes.Buffer
r := [][]string{
@@ -30,8 +30,9 @@ func exportPostsCSV(u *User, posts *[]PublicPost) []byte {
var blog string
if p.Collection != nil {
blog = p.Collection.Alias
+ p.Collection.hostName = hostName
}
- f := []string{p.ID, p.Slug.String, blog, p.CanonicalURL(), p.Created8601(), p.Title.String, strings.Replace(p.Content, "\n", "\\n", -1)}
+ f := []string{p.ID, p.Slug.String, blog, p.CanonicalURL(hostName), p.Created8601(), p.Title.String, strings.Replace(p.Content, "\n", "\\n", -1)}
r = append(r, f)
}
diff --git a/posts.go b/posts.go
index 1f35eda..d004296 100644
--- a/posts.go
+++ b/posts.go
@@ -1061,9 +1061,9 @@ func (p *Post) processPost() PublicPost {
return *res
}
-func (p *PublicPost) CanonicalURL() string {
+func (p *PublicPost) CanonicalURL(hostName string) string {
if p.Collection == nil || p.Collection.Alias == "" {
- return p.Collection.hostName + "/" + p.ID
+ return hostName + "/" + p.ID
}
return p.Collection.CanonicalURL() + p.Slug.String
}
@@ -1072,7 +1072,7 @@ func (p *PublicPost) ActivityObject(cfg *config.Config) *activitystreams.Object
o := activitystreams.NewArticleObject()
o.ID = p.Collection.FederatedAPIBase() + "api/posts/" + p.ID
o.Published = p.Created
- o.URL = p.CanonicalURL()
+ o.URL = p.CanonicalURL(cfg.App.Host)
o.AttributedTo = p.Collection.FederatedAccount()
o.CC = []string{
p.Collection.FederatedAccount() + "/followers",
diff --git a/read.go b/read.go
index ec0305a..df24621 100644
--- a/read.go
+++ b/read.go
@@ -293,7 +293,7 @@ func viewLocalTimelineFeed(app *App, w http.ResponseWriter, req *http.Request) e
}
title = p.PlainDisplayTitle()
- permalink = p.CanonicalURL()
+ permalink = p.CanonicalURL(app.cfg.App.Host)
if p.Collection != nil {
author = p.Collection.Title
} else {
From c0b75f6b65e375b04a100ca6b9963e579d4282d5 Mon Sep 17 00:00:00 2001
From: Rob Loranger
Date: Fri, 8 Nov 2019 08:47:03 -0800
Subject: [PATCH 07/17] pass hostname to canonical url in post templates
the change to take a hostname in Post.CanonicalURL broke a few template
using that function. This adds a Hostname string to the Post being
passed to templates and passes it to calls to Post.CanonicalURL
---
posts.go | 2 ++
templates/chorus-collection-post.tmpl | 6 +++---
templates/chorus-collection.tmpl | 2 +-
templates/collection-post.tmpl | 6 +++---
templates/collection-tags.tmpl | 2 +-
templates/collection.tmpl | 2 +-
templates/read.tmpl | 8 ++++----
7 files changed, 15 insertions(+), 13 deletions(-)
diff --git a/posts.go b/posts.go
index d004296..6cb76a2 100644
--- a/posts.go
+++ b/posts.go
@@ -1380,12 +1380,14 @@ Are you sure it was ever here?`,
IsFound bool
IsAdmin bool
CanInvite bool
+ Hostname string
}{
PublicPost: p,
StaticPage: pageForReq(app, r),
IsOwner: cr.isCollOwner,
IsCustomDomain: cr.isCustomDomain,
IsFound: postFound,
+ Hostname: app.cfg.App.Host,
}
tp.IsAdmin = u != nil && u.IsAdmin()
tp.CanInvite = canUserInvite(app.cfg, tp.IsAdmin)
diff --git a/templates/chorus-collection-post.tmpl b/templates/chorus-collection-post.tmpl
index bab2e31..d229c62 100644
--- a/templates/chorus-collection-post.tmpl
+++ b/templates/chorus-collection-post.tmpl
@@ -8,7 +8,7 @@
-
+
@@ -25,7 +25,7 @@
-
+
{{range .Images}}{{else}}{{end}}
@@ -77,7 +77,7 @@ article time.dt-published {