Add feed generating capabilities #1

已合并
vilmibm 2022-09-10 00:27:19 +00:00 将 3 次代码提交从 acdw/tilde.town:trunk 合并至 trunk
贡献者

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.
acdw2022-09-09 04:01:01 +00:00 推送了 1 个提交
`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 标记问题为已解决
acdw2022-09-10 00:09:08 +00:00 推送了 1 个提交
acdw2022-09-10 00:09:49 +00:00 请求 vilmibm 评审
vilmibm2022-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
acdw2022-09-10 00:15:20 +00:00 推送了 1 个提交
vilmibm 已合并提交 ccdae9cf84trunk 2022-09-10 00:27:19 +00:00
登录 并参与到对话中。
无审核者
未选择标签
2 名参与者
通知
到期时间
未设置到期时间。
依赖工单

没有设置依赖项。

参考:tildetown/tilde.town#1
没有提供说明。