Skip to content

Commit 4668472

Browse files
balh55yxhofe
andauthored
preview variables (#201)
* Update preview.md * Update preview.md * preview variables --------- Co-authored-by: Andy Hsu <[email protected]>
1 parent db9a0c0 commit 4668472

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

docs/config/preview.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,14 @@ the first key `extensions` is the file extensions that split by `,`(if it's star
5454

5555
For the external url, we provide some variables for you to use:
5656

57+
Basic variable:
58+
5759
- `$url`: the file url
60+
- `$durl`: the file of alist URL
5861
- `$name`: the file name
62+
63+
Extended variables:
64+
Add [eb_] before the basic variable, where e means `encodeURIComponent`, b means `base64`, such as
5965
- `$e_url`: encodeURIComponent($url)
6066
- `$b_url`: btoa($url)
6167
- `$eb_url`: encodeURIComponent(btoa($url))

docs/zh/config/preview.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,14 @@ interface {
5454

5555
对于外部 url,我们提供了一些变量供您使用:
5656

57+
基础变量:
58+
5759
- `$url`: the file url
60+
- `$durl`: the file of alist URL
5861
- `$name`: the file name
62+
63+
拓展变量:
64+
在基础变量前添加[eb_],其中e表示`encodeURIComponent`,b表示`base64`, 如
5965
- `$e_url`: encodeURIComponent($url)
6066
- `$b_url`: btoa($url)
6167
- `$eb_url`: encodeURIComponent(btoa($url))

0 commit comments

Comments
 (0)