Skip to content

Commit 6e10340

Browse files
committed
feat: update docs
1 parent 6fe4c98 commit 6e10340

5 files changed

Lines changed: 238 additions & 12 deletions

File tree

AGENTS.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# AGENTS.md (PicGo-Doc)
2+
3+
## Documentation Link Convention
4+
5+
- When linking to **PicGo-Core-Doc**:
6+
- In **Chinese** docs (`docs/zh/**`), use the `/zh/` path.
7+
- Example: `https://picgo.github.io/PicGo-Core-Doc/zh/guide/config.html#settings`
8+
- In **English** docs (`docs/guide/**`), **do not** use `/zh/`.
9+
- Example: `https://picgo.github.io/PicGo-Core-Doc/guide/config.html#settings`
10+

docs/guide/config.md

Lines changed: 122 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,99 @@ In Linux and MacOS, you can find the configuration at:
2020

2121
## Upload Area
2222

23-
PicGo's upload area supports drag and drop or open your folder to upload images.
23+
PicGo's upload area supports drag and drop or open your folder to upload images. It also supports uploading clipboard images and uploading by URL.
24+
25+
![](https://pics.molunerfinn.com/doc/picgo-2.0.gif)
26+
27+
### Drag web images to upload <Badge text="2.3.0+" />
28+
29+
Since `2.3.0`, you can drag images from web pages directly into the upload area. Under the hood, it uploads via the **Upload by URL** feature.
30+
31+
### Upload by URL <Badge text="2.3.0+" />
32+
33+
Since `2.3.0`, you can upload images by URL. This is useful when you want to re-host images from other websites into your own image host.
34+
35+
![](https://pics.molunerfinn.com/doc/20260112213512963.png)
36+
37+
#### Batch URL upload <Badge text="2.4.3+" />
38+
39+
Starting from `2.4.3`, URL upload supports uploading multiple URLs in one action (**one URL per line**):
40+
41+
- Empty lines are ignored.
42+
- Duplicate URLs are de-duplicated automatically (the first occurrence order is preserved).
43+
- Invalid lines (non-`http(s)` URLs) are skipped. PicGo will show a warning and write the skipped line contents into `picgo.log` for troubleshooting.
44+
- If you attempt to upload more than 10 URLs at once, PicGo will ask for confirmation. Cancel will return to the input dialog with the original content preserved.
45+
46+
#### Tips <Badge text="2.4.3+" />
47+
48+
- When opening the URL input dialog, PicGo will try to extract `http(s)` URLs from your clipboard text and prefill the dialog (upload still requires explicit confirmation).
49+
- The URL input uses a resizable textarea (max height: 240px).
50+
51+
#### Drag-and-drop URLs <Badge text="2.4.3+" />
52+
53+
You can also drag text that contains URLs (or `text/uri-list`) into the upload area. PicGo will parse newline-delimited URLs and upload the valid ones.
2454

2555
### All-format Upload <Badge text="2.4.0+" />
2656

2757
Since `2.4.0`, PicGo supports the "all-format upload" feature, which means you can drag non-image files into the upload area as well.
2858

59+
## Global URL Rewrite <Badge text="2.4.3+" />
60+
61+
Starting from `2.4.3`, PicGo provides a GUI to manage global URL rewrite rules (`settings.urlRewrite.rules`). These rules can rewrite generated URLs after upload (e.g. change domain, force https, adjust paths, etc.).
62+
63+
How to open:
64+
65+
1. Open PicGo Settings
66+
2. Click **URL rewrite**
67+
68+
![](https://pics.molunerfinn.com/doc/20260112213743681.png)
69+
70+
### Rule basics
71+
72+
Each rule includes:
73+
74+
- **Match (`match`)**: a JavaScript `RegExp` pattern (do not include `/.../`) used to match the URL
75+
- **Replace (`replace`)**: replacement string (supports `$1`, `$2`, ... capture groups)
76+
- **Flags**: `g` (global replace) and `i` (ignore case)
77+
- **Enabled**: disabled rules are skipped
78+
- **Order**: rules are evaluated top-down; **the first enabled match wins**
79+
80+
### Preview
81+
82+
At the bottom of the page, you can input a URL to preview:
83+
84+
- which rule is matched (if any)
85+
- the rewritten output URL
86+
87+
![](https://pics.molunerfinn.com/doc/20260112213811627.png)
88+
89+
### Examples
90+
91+
#### Example 1: Replace domain (keep path)
92+
93+
```text
94+
match: https://old.example.com/
95+
replace: https://new.example.com/
96+
```
97+
98+
#### Example 2: Force https
99+
100+
```text
101+
match: ^http://
102+
replace: https://
103+
```
104+
105+
#### Example 3: Replace GitHub raw URLs with jsDelivr URLs
106+
107+
![](https://pics.molunerfinn.com/doc/20260112214001033.png)
108+
109+
```text
110+
match: ^https://raw.githubusercontent.com/([^/]+)/([^/]+)/([^/]+)/(.*)$
111+
replace: https://cdn.jsdelivr.net/gh/$1/$2/$3/$4
112+
```
113+
114+
For more details, see PicGo-Core's [documentation](https://picgo.github.io/PicGo-Core-Doc/guide/config.html#settings).
115+
29116
## Album Area
30117

31118
PicGo's album area supports to view all images you have uploaded. You can click on the image to preview. You can also click the icon below to copy the image link or delete the image (this will delete the local data to make your images disappear in your album area)
@@ -42,15 +129,45 @@ You can select the image link format in the album area since PicGo 2.0:
42129

43130
![](https://pics.molunerfinn.com/doc/50515502-17d07400-0ae0-11e9-80b9-c38f25b64922.png)
44131

45-
### Bulk Edit Image Domains <Badge text="2.4.0+" />
132+
### Select all and shift multi-select <Badge text="2.3.0+" />
133+
134+
Since `2.3.0`, the album toolbar supports **Select all**:
135+
136+
![](https://pics.molunerfinn.com/doc/202108282136783.png)
137+
138+
It also supports simple multi-select across images with the `Shift` key.
139+
140+
### Bulk Rewrite Image URLs <Badge text="2.4.3+" />
141+
142+
Starting from `2.4.3`, PicGo supports bulk rewriting URLs for selected album items. This is not limited to rewriting the host—you can rewrite the full link using regex rules.
143+
144+
How to use:
145+
146+
1. Select the images you want to rewrite (you can filter by image host to narrow down the list)
147+
2. Click the **More** (``) button in the album toolbar
148+
3. Choose **Rewrite selected image URLs**
149+
150+
Then you can:
151+
152+
- Toggle **Apply global URL rewrite rules** to use the rules you configured in **Global URL Rewrite** (it also shows the global rule count)
153+
- (Optional) Fill a **temporary rule** (match + replace). The temporary rule takes priority over global rules.
154+
- `g`: global replace
155+
- `i`: ignore case
156+
157+
If you filled a temporary rule, PicGo will ask whether you want to save it into the global rule list:
158+
159+
- **Apply and save**: apply to the current selection and append the rule to the global list
160+
- **Apply only**: apply to the current selection only
161+
- **Cancel**: cancel this operation
46162

47-
`2.4.0` adds a bulk edit feature for domains inside the album area. For example, when you have multiple URLs that start with `https://www.a.com/...` and you want to switch them all to `www.b.com`, you can select those images and run this action.
163+
After the operation, PicGo will show the success/failed counts. If no URLs are changed, PicGo will also notify you.
48164

49165
::: warning Note
50-
You have to select the images before running the bulk edit. Use the image host filter to quickly limit the scope.
166+
- It is recommended to preview your rules first in **Global URL Rewrite** to avoid unexpected bulk edits.
167+
- If the rewritten result becomes an empty string, it will be skipped.
51168
:::
52169

53-
![](https://pics.molunerfinn.com/doc/ee314dfc-7699-4ceb-8638-cafe7948bd5a)
170+
![](https://pics.molunerfinn.com/doc/20260112213624505.png)
54171

55172
## Image Host Area
56173

docs/guide/getting-started.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ You can use mini window to upload your images in Windows and Linux. MacOS can do
2424

2525
1. You can directly drag and drop images to the mini window for uploading.
2626
2. Copy the image to the clipboard, then right click on the mini window and select `clipboard image upload` ( **You are not allowed to copy the image itself in systems other than macOS, e.g. Windows must open the image and copy by right-clicking. In the normal case, you want to directly upload your image once you have a snipshot. That is the rationality of this design.**
27+
3. <Badge text="2.4.3+" /> You can also drag and drop image URLs (or multi-line URL text) to the mini window to upload by URL (less common).
2728

2829
## Top Bar Upload
2930

docs/zh/guide/config.md

Lines changed: 103 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,89 @@ PS: 如何打开本窗口,请参考[「快速入门」](./getting-started.md#
3434

3535
### 通过URL上传 <Badge text="2.3.0+" />
3636

37-
2.3.0版本开始,你可以通过图片URL来上传图片。可以用于将其他地址的图片上传至你自己的图床中。
37+
2.3.0 版本开始,你可以通过图片 URL 来上传图片。可以用于将其他地址的图片上传至你自己的图床中。
3838

39-
![](https://pics.molunerfinn.com/doc/202108282058950.png)
39+
![](https://pics.molunerfinn.com/doc/20260112213512963.png)
40+
41+
#### 批量 URL 上传 <Badge text="2.4.3+" />
42+
43+
`2.4.3` 开始,URL 上传支持一次输入多条 URL(**一行一个 URL**):
44+
45+
- 支持直接粘贴多行 URL,空行会被忽略。
46+
- 会自动去重(保留第一次出现的顺序)。
47+
-`http(s)` 的行会被跳过,并提示“已跳过 N 条非法 URL”,详细内容会写入日志(`picgo.log`)方便排查。
48+
- 当一次上传超过 10 条 URL 时会弹出确认提示;取消后会回到输入框并保留原内容。
49+
50+
#### URL 输入框的小技巧 <Badge text="2.4.3+" />
51+
52+
- 点击 URL 按钮后,PicGo 会尝试从剪贴板文本中提取 `http(s)` URL,并自动填充到输入框(不会自动开始上传,需要你确认)。
53+
- 该输入框为多行文本框,可手动拖拽调整高度(最大高度 240px)。
54+
55+
#### 拖拽 URL 上传 <Badge text="2.4.3+" />
56+
57+
除了在输入框里粘贴外,也可以把包含 URL 的文本(或 `text/uri-list`)直接拖拽到上传区,PicGo 会按行解析并上传有效 URL。
4058

4159
### 全格式上传 <Badge text="2.4.0+" />
4260

4361
`2.4.0` 版本开始,PicGo 支持「全格式上传」功能。你可以拖动非图片文件上传了。
4462

63+
## 全局 URL 重写 <Badge text="2.4.3+" />
64+
65+
`2.4.3` 开始,PicGo 提供了「全局 URL 重写」的图形化配置页面,用来在图片上传完成后,对生成的 URL 进行统一改写(例如:替换域名、切换 http/https、调整路径等)。
66+
67+
进入方式:
68+
69+
1. 打开 PicGo 设置页
70+
2. 点击「URL 重写」
71+
72+
![](https://pics.molunerfinn.com/doc/20260112213743681.png)
73+
74+
### 规则说明
75+
76+
每条规则包含:
77+
78+
- **匹配(match)**:JavaScript `RegExp` 正则(不需要写 `/.../`),用于匹配 URL。
79+
- **替换(replace)**:替换后的内容,支持 `$1``$2`... 捕获组。
80+
- **标志(flags)**`g`(全局替换)与 `i`(忽略大小写)。
81+
- **启用**:关闭后规则不生效。
82+
- **顺序**:规则按顺序匹配,**仅第一条命中的启用规则生效**(first match wins)。
83+
84+
### 预览
85+
86+
在页面底部可以输入一个 URL 进行预览,快速确认:
87+
88+
- 是否命中某条规则
89+
- 重写后的输出 URL
90+
91+
![](https://pics.molunerfinn.com/doc/20260112213811627.png)
92+
93+
### 常见例子
94+
95+
#### 例 1:替换域名(保持路径不变)
96+
97+
```text
98+
match: https://old.example.com/
99+
replace: https://new.example.com/
100+
```
101+
102+
#### 例 2:强制 https
103+
104+
```text
105+
match: ^http://
106+
replace: https://
107+
```
108+
109+
#### 例 3:把 GitHub 链接换成 jsDelivr 链接
110+
111+
![](https://pics.molunerfinn.com/doc/20260112214001033.png)
112+
113+
```text
114+
match: ^https://raw.githubusercontent.com/([^/]+)/([^/]+)/([^/]+)/(.*)$
115+
replace: https://cdn.jsdelivr.net/gh/$1/$2/$3/$4
116+
```
117+
118+
更详细的使用说明,参考 PicGo-Core 的[文档](https://picgo.github.io/PicGo-Core-Doc/zh/guide/config.html#settings)
119+
45120
## 相册区
46121

47122
支持查看你上传成功的所有图片。点击图片可以预览。点击图片下面的图标可以复制链接或者删除图片(只是删除本地数据,使其不在相册区里出现)
@@ -67,15 +142,37 @@ PS: 如何打开本窗口,请参考[「快速入门」](./getting-started.md#
67142

68143
同时,也支持简单的 `shift` 键跨图片多选。
69144

70-
### 批量修改图片域名 <Badge text="2.4.0+" />
145+
### 批量重写图片 URL <Badge text="2.4.3+" />
146+
147+
`2.4.3` 版本开始,PicGo 支持在相册里对已上传图片的 URL 进行批量重写(不仅仅是修改 Host,而是可以按规则重写整条链接)。
148+
149+
使用方法:
150+
151+
1. 在相册区勾选需要处理的图片(可先用图床筛选缩小范围)
152+
2. 在相册操作栏点击「更多」(…)按钮
153+
3. 选择「重写选中图片 URL」
154+
155+
随后会弹出配置弹窗,你可以:
156+
157+
- 勾选 **应用全局 URL 重写规则**:使用你在「全局 URL 重写」页面配置的规则(会显示全局规则数量)。
158+
- (可选)填写一条**临时规则**`匹配` + `替换`(支持正则与 `$1` 捕获组),临时规则优先级高于全局规则。
159+
- `g`:全局替换
160+
- `i`:忽略大小写
161+
162+
如果你填写了临时规则,确认后 PicGo 会询问是否将该临时规则写入全局规则列表:
163+
164+
- 「应用并写入」:应用到本次选中的相册图片,并把该规则保存到全局规则中
165+
- 「仅应用」:只对本次选中的图片生效,不写入全局规则
166+
- 「取消」:取消本次操作
71167

72-
`2.4.0` 版本开始,PicGo 支持批量修改相册区图片的域名功能。例如,你有一批图片都是 `https://www.a.com/...` 打头的 URL,你想把 `www.a.com` 批量修改成 `www.b.com` ,就可以用这个功能
168+
操作完成后,PicGo 会提示成功/失败的数量;如果没有任何 URL 被修改,也会给出提示
73169

74170
::: warning 注意
75-
需要先选中指定的图片,然后会根据已选中的图片进行修改,你可以通过图床筛选功能只筛选出需要修改的图片。
171+
- 建议先在「全局 URL 重写」页面使用“预览”确认规则无误,再批量应用到相册,避免误改。
172+
- 如果重写结果为空(空字符串),该条会被跳过。
76173
:::
77174

78-
![](https://pics.molunerfinn.com/doc/ee314dfc-7699-4ceb-8638-cafe7948bd5a)
175+
![](https://pics.molunerfinn.com/doc/20260112213624505.png)
79176

80177

81178
## 图床区

docs/zh/guide/getting-started.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ Mini窗口只支持Windows和Linux,macOS可以使用顶部栏图标。(因
2222

2323
1. 可以直接拖拽图片到mini窗口上上传
2424
2. 将图片复制到剪贴板,然后右键mini窗口,选择`剪贴板图片上传`
25+
3. <Badge text="2.4.3+" /> 也可以拖拽图片 URL(或多行 URL 文本)到 mini 窗口上传(一般不太常用)
2526

2627
::: tip 提示
2728
**只有macOS以及Windows10可以通过复制图片文件本身然后通过剪贴板图片上传。Windows7或者Linux必须打开图片后,右键图片->复制图片才可以通过剪贴板图片上传。不过通常情况下,你直接截图后,图片就复制到剪贴板了。所以截图之后可以直接使用这个功能。**
@@ -60,4 +61,4 @@ Mini窗口只支持Windows和Linux,macOS可以使用顶部栏图标。(因
6061
2. 直接在主窗口上传区域点击,然后弹出文件浏览器后选择图片上传。
6162
3. 可以将图片复制到剪贴板,然后点击`剪贴板图片上传`按钮来上传。
6263

63-
![](https://pics.molunerfinn.com/doc/picgo-2.0.gif)
64+
![](https://pics.molunerfinn.com/doc/picgo-2.0.gif)

0 commit comments

Comments
 (0)