Add feed generating capabilities #1

Merged
vilmibm merged 3 commits from acdw/tilde.town:trunk into trunk 2022-09-10 00:27:19 +00:00
Contributor

feed.tmpl.xml should be RSS2.0-conforming. Ideally each news item
would have a date of publication, but RSS doesn't require it.

I found it easier to copy genblog.go to genfeed.go than to shoehorn
in feed logic to the blog generator. As such, genfeed.go might have
some 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.

`feed.tmpl.xml` should be RSS2.0-conforming. Ideally each news item would have a date of publication, but RSS doesn't require it. I found it easier to copy `genblog.go` to `genfeed.go` than to shoehorn in feed logic to the blog generator. As such, `genfeed.go` might have some 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.
acdw added 1 commit 2022-09-09 04:01:01 +00:00
`feed.tmpl.xml` should be RSS2.0-conforming.  Ideally each news item
would have a date of publication, but RSS doesn't require it.

I found it easier to copy `genblog.go` to `genfeed.go` than to shoehorn
in feed logic to the blog generator.  As such, `genfeed.go` might have
some 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.
vilmibm requested changes 2022-09-09 20:21:55 +00:00
vilmibm left a comment
Owner

Highlighted the stuff that can be deleted

Highlighted the stuff that can be deleted
@ -0,0 +22,4 @@
Content string // HTML of entry
}
type User struct {
Owner

this struct can be deleted

this struct can be deleted
acdw marked this conversation as resolved
@ -0,0 +29,4 @@
type tildeData struct {
News []newsEntry
Users []User
Owner

can delete

can delete
acdw marked this conversation as resolved
@ -0,0 +30,4 @@
type tildeData struct {
News []newsEntry
Users []User
ActiveUsers []string `json:"active_users"`
Owner

can delete

can delete
acdw marked this conversation as resolved
@ -0,0 +33,4 @@
ActiveUsers []string `json:"active_users"`
}
type ByName []User
Owner

can delete

can delete
acdw marked this conversation as resolved
@ -0,0 +35,4 @@
type ByName []User
func (n ByName) Len() int { return len(n) }
Owner

can delete these three functions

can delete these three functions
acdw marked this conversation as resolved
@ -0,0 +47,4 @@
type tmplData struct {
News []newsEntry
Lights string
Owner

can delete

can delete
acdw marked this conversation as resolved
@ -0,0 +52,4 @@
td := &tmplData{
News: data.News,
Lights: "",
Owner

can delete

can delete
acdw marked this conversation as resolved
@ -0,0 +55,4 @@
Lights: "",
}
sort.Sort(ByName(data.Users))
Owner

can delete

can delete
acdw marked this conversation as resolved
@ -0,0 +57,4 @@
sort.Sort(ByName(data.Users))
isActive := func(username string) bool {
Owner

can delete this func

can delete this func
acdw marked this conversation as resolved
@ -0,0 +67,4 @@
return false
}
for _, u := range data.Users {
Owner

can delete this for loop

can delete this for loop
acdw marked this conversation as resolved
acdw added 1 commit 2022-09-10 00:09:08 +00:00
acdw requested review from vilmibm 2022-09-10 00:09:49 +00:00
vilmibm approved these changes 2022-09-10 00:11:39 +00:00
vilmibm left a comment
Owner

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

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
acdw added 1 commit 2022-09-10 00:15:20 +00:00
vilmibm merged commit ccdae9cf84 into trunk 2022-09-10 00:27:19 +00:00
Sign in to join this conversation.
No Reviewers
No Label
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: tildetown/tilde.town#1
No description provided.