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

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
eca0447a35 Add feed generating capabilities
`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 {

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

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"`

can delete

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

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) }

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

can delete

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

can delete

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

can delete

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

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 {

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
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: tildetown/tilde.town#1
There is no content yet.