diff --git a/posts.go b/posts.go index f58707f..a28dcd9 100644 --- a/posts.go +++ b/posts.go @@ -229,6 +229,10 @@ func (p Post) Summary() string { return shortPostDescription(p.Content) } +func (p Post) SummaryHTML() template.HTML { + return template.HTML(p.Summary()) +} + // Excerpt shows any text that comes before a (more) tag. // TODO: use HTMLExcerpt in templates instead of this method func (p *Post) Excerpt() template.HTML { diff --git a/templates/user/articles.tmpl b/templates/user/articles.tmpl index 3edb89c..16fb4e3 100644 --- a/templates/user/articles.tmpl +++ b/templates/user/articles.tmpl @@ -12,7 +12,10 @@

drafts

-{{ if .AnonymousPosts }}
+{{ if .AnonymousPosts }} +

These are your draft posts. You can share them individually (without a blog) or move them to your blog when you're ready.

+ +
{{ range $el := .AnonymousPosts }}

@@ -34,10 +37,11 @@ {{end}} {{ end }}

- {{if .Summary}}

{{.Summary}}

{{end}} + {{if .Summary}}

{{.SummaryHTML}}

{{end}}
{{end}} -
{{ else }}

You haven't saved any drafts yet.

-

They'll show up here once you do. {{if not .SingleUser}}Find your blog posts from the Blogs page.{{end}}

+
{{ else }}
+

Your anonymous and draft posts will show up here once you've published some. You'll be able to share them individually (without a blog) or move them to a blog when you're ready.

+ {{if not .SingleUser}}

Alternatively, see your blogs and their posts on your Blogs page.

{{end}}

Start writing

{{ end }}