[release-branch.go1.2] blog: Make the atom feed title configurable.
««« CL 16830043 / 963dd9f808db blog: Make the atom feed title configurable. The blog code is quite generic and with the replacement of template and static files, it can be re-used. But the atom feed title is hard-coded into the code. This patch adds a field to set the atom feed title to the Config structure and uses it in the code where the title was previously hard-coded. A CL sent separately will set this Config field in the main package in the go.blog sub-repository. (See CL 16850043 for that other patch). R=golang-dev, adg CC=golang-dev https://golang.org/cl/16830043 »»» R=golang-dev, dsymonds CC=golang-dev https://golang.org/cl/23380044
This commit is contained in:
parent
432822781f
commit
4b93659ce3
|
@ -36,8 +36,9 @@ type Config struct {
|
||||||
GodocURL string // The base URL of godoc (for menu bar; no trailing slash).
|
GodocURL string // The base URL of godoc (for menu bar; no trailing slash).
|
||||||
Hostname string // Server host name, used for rendering ATOM feeds.
|
Hostname string // Server host name, used for rendering ATOM feeds.
|
||||||
|
|
||||||
HomeArticles int // Articles to display on the home page.
|
HomeArticles int // Articles to display on the home page.
|
||||||
FeedArticles int // Articles to include in Atom and JSON feeds.
|
FeedArticles int // Articles to include in Atom and JSON feeds.
|
||||||
|
FeedTitle string // The title of the Atom XML feed
|
||||||
|
|
||||||
PlayEnabled bool
|
PlayEnabled bool
|
||||||
}
|
}
|
||||||
|
@ -262,7 +263,7 @@ func (s *Server) renderAtomFeed() error {
|
||||||
updated = s.docs[0].Time
|
updated = s.docs[0].Time
|
||||||
}
|
}
|
||||||
feed := atom.Feed{
|
feed := atom.Feed{
|
||||||
Title: "The Go Programming Language Blog",
|
Title: s.cfg.FeedTitle,
|
||||||
ID: "tag:" + s.cfg.Hostname + ",2013:" + s.cfg.Hostname,
|
ID: "tag:" + s.cfg.Hostname + ",2013:" + s.cfg.Hostname,
|
||||||
Updated: atom.Time(updated),
|
Updated: atom.Time(updated),
|
||||||
Link: []atom.Link{{
|
Link: []atom.Link{{
|
||||||
|
|
Loading…
Reference in New Issue