首页审查修复(home/post_card/image_viewer/search/home_skeleton): - PostCard 消除嵌套 <a>:外层 Link 包裹改为绝对定位覆盖层链接, 标题/摘要/封面降级为普通元素,标签用 z-10 叠在覆盖层之上并 stop_propagation,整卡点击跳转文章详情。 - ImageViewer 新增 lightbox prop(默认 true),卡片封面传 false 禁用灯箱以归一为单一跳转交互;文章详情页零改动。 - home.rs 越界页码守卫:分页仅在 total>0 渲染,避免 /page/9999 出现孤立空分页;错误文案脱敏为"加载失败"。 - search.rs 错误文案脱敏为"搜索失败",与首页/标签页一致。 - HomeSkeleton 卡片 5→10,对齐 POSTS_PER_PAGE。 编辑器上传重构(write/tiptap_bridge): - consume_upload_event 改用 upload_errors Vec 自身判重,移除 seen_error_ids 副本状态;Signal 参数加 mut 修复 E0596 编译错误。 - make_upload_closure 构造阶段错误以 rejected Promise 返回而非 panic,单张坏文件不再拖垮整个编辑器。 - write.rs 移除未用的 success signal,编辑保存后统一跳转 Posts, 标签分隔符支持半角/全角逗号与分号,提取 META_*_CLASS 常量去重。 - Makefile dev 目标清理 static/ 目录。
52 lines
1.6 KiB
Makefile
52 lines
1.6 KiB
Makefile
.PHONY: dev build build-linux css css-watch clean build-editor build-editor-incremental highlight-css test
|
||
|
||
build:
|
||
@$(MAKE) build-editor
|
||
@$(MAKE) highlight-css
|
||
@tailwindcss -i input.css -o public/style.css --minify
|
||
@dx build --release --debug-symbols=false
|
||
|
||
build-linux:
|
||
@$(MAKE) build-editor
|
||
@$(MAKE) highlight-css
|
||
@tailwindcss -i input.css -o public/style.css --minify
|
||
@dx build @client --release --debug-symbols=false --wasm-js-cfg false
|
||
@dx build @server --release --debug-symbols=false --target x86_64-unknown-linux-musl --wasm-js-cfg false --features server
|
||
|
||
highlight-css:
|
||
@cargo run --bin generate_highlight_css
|
||
|
||
build-editor:
|
||
@echo "Building Tiptap editor..."
|
||
@cd libs/tiptap-editor && npm ci --include=dev && npm run build
|
||
@echo "Tiptap editor built."
|
||
|
||
# dev 用的增量构建:跳过 npm ci(假设 node_modules 已存在),仅 vite build。
|
||
# 与 build-editor 分开,避免每次 make dev 都重装依赖。
|
||
build-editor-incremental:
|
||
@cd libs/tiptap-editor && npm run build
|
||
|
||
dev: build-editor-incremental
|
||
@echo "Cleaning static/..."
|
||
@rm -rf static/
|
||
@echo "Building Tiptap editor (incremental)..."
|
||
@echo "Starting tailwindcss watch and dx serve..."
|
||
@tailwindcss -i input.css -o public/style.css --watch & \
|
||
TAILWIND_PID=$$!; \
|
||
trap 'kill $$TAILWIND_PID 2>/dev/null; exit' INT TERM EXIT; \
|
||
SSR_CACHE_SECS=0 dx serve --addr 0.0.0.0
|
||
|
||
css:
|
||
@tailwindcss -i input.css -o public/style.css
|
||
|
||
css-watch:
|
||
@tailwindcss -i input.css -o public/style.css --watch
|
||
|
||
test:
|
||
@cargo test
|
||
|
||
clean:
|
||
@cargo clean
|
||
@rm -f public/style.css public/highlight.css
|
||
@rm -rf uploads/.cache
|