-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.ts
33 lines (28 loc) · 818 Bytes
/
index.ts
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
import type Hexo from "hexo";
declare let hexo: Hexo;
import {
default_htmlnanoOptions,
default_options,
default_postHtmlOptions,
} from "./default_config";
import { filter } from "./filter";
hexo.config.hexo_htmlnano = hexo.config.hexo_htmlnano || {};
hexo.config.hexo_htmlnano.htmlnanoOptions = Object.freeze(
Object.assign(
default_htmlnanoOptions,
hexo.config.hexo_htmlnano.htmlnanoOptions,
),
);
hexo.config.hexo_htmlnano.postHtmlOptions = Object.freeze(
Object.assign(
default_postHtmlOptions,
hexo.config.hexo_htmlnano.postHtmlOptions,
),
);
const options = Object.freeze(
Object.assign(default_options, hexo.config.hexo_htmlnano),
);
hexo.config.hexo_htmlnano = options;
if (options.enable) {
hexo.extend.filter.register("after_render:html", filter, options.priority);
}