-
-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathindex.js
51 lines (49 loc) · 1.24 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
/**
* rehype plugin to minify URLs.
*
* ## What is this?
*
* This package is a plugin that can minify URL values of certain attributes
* using [`relateurl`](https://github.com/stevenvachon/relateurl).
*
* ## When should I use this?
*
* You can use this plugin when you want to improve the size of HTML documents.
*
* ## API
*
* ### `unified().use(rehypeMinifyUrl[, options])`
*
* Minify URLs.
*
* ###### Parameters
*
* * `options` (`Options`, optional)
* — configuration
*
* ###### Returns
*
* Transform ([`Transformer`](https://github.com/unifiedjs/unified#transformer)).
*
* ### `Options`
*
* Configuration (TypeScript type).
*
* All options except for `from` are passed through to
* [`relateurl`](https://github.com/stevenvachon/relateurl).
*
* ###### Fields
*
* * `from` (`string`, optional)
* — absolute URL to where the document will be hosted; can also be set
* with an `origin` and `pathname` in `file.data.meta` (as supported by
* [`rehype-meta`](https://github.com/rehypejs/rehype-meta)).
*
* @example
* {"plugin": {"from": "https://example.com"}}
* <a href="/foo/../bar.html"></a>
*/
/**
* @typedef {import('./lib/index.js').Options} Options
*/
export {default} from './lib/index.js'