Add feed generating capabilities #1
Loading…
Reference in New Issue
There is no content yet.
Delete Branch "acdw/tilde.town:trunk"
Deleting a branch is permanent. Although the deleted branch may exist for a short time before cleaning up, in most cases it CANNOT be undone. Continue?
feed.tmpl.xml
should be RSS2.0-conforming. Ideally each news itemwould have a date of publication, but RSS doesn't require it.
I found it easier to copy
genblog.go
togenfeed.go
than to shoehornin feed logic to the blog generator. As such,
genfeed.go
might havesome unnecessary stuff in it (though the go compiler didn't complain, so
who knows?!). I also added the necessary machinery in
generate_homepage
.Of course, I did very minimal testing.
Highlighted the stuff that can be deleted
@ -0,0 +22,4 @@
Content string // HTML of entry
}
type User struct {
this struct can be deleted
@ -0,0 +29,4 @@
type tildeData struct {
News []newsEntry
Users []User
can delete
@ -0,0 +30,4 @@
type tildeData struct {
News []newsEntry
Users []User
ActiveUsers []string `json:"active_users"`
can delete
@ -0,0 +33,4 @@
ActiveUsers []string `json:"active_users"`
}
type ByName []User
can delete
@ -0,0 +35,4 @@
type ByName []User
func (n ByName) Len() int { return len(n) }
can delete these three functions
@ -0,0 +47,4 @@
type tmplData struct {
News []newsEntry
Lights string
can delete
@ -0,0 +52,4 @@
td := &tmplData{
News: data.News,
Lights: "",
can delete
@ -0,0 +55,4 @@
Lights: "",
}
sort.Sort(ByName(data.Users))
can delete
@ -0,0 +57,4 @@
sort.Sort(ByName(data.Users))
isActive := func(username string) bool {
can delete this func
@ -0,0 +67,4 @@
return false
}
for _, u := range data.Users {
can delete this for loop
hot damn and hell yeah, thank you!
at some point i'll merge this into the
town
project but this is great for now <3