From cd27a370275aaae63e98a2fa46e7c133091dba6e Mon Sep 17 00:00:00 2001 From: Matt Baer Date: Tue, 6 Aug 2019 10:42:43 -0400 Subject: [PATCH] Display current tag on Reader i.e. current tag a user is browsing, when they are. --- read.go | 2 ++ templates/read.tmpl | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/read.go b/read.go index 3bc91c7..683f124 100644 --- a/read.go +++ b/read.go @@ -47,6 +47,7 @@ type readPublication struct { Posts *[]PublicPost CurrentPage int TotalPages int + SelTopic string } func initLocalTimeline(app *App) { @@ -201,6 +202,7 @@ func showLocalTimeline(app *App, w http.ResponseWriter, r *http.Request, page in &posts, page, ttlPages, + tag, } err := templates["read"].ExecuteTemplate(w, "base", d) diff --git a/templates/read.tmpl b/templates/read.tmpl index cd03b9d..e7527bc 100644 --- a/templates/read.tmpl +++ b/templates/read.tmpl @@ -76,7 +76,7 @@ {{define "content"}}

Reader

-

Read the latest posts from {{.SiteName}}. {{if .Username}}To showcase your writing here, go to your blog settings and select the Public option.{{end}}

+ {{if .SelTopic}}#{{.SelTopic}} posts{{else}}Read the latest posts from {{.SiteName}}. {{if .Username}}To showcase your writing here, go to your blog settings and select the Public option.{{end}}{{end}}

{{ if gt (len .Posts) 0 }}