JongChoiYip109 downloadsScan local note images, upload to S3-compatible storage (R2/AWS S3/MinIO), and replace links safely.
S3 Image Sync is a polished, modern, and mobile-friendly Obsidian plugin that scans local note images, uploads them to your S3-compatible cloud storage (Cloudflare R2, AWS S3, MinIO, etc.), and replaces local Markdown links with remote public URLs safely.
📢 Fork & Redesign Note
This repository is a highly refined and redesigned fork of the original perinchiang/obsidian-plugins-attachment-imagebed-manager.
All codebase refactoring, UI redesigns, and documentation rewrites in this fork were proudly assisted and generated by Gemini (the current AI model).
Key Improvements in this Fork:
- Image-First Focus: Stripped away bloated non-image category logic (PDFs, docs, heavy media) to build a specialized, lightweight, and extremely reliable image uploader and sync engine.
- PC & Mobile Responsive UI: Completely overhauled the upload modal's CSS grid to be fully fluid. Cards size adaptively (
130pxgrid with4:3preview on desktop vs100pxsquare grid on mobile viewports) for a beautiful native look.- Premium Visual Enhancements:
- Cards feature modern hover float transformations (
translateY(-2px)) and elegant focus glow shadows.- Replaced the browser's default checkbox with a custom, overlay SVG checkmark (
✓) displaying fluid scale/fade animations on select.- Replaced raw browser progress elements with a sleek, rounded HTML/CSS progress bar.
- Redesigned the Delete Confirmation view into scrollable nested file-path cards.
- Frictionless UX & Selection Performance: Rewrote the modal's state engine. Selection toggles are now handled directly through targeted DOM/CSS state adjustments (using cached Map lookups) instead of triggering a full page re-render. This completely preserves your scroll position and enables instantaneous (sub-1ms) selections!
main.js, manifest.json, and styles.css from the latest release.<vault>/.obsidian/plugins/s3-image-sync/Choose your storage provider and fill in the credentials:
| Field | Description |
|---|---|
| Storage provider | Cloudflare R2 (recommended), AWS S3, MinIO, or Custom S3 |
| Endpoint URL | Your storage endpoint, e.g. https://abc123.r2.cloudflarestorage.com |
| Bucket name | The bucket you created |
| Access Key ID | From your storage provider's API settings |
| Secret Access Key | From your storage provider's API settings |
| Public access URL | URL prefix for accessing files, e.g. https://pub-xxx.r2.dev |
| Upload path template | Default: attachments/{ext}/{hash2}/{hash}.{ext} (supports various path variables, see details below) |
Click Test connection to verify your settings.
The Upload path template allows you to dynamically customize the S3 object key (path) for uploaded files. The following variables are supported:
{ext}: File extension (e.g. png, jpg).{hash}: 64-character full SHA-256 hash of the file.{hash-short}: 32-character short SHA-256 hash of the file.{hash2}: First 2 characters of the file hash (useful for folder partition/sharding).{filename}: Original file name (excluding extension).{yyyy}: Current year (4 digits, e.g. 2026).{MM}: Current month (2 digits, e.g. 06).{dd}: Current day (2 digits, e.g. 17).Example: images/{yyyy}/{MM}/{dd}/{hash-short}.{ext} will upload a file to images/2026/06/17/a1b2c3d4e5f67890a1b2c3d4e5f67890.png.
Recommended Templates:
images/{yyyy}/{MM}/{dd}/{hash-short}.{ext}attachments/{yyyy}/{MM}/{filename}-{hash-short}.{ext}90-笔记系统/92-附件).MIT
S3 Image Sync 是一款优雅、轻量且对移动端深度优化的 Obsidian 插件。它能自动扫描当前笔记中的本地图片,安全上传至 S3 兼容的云存储(如 Cloudflare R2、AWS S3、MinIO 等),并自动将笔记中的本地链接无缝替换为公共云端 URL。
📢 Fork 与全新重构声明
本项目是基于原版 perinchiang/obsidian-plugins-attachment-imagebed-manager 的重构与深度美化版本。
本项目分支中的所有代码重构、UI界面重新设计、交互逻辑改进及文档编写,均由 Gemini 提供协助并自主生成。
我们在原版基础上做出了如下核心改进:
- 专注图片同步:砍掉了复杂沉重的通用附件分类(PDF、文档、大媒体)逻辑,代码体量大幅缩减,打造专门针对 Markdown 图片的轻量极致同步引擎。
- PC & 移动端全兼容响应式 UI:全新重构了上传弹窗。卡片采用弹性网格适配(PC端
4:3比例130px宽度网格,移动端自适应为1:1正方形100px网格),在手机等窄屏设备上视觉极为精致,告别局促。- 豪华视觉效果与交互微动效:
- 卡片增加了现代化的物理悬浮动效(
translateY(-2px))和外发光精致投影。- 彻底移除了原生的浏览器复选框,改用高颜值的绝对定位 SVG 勾选框(
✓),伴随平滑缩放与淡入淡出动画。- 进度条改用极简、圆润的 CSS 动效进度条,告别老旧的原生外观。
- 优化了删除确认页,将要处理的路径包裹入独立滚动的精致子卡片容器中。
- 零延迟状态机 & 保留滚动位置:重构了弹窗内的状态管理。现在勾选图片仅会通过缓存 Map 精准改变对应 DOM 的 CSS 样式类,完全不会触发全量重渲染,完美保留您的滚动条位置。即便有数百张图也支持瞬时(1毫秒内)无感响应。
main.js、manifest.json 和 styles.css。<vault>/.obsidian/plugins/s3-image-sync/ 目录下。选择您的存储服务商并填写凭据:
| 配置项 | 描述 |
|---|---|
| 存储服务商 | Cloudflare R2(推荐)、AWS S3、MinIO 或自定义 S3 |
| 端点 URL | 您的存储终结点,例如 https://abc123.r2.cloudflarestorage.com |
| 存储桶名称 | 您创建的存储桶名称 |
| Access Key ID | 来自您的存储服务商 API 设置中的 Access Key ID |
| Secret Access Key | 来自您的存储服务商 API 设置中的 Secret Access Key |
| 公开访问 URL | 访问已上传文件的 URL 前缀,例如 https://pub-xxx.r2.dev |
| 上传路径模板 | 默认值:attachments/{ext}/{hash2}/{hash}.{ext}(支持各种路径变量,详见下方说明) |
点击 测试连接 按钮以验证您的设置是否正确。
通过上传路径模板来自定义图片在云存储中的保存路径(S3 Object Key)。支持以下动态变量:
{ext}:文件扩展名/后缀 (如 png、jpg 等)。{hash}:64位完整 SHA-256 文件哈希值。{hash-short}:32位短 SHA-256 文件哈希值。{hash2}:SHA-256 文件哈希值的前2位字符(非常适合用于云存储的海量文件二级分流,避免单个文件夹下文件过多)。{filename}:原始文件名 (不含扩展名)。{yyyy}:4位当前年份 (如 2026)。{MM}:2位当前月份 (如 06)。{dd}:2位当前日期 (如 17)。示例: images/{yyyy}/{MM}/{dd}/{hash-short}.{ext} 将保存为 images/2026/06/17/a1b2c3d4e5f67890a1b2c3d4e5f67890.png。
常用推荐模板:
images/{yyyy}/{MM}/{dd}/{hash-short}.{ext}attachments/{yyyy}/{MM}/{filename}-{hash-short}.{ext}90-笔记系统/92-附件)。MIT