Repository navigation
[PR] feat: panel-embedded blog & articles — render bundled markdown in the panel's own style - #4588
Closed
ranxianglei wants to merge 1 commit into
Closed
ranxianglei wants to merge 1 commit into
ranxianglei wants to merge 1 commit into
Conversation
…/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
This was referenced Oct 24, 2026
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
这是什么(按 owner 反馈重做)
上一版「把整个官网挂到 /__bili/site/」的思路不对——面板不是官网的镜像。现在:面板自己的「博客 Blog」页,用面板自己的视觉渲染几篇内置的博客与长文(和更新日志区一个套路:markdown 服务端转义优先渲染 → 面板组件),点卡片展开正文,双语跟随面板语言切换,离线可读。
改动
src/web/blogfeed.ts(新):GET /__bili/blogJSON 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.jsonfiles 只收需要的:paper/*.md、paper/figures/*.png(已有)、website/blog/posts、website/articles.json——包体增量 ~100KB,不再整站 1.5MB配置面(§3)
零新键/env/磁盘缓存。内容随自更新前进,GitHub Pages(#4561)仍是永远最新的完整文库;面板这份是离线兜底快照。owner 签核记录在 #4587(含本轮改向说明)。
验证
tests/web-blogfeed.test.ts7 例全绿(排序/双语配对/XSS 逃逸/图片改写与穿越丢弃/表格/资产路由正负双向/坏清单降级/空根空 feed/真树探测);web-i18n 键对齐 10/10#__blog导航就位、feed 返回 meet-bili(中英)、图片路由 200 image/png、%2e%2e 穿越 404