Mangaga 是一款在浏览器里使用的漫画 / 插图拼版小工具:把多张图片放进可调整的网格,预览与导出使用同一套几何关系,图片按 contain 完整显示、不裁切。支持安装为 PWA,离线也可使用(取决于浏览器与缓存策略)。
需要 Node.js 24+。
npm install
npm run dev
npm run build # 构建到 ./dist
npm run preview # 本地预览构建结果
仓库已内置 /.github/workflows/deploy-pages.yml,推送到 main 后会自动部署到 GitHub Pages。
在 GitHub 仓库 Settings -> Secrets and variables -> Actions -> Variables 中设置:
SITE_URL: 站点完整地址(例如 https://nigh.github.io 或你的自定义域名)BASE_PATH: 站点子路径(根路径用 /;项目页一般是 /mangaga)常见值:
<user>.github.io):BASE_PATH=/<user>/<repo>):BASE_PATH=/<repo>未设置时会使用自动推断;建议显式设置,避免迁移域名或仓库名时路径异常。
npm ci
SITE_URL=https://mangaga.example.com BASE_PATH=/ npm run build
/etc/caddy/Caddyfile):mangaga.example.com {
encode zstd gzip
root * /var/www/mangaga/dist
try_files {path} /index.html
file_server
}
sudo caddy reload --config /etc/caddy/Caddyfile
如果挂在子路径(例如 https://example.com/mangaga/):
BASE_PATH=/mangagahandle_path /mangaga* 指向同一份 dist技术栈:Astro、Svelte、Tailwind、DaisyUI、Vite PWA。
Mangaga is a small in-browser tool for laying out comic or illustration panels: place multiple images on an adjustable grid; preview and export share the same geometry, with images shown in contain mode (full image, no cropping). It can be installed as a PWA.
Repository: github.com/Nigh/mangaga
Requires Node.js 24+.
npm install
npm run dev
npm run build
npm run preview
The repo includes /.github/workflows/deploy-pages.yml to auto-deploy on every push to main.
In Settings -> Secrets and variables -> Actions -> Variables, set:
SITE_URL: full site URL (for example https://nigh.github.io or your custom domain)BASE_PATH: path prefix (/ for root, or /mangaga for project pages)Typical values:
<user>.github.io): BASE_PATH=/<user>/<repo>): BASE_PATH=/<repo>If not set, the build falls back to auto-detection; explicit values are safer when repo/domain changes.
This is a static PWA app, so you do not need a long-running npm run preview process in production.
npm ci
SITE_URL=https://mangaga.example.com BASE_PATH=/ npm run build
/etc/caddy/Caddyfile:
mangaga.example.com {
encode zstd gzip
root * /var/www/mangaga/dist
try_files {path} /index.html
file_server
}
sudo caddy reload --config /etc/caddy/Caddyfile
If serving from a subpath like https://example.com/mangaga/:
BASE_PATH=/mangagahandle_path /mangaga* in Caddy to map requests to the same dist directoryStack: Astro, Svelte, Tailwind, DaisyUI, Vite PWA.