Skip to content

[PR] feat: panel-embedded blog & articles — render bundled markdown in the panel's own style - #4588

Closed
ranxianglei wants to merge 1 commit into
masterfrom
2026-10-24_panel-ship-site
Closed

ranxianglei wants to merge 1 commit into
masterfrom
2026-10-24_panel-ship-site

Conversation

@ranxianglei

@ranxianglei ranxianglei commented Oct 24, 2026 •

Copy link
Copy Markdown
Owner

这是什么(按 owner 反馈重做)

上一版「把整个官网挂到 /__bili/site/」的思路不对——面板不是官网的镜像。现在:面板自己的「博客 Blog」页,用面板自己的视觉渲染几篇内置的博客与长文(和更新日志区一个套路:markdown 服务端转义优先渲染 → 面板组件),点卡片展开正文,双语跟随面板语言切换,离线可读。

改动

  • src/web/blogfeed.ts(新):GET /__bili/blog JSON feed——收录 ① website/blog/posts/*.md(+.zh.md 双语对)② website/articles.json 清单里列出的仓库长文(paper 中英文)。服务端用 web/markdown.ts(XSS-safe)渲染;图片走独立路由 GET /__bili/blog-assets/<rel>——穿越/坏编码/扩展名白名单三重门;目录缺失→空 feed,绝不抛。内存缓存每进程一次(内容只随包更新变)。
  • web/markdown.ts 两个增量能力(纯增量,kernel handoff 输出不受影响):图片引用(http(s)/面板资产路由之外的源一律丢弃)+ GFM 管道表格(复用面板 .data 表格样式)
  • 面板:博客/Blog 页(PAGES+nav+页壳+i18n zh/en+CSS)、卡片列表点击展开、懒填充正文
  • package.json files 只收需要的:paper/*.md、paper/figures/*.png(已有)、website/blog/posts、website/articles.json——包体增量 ~100KB,不再整站 1.5MB
  • 文档同步:CHANGELOG / README zh+en / 官网 docs 页 WebUI 列表 / architecture.md

配置面(§3)

零新键/env/磁盘缓存。内容随自更新前进,GitHub Pages(#4561)仍是永远最新的完整文库;面板这份是离线兜底快照。owner 签核记录在 #4587(含本轮改向说明)。

验证

  • tests/web-blogfeed.test.ts 7 例全绿(排序/双语配对/XSS 逃逸/图片改写与穿越丢弃/表格/资产路由正负双向/坏清单降级/空根空 feed/真树探测);web-i18n 键对齐 10/10
  • web-sessions(web/changelog/admin-origin/admin-probe 定向套件绿;typecheck 干净
  • 真机冒烟(npm run build 后跑 dist):#__blog 导航就位、feed 返回 meet-bili(中英)、图片路由 200 image/png、%2e%2e 穿越 404
  • 依赖提示:文章库条目要等 [PR] feat: website article library — sync repository long-form markdown into the site #4564 合入(manifest 在那边);合后 paper 自动进 feed,本 PR 无需再动

…/docs/articles offline (#4587)

- package.json files gains website (~1.5MB; paper figures already shipped)
- src/web/site.ts: read-only static serving under /__bili/site/* with
  traversal/encoding/extension gates and a panel breadcrumb on every HTML page;
  fail-soft JSON payload when the folder is absent (changelog.ts precedent)
- panel topbar gains a 官网/Site entry; docs site WebUI list + README zh/en document it
- zero new config keys/env vars/cache files — static bytes out of the install itself
@ranxianglei ranxianglei changed the title feat: ship the website inside the install — /__bili/site/ serves blog/docs/articles offline [PR] feat: ship the website inside the install — /__bili/site/ serves blog/docs/articles offline Oct 24, 2026
@ranxianglei ranxianglei changed the title [PR] feat: ship the website inside the install — /__bili/site/ serves blog/docs/articles offline feat: panel-embedded blog & articles — render bundled markdown in the panel's own style Oct 24, 2026
@ranxianglei
ranxianglei deleted the 2026-10-24_panel-ship-site branch October 24, 2026 16:33
@ranxianglei ranxianglei changed the title feat: panel-embedded blog & articles — render bundled markdown in the panel's own style [PR] feat: panel-embedded blog & articles — render bundled markdown in the panel's own style Oct 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant