feat: 书库导入导出/图片变体/书籍搜索/小组件运行时等
新增: - 书库导入导出(library_import/library_export)及测试 - 图片变体生成(image_variants)与响应式图片(responsiveImage) - 书籍搜索(bookSearch)+ BookSearch/LibrarySearchGrid 组件 - 小组件运行时(widgetRuntime)与静态检查(widgetLint) - 上传缓存中间件(upload_cache)与字体 CSS 提取脚本 其它: - 后端 handlers/services 全量调整 - 前端页面、组件、库函数与配置更新
This commit is contained in:
@@ -76,6 +76,16 @@ export function postPath(style: UrlStyle, id: number): string {
|
||||
return style === "default" ? STANDARD_TEMPLATES.post(n) : PRETTY_TEMPLATES[style].post(n);
|
||||
}
|
||||
|
||||
/**
|
||||
* 评论锚点:使用评论在所属帖内的相对楼层号,而非全站评论 ID。
|
||||
* 主楼 → #comment-{floor};楼中楼 → #comment-{floor}-r{commentId}(楼层负责定位/分页/展开,
|
||||
* r 段精确定位具体回复)。楼层号无效时返回空串,调用方应回退为不带锚点的帖子路径。
|
||||
*/
|
||||
export function commentAnchor(floor: number, isRoot: boolean, commentId?: number): string {
|
||||
if (!(Number.isFinite(floor) && floor > 0)) return "";
|
||||
return isRoot || !commentId ? `#comment-${floor}` : `#comment-${floor}-r${commentId}`;
|
||||
}
|
||||
|
||||
/** 用户主页路径;?tab= 等查询参数由调用方拼接 */
|
||||
export function userPath(style: UrlStyle, id: number): string {
|
||||
const n = guardId(id);
|
||||
|
||||
Reference in New Issue
Block a user