Add feed generating capabilities #1

已合併
vilmibm 將 3 次提交從 acdw/tilde.town:trunk 合併至 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 加入了 1 個提交 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 請求了變更 2022-09-09 20:21:55 +00:00
vilmibm 留下了回應
擁有者

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 標記了此對話為已解決
@ -0,0 +29,4 @@
type tildeData struct {
News []newsEntry
Users []User
擁有者

can delete

can delete
acdw 標記了此對話為已解決
@ -0,0 +30,4 @@
type tildeData struct {
News []newsEntry
Users []User
ActiveUsers []string `json:"active_users"`
擁有者

can delete

can delete
acdw 標記了此對話為已解決
@ -0,0 +33,4 @@
ActiveUsers []string `json:"active_users"`
}
type ByName []User
擁有者

can delete

can delete
acdw 標記了此對話為已解決
@ -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 標記了此對話為已解決
@ -0,0 +47,4 @@
type tmplData struct {
News []newsEntry
Lights string
擁有者

can delete

can delete
acdw 標記了此對話為已解決
@ -0,0 +52,4 @@
td := &tmplData{
News: data.News,
Lights: "",
擁有者

can delete

can delete
acdw 標記了此對話為已解決
@ -0,0 +55,4 @@
Lights: "",
}
sort.Sort(ByName(data.Users))
擁有者

can delete

can delete
acdw 標記了此對話為已解決
@ -0,0 +57,4 @@
sort.Sort(ByName(data.Users))
isActive := func(username string) bool {
擁有者

can delete this func

can delete this func
acdw 標記了此對話為已解決
@ -0,0 +67,4 @@
return false
}
for _, u := range data.Users {
擁有者

can delete this for loop

can delete this for loop
acdw 標記了此對話為已解決
acdw 加入了 1 個提交 2022-09-10 00:09:08 +00:00
acdw 請求了 vilmibm 來審核 2022-09-10 00:09:49 +00:00
vilmibm 核可了這些變更 2022-09-10 00:11:39 +00:00
vilmibm 留下了回應
擁有者

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 加入了 1 個提交 2022-09-10 00:15:20 +00:00
vilmibm merged commit ccdae9cf84 into trunk 2022-09-10 00:27:19 +00:00
登入 才能加入這對話。
No Reviewers
未選擇標籤
2 參與者
通知
截止日期
未設定截止日期。
先決條件

未設定先決條件。

參考: tildetown/tilde.town#1
No description provided.