Add feed generating capabilities #1
Loading…
x
Reference in New Issue
Block a user
No description provided.
Delete Branch "acdw/tilde.town:trunk"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
feed.tmpl.xmlshould 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.gotogenfeed.gothan to shoehornin feed logic to the blog generator. As such,
genfeed.gomight 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 []newsEntryUsers []Usercan delete
@ -0,0 +30,4 @@type tildeData struct {News []newsEntryUsers []UserActiveUsers []string `json:"active_users"`can delete
@ -0,0 +33,4 @@ActiveUsers []string `json:"active_users"`}type ByName []Usercan delete
@ -0,0 +35,4 @@type ByName []Userfunc (n ByName) Len() int { return len(n) }can delete these three functions
@ -0,0 +47,4 @@type tmplData struct {News []newsEntryLights stringcan 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
townproject but this is great for now <3