我刚刚开始摸索这个(不使用智能代理编码)。
我有一种感觉,把它转换成一个仅控制网站主页的主题组件应该不需要太多工作——例如,一个已经使用 Horizon 主题的网站。这样做会很蠢吗?
此外,我注意到几个问题:
“即将发生的事件”区块未对主题进行排序
它只是按创建日期随意列出事件主题;这非常不实用!!
ask.discourse.com 建议进行此类更改以修复此问题,我可以确认这确实有效(请原谅我缺乏批判性思维):
@bind
async fetchEvents() {
const count = this.args.count || 5;
const results = await ajax("discourse-post-event/events");
if (!results.events?.length) {
return null;
}
const now = new Date();
// Separate past and future events, then sort ascending by start date
const upcoming = results.events
.filter((e) => new Date(e.starts_at) >= now)
.sort((a, b) => new Date(a.starts_at) - new Date(b.starts_at));
return upcoming.slice(0, count);
}
“分类横幅”区块未遵循设置
它在所有分类中显示(而不仅仅是指定的分类),并且在导航时似乎不会刷新(只有在页面刷新时才会刷新)。