# 使用新的自定义主页功能

**URL:** <https://meta.discourse.org/t/using-the-new-custom-homepage-feature/302496>\
**Category:** Development\
**Created:** [2024年四月4日 21:43 UTC](https://meta.discourse.org/t/using-the-new-custom-homepage-feature/302496 "2024-04-04T21:43:02Z")\
**Posts on this page:** 1\
**Showing post:** 48

<div class="post-metadata">

**Author:** ![OsaIsacson](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/osaisacson/32/263464_2.png) [@OsaIsacson](https://meta.discourse.org/u/OsaIsacson)\
**Post date:** [2025年九月3日 15:36 UTC](https://meta.discourse.org/t/using-the-new-custom-homepage-feature/302496/48 "2025-09-03T15:36:21Z")

</div>

我以前使用管理员界面修改我的主题，但现在我收到了一个弃用警告，所以我正在查看 custom-homepage 选项。

我已按照 [此示例](https://github.com/pmusaraj/discourse-sample-custom-homepage) 迁移了我的 `<head>` 和 css。我的尝试 [在此](https://github.com/osaisacson/discourse-custom-bob-theme)。到目前为止一切顺利。

现在的问题是如何插入搜索栏和“谁在线”组件。  
在我以前的 `<head>` 中，我只是在代码中想要的位置添加了 {{whos-online}} 和 {{search-menu}}，但这在这里不起作用——我找不到正确注入它们的方法。

有人能在这里指点我一下方向，或者知道正确的语法吗？

最终结果应该看起来像 [这样](https://bygg.boihop.co/)（目前已恢复到我以前的、即将被弃用的代码）。

---

_[View the full topic](https://meta.discourse.org/t/using-the-new-custom-homepage-feature/302496)._
