-
疑问描述据文档,
在遵循最佳实践中,我使用 polo 管理并编辑位于 /home/polo/.halo2/themes/theme-apex/templates 主题目录修改 page.html 文件 <div class="mx-auto mt-5 max-w-7xl px-4">
<article
class="prose-content mt-2 !max-w-full"
th:utext="${singlePage.content.content}"
></article>
<b>test word</b>
</div>初步学习开发者文档后,浅尝修改代码,后在 Halo 后台-内容-页面 新增一个 <游戏后小记> 页面后设置自定义模板为默认模板后保存 遇到问题
并没有发现在 Halo - 后台 - 外观 - 主题 - 主题管理 - 重载主题配置 可供选择,红字仅有卸载和重置,只能通过重启 halo 重启后是成功修改 进一步尝试在 /home/polo/.halo2/themes/theme-apex/public/assets/images 放置一张本地图片,通过 引用静态资源图片,无法调用 再次尝试在 首页配置 - 编辑条目 - 编辑首页图片 - 输入图片链接 /themes/theme-apex/assets/images/h_bg_02.svg 依旧失败 后直接访问发现,直接IP访问依然 curl -I https://abc.cn/themes/theme-apex/assets/images/h_bg_02.svg
HTTP/1.1 404 Not Found
Server: nginx
Date: Tue, 19 May 2026 02:31:34 GMT
Content-Type: application/problem+json
Content-Length: 247
Connection: keep-alive
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Content-Type-Options: nosniff
Strict-Transport-Security: max-age=31536000
X-Frame-Options: SAMEORIGIN
X-XSS-Protection: 0
Referrer-Policy: strict-origin-when-cross-origin同目录已经存在的文件正常,新上传均无法访问,故核查权限 -rw-r--r-- 1 polo polo 165298 May 18 14:46 bg.svg
-rw-r--r-- 1 polo polo 601777 May 18 14:46 Copyright.gif
-rw-r--r-- 1 polo polo 13141 May 18 14:46 gongan.svg
-rw-r--r-- 1 polo polo 443353 May 18 16:02 h_bg_02.svg均一致,重启 halo 重启后是无法成功修改的 因此提出问题,希望可以在 1.无法唤出重载主题按钮(是否可以通过命令行重载主题) 得到释疑,不胜感激 :-) 期望行为综上所述,是否可以定义新 page2.html 页面,并在自定义模板可以选择默认模板2,进一步是否可以通过了两步验证 或 经微信登录 或 绑定了手机号码的用户 才可以访问这个页面。 环境信息
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
|
直接在服务端修改模板需要清理模板缓存。
所有资源文件是放置在 templates/assets 中,而不是 public 目录,这个主题的 public 目录仅在开发环境使用。 |
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.

直接在服务端修改模板需要清理模板缓存。
所有资源文件是放置在 templates/assets 中,而不是 public 目录,这个主题的 public 目录仅在开发环境使用。