Page Publishing

索引已发布页面

在我们等待 Index or search published pages 功能的同时,这里有一个手动实现的方法。

查找已发布页面

使用 https://meta.discourse.org/t/discourse-data-explorer/32566/1,您可以创建一个新的 已发布页面 查询:

SELECT CONCAT('/pub/', pp.slug) AS URL, pp.topic_id
FROM published_pages pp
ORDER BY pp.id

提供索引

当然,您可以 Run Data Explorer queries with the Discourse API 来创建和维护已发布页面的索引。这甚至可能通过 Custom Wizard Plugin 🧙 来实现。

我手动创建了一个新主题,使用了上面“已发布页面”查询的数据,然后在 /pub/index 处发布了它。

由于我 https://meta.discourse.org/t/run-other-websites-on-the-same-machine-as-discourse/17247,我可以使用此代码段轻松地在 https://discourse.example/pub 处提供已发布页面索引:

    # 提供已发布页面的索引
    location ~* ^/pub/?$ {
        return 307 https://discourse.example/pub/index;
    }
7 个赞