# 页面发布

**URL:** https://meta.discourse.org/t/page-publishing/151971
**Category:** Site Management
**Tags:** how-to, page-publishing, content
**Created:** [2020年五月19日 18:56 UTC](https://meta.discourse.org/t/page-publishing/151971 "2020-05-19T18:56:39Z")
**Posts on this page:** 1
**Showing post:** 164

<div class="post-metadata">

### Author: ![hellekin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/hellekin/32/51636_2.png) [@hellekin](https://meta.discourse.org/u/hellekin)
#### Post date: [2023年七月20日 10:44 UTC](https://meta.discourse.org/t/page-publishing/151971/164 "2023-07-20T10:44:42Z")

</div>

# 索引已发布页面

在我们等待 [Index or search published pages](https://meta.discourse.org/t/index-or-search-published-pages/261301) 功能的同时，这里有一个手动实现的方法。

## 查找已发布页面

使用 [https://meta.discourse.org/t/discourse-data-explorer/32566/1，您可以创建一个新的](https://meta.discourse.org/t/discourse-data-explorer/32566/1%EF%BC%8C%E6%82%A8%E5%8F%AF%E4%BB%A5%E5%88%9B%E5%BB%BA%E4%B8%80%E4%B8%AA%E6%96%B0%E7%9A%84) **已发布页面** 查询：

```plaintext
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](https://meta.discourse.org/t/run-data-explorer-queries-with-the-discourse-api/120063) 来创建和维护已发布页面的索引。这甚至可能通过 [Custom Wizard Plugin 🧙](https://meta.discourse.org/t/custom-wizard-plugin/73345) 来实现。

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

由于我 [https://meta.discourse.org/t/run-other-websites-on-the-same-machine-as-discourse/17247，我可以使用此代码段轻松地在](https://meta.discourse.org/t/run-other-websites-on-the-same-machine-as-discourse/17247%EF%BC%8C%E6%88%91%E5%8F%AF%E4%BB%A5%E4%BD%BF%E7%94%A8%E6%AD%A4%E4%BB%A3%E7%A0%81%E6%AE%B5%E8%BD%BB%E6%9D%BE%E5%9C%B0%E5%9C%A8) `https://discourse.example/pub` 处提供已发布页面索引：

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

```

---

_[View the full topic](https://meta.discourse.org/t/page-publishing/151971)._
