hexo-adsense 1.1.1 → 2.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +0 -0
- package/LICENSE +0 -0
- package/dist/index.cjs +12799 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.js +12782 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +12782 -0
- package/dist/index.mjs.map +1 -0
- package/dist/source/adblock.css +2 -0
- package/dist/source/adblock.js +1 -0
- package/{lib → dist}/source/article-ads.css +0 -0
- package/dist/source/article-ads.js +1 -0
- package/dist/source/article-ads.old.js +1 -0
- package/{lib → dist}/source/blogger-redirect.html +0 -0
- package/dist/source/https.js +1 -0
- package/{lib → dist}/source/in_article_ads_test.html +0 -0
- package/package.json +122 -38
- package/{README.md → readme.md} +27 -8
- package/gulpfile.ts +0 -100
- package/lib/index.d.ts +0 -1
- package/lib/index.js +0 -91
- package/lib/packages/hexo-cli-extras/lib/env.d.ts +0 -3
- package/lib/packages/hexo-cli-extras/lib/env.js +0 -49
- package/lib/packages/hexo-extend-injector2/index.d.ts +0 -2
- package/lib/packages/hexo-extend-injector2/index.js +0 -12
- package/lib/packages/hexo-extend-injector2/lib/bundle/css-bundle.d.ts +0 -2
- package/lib/packages/hexo-extend-injector2/lib/bundle/css-bundle.js +0 -64
- package/lib/packages/hexo-extend-injector2/lib/bundle/css-generator.d.ts +0 -2
- package/lib/packages/hexo-extend-injector2/lib/bundle/css-generator.js +0 -12
- package/lib/packages/hexo-extend-injector2/lib/bundle/handle-data-pre.d.ts +0 -2
- package/lib/packages/hexo-extend-injector2/lib/bundle/handle-data-pre.js +0 -28
- package/lib/packages/hexo-extend-injector2/lib/bundle/js-bundle.d.ts +0 -2
- package/lib/packages/hexo-extend-injector2/lib/bundle/js-bundle.js +0 -32
- package/lib/packages/hexo-extend-injector2/lib/bundle/js-generator.d.ts +0 -2
- package/lib/packages/hexo-extend-injector2/lib/bundle/js-generator.js +0 -8
- package/lib/packages/hexo-extend-injector2/lib/default-config.d.ts +0 -39
- package/lib/packages/hexo-extend-injector2/lib/default-config.js +0 -46
- package/lib/packages/hexo-extend-injector2/lib/filter.d.ts +0 -2
- package/lib/packages/hexo-extend-injector2/lib/filter.js +0 -22
- package/lib/packages/hexo-extend-injector2/lib/helper/injector.d.ts +0 -2
- package/lib/packages/hexo-extend-injector2/lib/helper/injector.js +0 -5
- package/lib/packages/hexo-extend-injector2/lib/helper/next-inject.d.ts +0 -2
- package/lib/packages/hexo-extend-injector2/lib/helper/next-inject.js +0 -12
- package/lib/packages/hexo-extend-injector2/lib/injector.d.ts +0 -29
- package/lib/packages/hexo-extend-injector2/lib/injector.js +0 -125
- package/lib/packages/hexo-extend-injector2/lib/load.d.ts +0 -3
- package/lib/packages/hexo-extend-injector2/lib/load.js +0 -37
- package/lib/packages/hexo-extend-injector2/lib/next-point.d.ts +0 -2
- package/lib/packages/hexo-extend-injector2/lib/next-point.js +0 -18
- package/lib/packages/hexo-extend-injector2/lib/next.d.ts +0 -2
- package/lib/packages/hexo-extend-injector2/lib/next.js +0 -99
- package/lib/packages/hexo-extend-injector2/lib/order.d.ts +0 -5
- package/lib/packages/hexo-extend-injector2/lib/order.js +0 -8
- package/lib/source/adblock.css +0 -2
- package/lib/source/adblock.js +0 -1
- package/lib/source/article-ads.js +0 -1
- package/lib/source/article-ads.old.js +0 -1
- package/lib/source/https.js +0 -1
- package/lib/src/article-ads.d.ts +0 -20
- package/lib/src/article-ads.js +0 -310
- package/lib/src/checkLocalHost.d.ts +0 -10
- package/lib/src/checkLocalHost.js +0 -37
- package/lib/src/config.d.ts +0 -14
- package/lib/src/config.js +0 -50
- package/lib/src/html-parser.d.ts +0 -8
- package/lib/src/html-parser.js +0 -26
- package/lib/src/log.d.ts +0 -1
- package/lib/src/log.js +0 -11
- package/lib/src/logger.d.ts +0 -3
- package/lib/src/logger.js +0 -25
- package/lib/src/md5.d.ts +0 -7
- package/lib/src/md5.js +0 -30
- package/lib/src/safestringify.d.ts +0 -2
- package/lib/src/safestringify.js +0 -125
- package/lib/src/utils.d.ts +0 -31
- package/lib/src/utils.js +0 -160
- package/lib/src/versionParser.d.ts +0 -27
- package/lib/src/versionParser.js +0 -40
- package/packages/@types/.gitmodules +0 -8
- package/packages/@types/LICENSE +0 -21
- package/packages/@types/README.md +0 -27
- package/packages/@types/hexo/HexoConfig.d.ts +0 -216
- package/packages/@types/hexo/LICENSE +0 -21
- package/packages/@types/hexo/README.md +0 -16
- package/packages/@types/hexo/index.d.ts +0 -849
- package/packages/@types/hexo/package.json +0 -34
- package/packages/@types/hexo-bunyan/LICENSE +0 -21
- package/packages/@types/hexo-bunyan/README.md +0 -16
- package/packages/@types/hexo-bunyan/index.d.ts +0 -9
- package/packages/@types/hexo-bunyan/package.json +0 -24
- package/packages/@types/hexo-log/LICENSE +0 -21
- package/packages/@types/hexo-log/README.md +0 -16
- package/packages/@types/hexo-log/index.d.ts +0 -159
- package/packages/@types/hexo-log/package.json +0 -28
- package/packages/@types/index.js +0 -2
- package/packages/@types/package.json +0 -30
- package/packages/@types/test/package.json +0 -15
- package/packages/@types/test/through2.ts +0 -6
- package/packages/@types/tsconfig.json +0 -14
- package/packages/@types/typings/index.d.ts +0 -7
- package/packages/@types/typings/kill-port.d.ts +0 -3
- package/packages/@types/typings/markdown-it-abbr.d.ts +0 -4
- package/packages/@types/typings/markdown-it-footnote.d.ts +0 -4
- package/packages/@types/typings/markdown-it-image-figures.d.ts +0 -4
- package/packages/@types/typings/markdown-it-mark.d.ts +0 -4
- package/packages/@types/typings/markdown-it-sub.d.ts +0 -7
- package/packages/@types/typings/markdown-it-sup.d.ts +0 -7
- package/packages/hexo-cli-extras/.eslintrc +0 -13
- package/packages/hexo-cli-extras/LICENSE.md +0 -20
- package/packages/hexo-cli-extras/README.md +0 -146
- package/packages/hexo-cli-extras/docs/basic.gif +0 -0
- package/packages/hexo-cli-extras/docs/gui.gif +0 -0
- package/packages/hexo-cli-extras/docs/remove.png +0 -0
- package/packages/hexo-cli-extras/docs/rename.png +0 -0
- package/packages/hexo-cli-extras/index.js +0 -48
- package/packages/hexo-cli-extras/lib/edit.js +0 -209
- package/packages/hexo-cli-extras/lib/env.js +0 -52
- package/packages/hexo-cli-extras/lib/extensions.js +0 -23
- package/packages/hexo-cli-extras/lib/integrate.js +0 -87
- package/packages/hexo-cli-extras/lib/isolate.js +0 -179
- package/packages/hexo-cli-extras/lib/remove.js +0 -145
- package/packages/hexo-cli-extras/lib/rename.js +0 -171
- package/packages/hexo-cli-extras/package.json +0 -34
- package/packages/hexo-extend-injector2/.eslintrc +0 -4
- package/packages/hexo-extend-injector2/.github/workflows/linter.yml +0 -27
- package/packages/hexo-extend-injector2/.github/workflows/tester.yml +0 -24
- package/packages/hexo-extend-injector2/.vscode/settings.json +0 -10
- package/packages/hexo-extend-injector2/LICENSE +0 -165
- package/packages/hexo-extend-injector2/README-ZH.md +0 -189
- package/packages/hexo-extend-injector2/README.md +0 -191
- package/packages/hexo-extend-injector2/USAGE.md +0 -38
- package/packages/hexo-extend-injector2/index.js +0 -14
- package/packages/hexo-extend-injector2/lib/bundle/css-bundle.js +0 -79
- package/packages/hexo-extend-injector2/lib/bundle/css-generator.js +0 -13
- package/packages/hexo-extend-injector2/lib/bundle/handle-data-pre.js +0 -29
- package/packages/hexo-extend-injector2/lib/bundle/js-bundle.js +0 -42
- package/packages/hexo-extend-injector2/lib/bundle/js-generator.js +0 -10
- package/packages/hexo-extend-injector2/lib/default-config.js +0 -52
- package/packages/hexo-extend-injector2/lib/filter.js +0 -24
- package/packages/hexo-extend-injector2/lib/helper/injector.js +0 -6
- package/packages/hexo-extend-injector2/lib/helper/next-inject.js +0 -14
- package/packages/hexo-extend-injector2/lib/injector.js +0 -128
- package/packages/hexo-extend-injector2/lib/load.js +0 -45
- package/packages/hexo-extend-injector2/lib/next-point.js +0 -19
- package/packages/hexo-extend-injector2/lib/next.js +0 -87
- package/packages/hexo-extend-injector2/lib/order.js +0 -9
- package/packages/hexo-extend-injector2/package.json +0 -49
- package/packages/hexo-extend-injector2/renovate.json +0 -6
- package/packages/hexo-extend-injector2/test/.eslintrc +0 -3
- package/packages/hexo-extend-injector2/test/index.js +0 -18
- package/packages/hexo-extend-injector2/test/lib/bundle/bundle-css.js +0 -86
- package/packages/hexo-extend-injector2/test/lib/bundle/bundle-js.js +0 -36
- package/packages/hexo-extend-injector2/test/lib/bundle/test.css +0 -3
- package/packages/hexo-extend-injector2/test/lib/bundle/test.js +0 -5
- package/packages/hexo-extend-injector2/test/lib/helper/injector.js +0 -45
- package/packages/hexo-extend-injector2/test/lib/helper/next-inject.js +0 -69
- package/packages/hexo-extend-injector2/test/lib/hexo-compatible.js +0 -250
- package/packages/hexo-extend-injector2/test/lib/hexo-injector.js +0 -37
- package/packages/hexo-extend-injector2/test/lib/injector.js +0 -93
- package/packages/memoize/CHANGELOG.md +0 -82
- package/packages/memoize/CHANGES +0 -124
- package/packages/memoize/LICENSE +0 -15
- package/packages/memoize/README.md +0 -503
- package/packages/memoize/ext/async.js +0 -154
- package/packages/memoize/ext/dispose.js +0 -33
- package/packages/memoize/ext/max-age.js +0 -90
- package/packages/memoize/ext/max.js +0 -27
- package/packages/memoize/ext/promise.js +0 -147
- package/packages/memoize/ext/ref-counter.js +0 -48
- package/packages/memoize/index.js +0 -34
- package/packages/memoize/lib/configure-map.js +0 -182
- package/packages/memoize/lib/methods.js +0 -32
- package/packages/memoize/lib/registered-extensions.js +0 -1
- package/packages/memoize/lib/resolve-length.js +0 -15
- package/packages/memoize/lib/resolve-normalize.js +0 -17
- package/packages/memoize/lib/resolve-resolve.js +0 -21
- package/packages/memoize/lib/weak.js +0 -134
- package/packages/memoize/methods-plain.js +0 -3
- package/packages/memoize/methods.js +0 -3
- package/packages/memoize/normalizers/get-1.js +0 -29
- package/packages/memoize/normalizers/get-fixed.js +0 -71
- package/packages/memoize/normalizers/get-primitive-fixed.js +0 -16
- package/packages/memoize/normalizers/get.js +0 -90
- package/packages/memoize/normalizers/primitive.js +0 -9
- package/packages/memoize/package.json +0 -60
- package/packages/memoize/plain.js +0 -37
- package/packages/memoize/profile.js +0 -107
- package/packages/memoize/repository.md +0 -1
- package/packages/memoize/weak-plain.js +0 -3
- package/packages/memoize/weak.js +0 -3
- package/tsconfig.json +0 -39
- package/unused.md +0 -11
|
@@ -1,849 +0,0 @@
|
|
|
1
|
-
// Type definitions for hexo 3.8
|
|
2
|
-
// Project: https://hexo.io/
|
|
3
|
-
// Definitions by: KentarouTakeda <https://github.com/kentarouTakeda>
|
|
4
|
-
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
|
5
|
-
// Modifications by: DimasLanjaka <https://github.com/dimaslanjaka>
|
|
6
|
-
// TypeScript Version: 3.0
|
|
7
|
-
|
|
8
|
-
import { EventEmitter } from "events";
|
|
9
|
-
import moment from "moment";
|
|
10
|
-
import { ParsedArgs } from "minimist";
|
|
11
|
-
import Logger = require("bunyan");
|
|
12
|
-
import underscore from "underscore";
|
|
13
|
-
import connect = require("connect");
|
|
14
|
-
import Stream = require("stream");
|
|
15
|
-
import util = require("hexo-util");
|
|
16
|
-
import fs = require("fs");
|
|
17
|
-
import Bluebird from "bluebird";
|
|
18
|
-
import HexoConfig from "./HexoConfig";
|
|
19
|
-
|
|
20
|
-
declare global {
|
|
21
|
-
const hexo: Hexo;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
export interface Model<T> {
|
|
25
|
-
/**
|
|
26
|
-
* Warehouse method
|
|
27
|
-
* https://hexojs.github.io/warehouse/
|
|
28
|
-
*/
|
|
29
|
-
toArray(): T[];
|
|
30
|
-
/**
|
|
31
|
-
* Warehouse method
|
|
32
|
-
* https://hexojs.github.io/warehouse/
|
|
33
|
-
*/
|
|
34
|
-
count(): number;
|
|
35
|
-
/**
|
|
36
|
-
* Warehouse method
|
|
37
|
-
* https://hexojs.github.io/warehouse/
|
|
38
|
-
*/
|
|
39
|
-
forEach(fn: (v: T, i: number) => void): void;
|
|
40
|
-
/**
|
|
41
|
-
* Warehouse method
|
|
42
|
-
* https://hexojs.github.io/warehouse/
|
|
43
|
-
*/
|
|
44
|
-
filter(fn: (v: T, i: number) => boolean): Model<T>;
|
|
45
|
-
/**
|
|
46
|
-
* Warehouse method
|
|
47
|
-
* https://hexojs.github.io/warehouse/
|
|
48
|
-
*/
|
|
49
|
-
map<U>(fn: (v: T, i: number) => U): U[];
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
interface Site {
|
|
53
|
-
posts: Model<Hexo.Locals.Post>;
|
|
54
|
-
pages: Model<Hexo.Locals.Page>;
|
|
55
|
-
categories: Model<Hexo.Locals.Category>;
|
|
56
|
-
tags: Model<Hexo.Locals.Tag>;
|
|
57
|
-
data: { [key: string]: any };
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
declare class Hexo extends EventEmitter {
|
|
61
|
-
/**
|
|
62
|
-
* Create a Hexo instance.
|
|
63
|
-
* @param base the root directory of the website, `base_dir` .
|
|
64
|
-
* @param args an object containing the initialization options.
|
|
65
|
-
*/
|
|
66
|
-
constructor(base?: string, args?: Hexo.InstanceOptions);
|
|
67
|
-
|
|
68
|
-
/**
|
|
69
|
-
* Load configuration and plugins.
|
|
70
|
-
*/
|
|
71
|
-
init(): Promise<void>;
|
|
72
|
-
|
|
73
|
-
/**
|
|
74
|
-
* Loading all files in the `source` folder as well as the theme data.
|
|
75
|
-
*/
|
|
76
|
-
load(fn?: (err: any, value: any) => void): Promise<any>;
|
|
77
|
-
|
|
78
|
-
/**
|
|
79
|
-
* The same things `load` does, but will also start watching for file changes continuously.
|
|
80
|
-
*/
|
|
81
|
-
watch(fn?: (err: any, value: any) => void): Promise<any>;
|
|
82
|
-
|
|
83
|
-
unwatch(): void;
|
|
84
|
-
|
|
85
|
-
/**
|
|
86
|
-
* Any console command can be called explicitly using the call method on the Hexo instance.
|
|
87
|
-
*/
|
|
88
|
-
call(name: string, args?: any, fn?: (err: any, value: any) => void): Promise<any>;
|
|
89
|
-
|
|
90
|
-
call(name: string, fn?: (err: any, value: any) => void): Promise<any>;
|
|
91
|
-
|
|
92
|
-
/**
|
|
93
|
-
* You should call the `exit` method upon successful or unsuccessful completion of a console command.
|
|
94
|
-
* This allows Hexo to exit gracefully and finish up important things such as saving the database.
|
|
95
|
-
*/
|
|
96
|
-
exit(err?: any): Promise<void>;
|
|
97
|
-
|
|
98
|
-
/**
|
|
99
|
-
* Site settings in `_config.yml`
|
|
100
|
-
*/
|
|
101
|
-
readonly config: HexoConfig;
|
|
102
|
-
|
|
103
|
-
readonly theme: Hexo.Theme;
|
|
104
|
-
|
|
105
|
-
readonly source: Hexo.Box;
|
|
106
|
-
|
|
107
|
-
readonly post: Hexo.Post;
|
|
108
|
-
|
|
109
|
-
readonly render: Hexo.Render;
|
|
110
|
-
|
|
111
|
-
/**
|
|
112
|
-
* Local variables are used for template rendering, which is the `site` variable in templates.
|
|
113
|
-
* https://hexo.io/api/locals
|
|
114
|
-
*/
|
|
115
|
-
readonly locals: Hexo.Locals;
|
|
116
|
-
|
|
117
|
-
readonly base_dir: string;
|
|
118
|
-
|
|
119
|
-
/**
|
|
120
|
-
* Public folder. Where the static site will be generated
|
|
121
|
-
*/
|
|
122
|
-
readonly public_dir: string;
|
|
123
|
-
|
|
124
|
-
/**
|
|
125
|
-
* Source folder. Where your content is stored
|
|
126
|
-
*/
|
|
127
|
-
readonly source_dir: string;
|
|
128
|
-
|
|
129
|
-
readonly plugin_dir: string;
|
|
130
|
-
|
|
131
|
-
readonly script_dir: string;
|
|
132
|
-
|
|
133
|
-
readonly scaffold_dir: string;
|
|
134
|
-
|
|
135
|
-
readonly theme_dir: string;
|
|
136
|
-
|
|
137
|
-
readonly theme_script_dir: string;
|
|
138
|
-
|
|
139
|
-
readonly config_path: string;
|
|
140
|
-
|
|
141
|
-
readonly env: {
|
|
142
|
-
readonly args: ParsedArgs;
|
|
143
|
-
readonly debug: boolean;
|
|
144
|
-
readonly safe: boolean;
|
|
145
|
-
readonly silent: boolean;
|
|
146
|
-
readonly env: string;
|
|
147
|
-
readonly version: string;
|
|
148
|
-
readonly init: boolean;
|
|
149
|
-
};
|
|
150
|
-
|
|
151
|
-
/**
|
|
152
|
-
* Logger object
|
|
153
|
-
* https://www.npmjs.com/package/bunyan
|
|
154
|
-
*/
|
|
155
|
-
readonly log: Logger;
|
|
156
|
-
|
|
157
|
-
readonly extend: {
|
|
158
|
-
/**
|
|
159
|
-
* The console forms the bridge between Hexo and its users. It registers and describes the available console commands.
|
|
160
|
-
*/
|
|
161
|
-
readonly console: Hexo.extend.Console;
|
|
162
|
-
/**
|
|
163
|
-
* A deployer helps users quickly deploy their site to a remote server without complicated commands.
|
|
164
|
-
*/
|
|
165
|
-
readonly deployer: Hexo.extend.Deployer;
|
|
166
|
-
/**
|
|
167
|
-
* A filter is used to modify some specified data. Hexo passes data to filters in sequence and the filters then modify the data one after the other.
|
|
168
|
-
*/
|
|
169
|
-
readonly filter: Hexo.extend.Filter;
|
|
170
|
-
/**
|
|
171
|
-
* A generator builds routes based on processed files.
|
|
172
|
-
*/
|
|
173
|
-
readonly generator: Hexo.extend.Generator;
|
|
174
|
-
/**
|
|
175
|
-
* A helper makes it easy to quickly add snippets to your templates. We recommend using helpers instead of templates when you’re dealing with more complicated code.
|
|
176
|
-
*/
|
|
177
|
-
readonly helper: Hexo.extend.Helper;
|
|
178
|
-
/**
|
|
179
|
-
* A migrator helps users migrate from other systems to Hexo.
|
|
180
|
-
*/
|
|
181
|
-
readonly migrator: Hexo.extend.Migrator;
|
|
182
|
-
/**
|
|
183
|
-
* A processor is used to process source files in the source folder.
|
|
184
|
-
*/
|
|
185
|
-
readonly processor: Hexo.extend.Processor;
|
|
186
|
-
/**
|
|
187
|
-
* A renderer is used to render content.
|
|
188
|
-
*/
|
|
189
|
-
readonly renderer: Hexo.extend.Renderer;
|
|
190
|
-
/**
|
|
191
|
-
* A tag allows users to quickly and easily insert snippets into their posts.
|
|
192
|
-
*/
|
|
193
|
-
readonly tag: Hexo.extend.Tag;
|
|
194
|
-
};
|
|
195
|
-
|
|
196
|
-
readonly route: Hexo.Router;
|
|
197
|
-
|
|
198
|
-
readonly scaffold: Hexo.Scaffold;
|
|
199
|
-
|
|
200
|
-
/**
|
|
201
|
-
* Emitted before deployment begins.
|
|
202
|
-
*/
|
|
203
|
-
on(ev: "deployBefore", fn: () => void): this;
|
|
204
|
-
|
|
205
|
-
/**
|
|
206
|
-
* Emitted after deployment finishes.
|
|
207
|
-
*/
|
|
208
|
-
on(ev: "deployAfter", fn: () => void): this;
|
|
209
|
-
|
|
210
|
-
/**
|
|
211
|
-
* Emitted before Hexo exits.
|
|
212
|
-
*/
|
|
213
|
-
on(ev: "exit", fn: (err: any) => void): this;
|
|
214
|
-
|
|
215
|
-
/**
|
|
216
|
-
* Emitted before generation begins.
|
|
217
|
-
*/
|
|
218
|
-
on(ev: "generateBefore", fn: () => void): this;
|
|
219
|
-
|
|
220
|
-
/**
|
|
221
|
-
* Emitted after generation finishes.
|
|
222
|
-
*/
|
|
223
|
-
on(ev: "generateAfter", fn: () => void): this;
|
|
224
|
-
|
|
225
|
-
/**
|
|
226
|
-
* Emitted after a new post has been created. This event returns the post data:
|
|
227
|
-
*/
|
|
228
|
-
on(ev: "new", fn: (post: { path: string; content: string }) => void): this;
|
|
229
|
-
|
|
230
|
-
/**
|
|
231
|
-
* Emitted before processing begins. This event returns a path representing the root directory of the box.
|
|
232
|
-
*/
|
|
233
|
-
on(ev: "processBefore", fn: (type: Hexo.Box.File["type"], path: string) => void): this;
|
|
234
|
-
|
|
235
|
-
/**
|
|
236
|
-
* Emitted after processing finishes. This event returns a path representing the root directory of the box.
|
|
237
|
-
*/
|
|
238
|
-
on(ev: "processAfter", fn: (type: Hexo.Box.File["type"], path: string) => void): this;
|
|
239
|
-
|
|
240
|
-
/**
|
|
241
|
-
* Emitted after initialization finishes.
|
|
242
|
-
*/
|
|
243
|
-
on(ev: "ready", fn: () => void): this;
|
|
244
|
-
}
|
|
245
|
-
|
|
246
|
-
declare namespace Hexo {
|
|
247
|
-
interface InstanceOptions {
|
|
248
|
-
debug?: boolean | undefined;
|
|
249
|
-
safe?: boolean | undefined;
|
|
250
|
-
silent?: boolean | undefined;
|
|
251
|
-
config?: string | undefined;
|
|
252
|
-
}
|
|
253
|
-
|
|
254
|
-
interface Locals {
|
|
255
|
-
get(type: "posts"): Model<Locals.Post>;
|
|
256
|
-
get(type: "pages"): Model<Locals.Page>;
|
|
257
|
-
get(type: "categories"): Model<Locals.Category>;
|
|
258
|
-
get(type: "tags"): Model<Locals.Tag>;
|
|
259
|
-
/**
|
|
260
|
-
* Get a Variable
|
|
261
|
-
*/
|
|
262
|
-
get(type: string): any;
|
|
263
|
-
|
|
264
|
-
/**
|
|
265
|
-
* Set a Variable
|
|
266
|
-
*/
|
|
267
|
-
set(type: string, fn: () => any): this;
|
|
268
|
-
|
|
269
|
-
/**
|
|
270
|
-
* Remove a Variable
|
|
271
|
-
*/
|
|
272
|
-
remove(type: string): this;
|
|
273
|
-
|
|
274
|
-
/**
|
|
275
|
-
* Get All Variable
|
|
276
|
-
*/
|
|
277
|
-
toObject(): {
|
|
278
|
-
posts: Hexo.Post;
|
|
279
|
-
pages: Hexo.Locals.Page;
|
|
280
|
-
categories: Hexo.Locals.Category;
|
|
281
|
-
tags: Hexo.Locals.Tag;
|
|
282
|
-
data: Record<string, unknown>;
|
|
283
|
-
};
|
|
284
|
-
|
|
285
|
-
/**
|
|
286
|
-
* Invalidate the cache
|
|
287
|
-
*/
|
|
288
|
-
invalidate(): this;
|
|
289
|
-
}
|
|
290
|
-
namespace Locals {
|
|
291
|
-
interface Page {
|
|
292
|
-
title: string;
|
|
293
|
-
date: moment.Moment;
|
|
294
|
-
updated?: moment.Moment | undefined;
|
|
295
|
-
comments: boolean;
|
|
296
|
-
layout: string;
|
|
297
|
-
content: string;
|
|
298
|
-
excerpt?: string | undefined;
|
|
299
|
-
more?: string | undefined;
|
|
300
|
-
source: string;
|
|
301
|
-
full_source: string;
|
|
302
|
-
path: string;
|
|
303
|
-
permalink: string;
|
|
304
|
-
prev?: null | Page | undefined;
|
|
305
|
-
next?: null | Page | undefined;
|
|
306
|
-
raw?: string | undefined;
|
|
307
|
-
photos?: string[] | undefined;
|
|
308
|
-
link?: string | undefined;
|
|
309
|
-
[key: string]: any;
|
|
310
|
-
}
|
|
311
|
-
|
|
312
|
-
interface Post extends Page {
|
|
313
|
-
published?: boolean | undefined;
|
|
314
|
-
categories?: string[] | undefined;
|
|
315
|
-
tags: string[];
|
|
316
|
-
}
|
|
317
|
-
|
|
318
|
-
interface Tag {
|
|
319
|
-
name: string;
|
|
320
|
-
slug: string;
|
|
321
|
-
path: string;
|
|
322
|
-
permalink: string;
|
|
323
|
-
posts: Model<Post>;
|
|
324
|
-
length: number;
|
|
325
|
-
}
|
|
326
|
-
interface Category extends Tag {
|
|
327
|
-
parent: string;
|
|
328
|
-
}
|
|
329
|
-
type All = Hexo.Locals.Post & Hexo.Locals.Page & Hexo.Locals.Category & Hexo.Locals.Tag;
|
|
330
|
-
}
|
|
331
|
-
|
|
332
|
-
namespace extend {
|
|
333
|
-
interface Console {
|
|
334
|
-
register(name: string, desc: string, options: Console.Options, fn: (args: ParsedArgs) => void): void;
|
|
335
|
-
register(name: string, options: Console.Options, fn: (args: ParsedArgs) => void): void;
|
|
336
|
-
register(name: string, desc: string, fn: (args: ParsedArgs) => void): void;
|
|
337
|
-
register(name: string, fn: (args: ParsedArgs) => void): void;
|
|
338
|
-
}
|
|
339
|
-
namespace Console {
|
|
340
|
-
interface Options {
|
|
341
|
-
/**
|
|
342
|
-
* The usage of a console command.
|
|
343
|
-
*/
|
|
344
|
-
usage?: string | undefined;
|
|
345
|
-
|
|
346
|
-
/**
|
|
347
|
-
* The description of each argument of a console command.
|
|
348
|
-
*/
|
|
349
|
-
arguments?: Array<{ name: string; desc: string }> | undefined;
|
|
350
|
-
|
|
351
|
-
/**
|
|
352
|
-
* The description of each option of a console command.
|
|
353
|
-
*/
|
|
354
|
-
options?: Array<{ name: string; desc: string }> | undefined;
|
|
355
|
-
|
|
356
|
-
/**
|
|
357
|
-
* More detailed information about a console command.
|
|
358
|
-
*/
|
|
359
|
-
desc?: string | undefined;
|
|
360
|
-
}
|
|
361
|
-
}
|
|
362
|
-
|
|
363
|
-
interface Deployer {
|
|
364
|
-
register(name: string, fn: (args: Deployer.Config) => void): void;
|
|
365
|
-
}
|
|
366
|
-
namespace Deployer {
|
|
367
|
-
interface Config {
|
|
368
|
-
readonly type: string | undefined;
|
|
369
|
-
readonly [key: string]: any;
|
|
370
|
-
}
|
|
371
|
-
}
|
|
372
|
-
|
|
373
|
-
interface Filter {
|
|
374
|
-
register(type: string, fn: (data: any, ...args: any[]) => any, priority?: number): any;
|
|
375
|
-
register(type: string, data: Hexo.View): any;
|
|
376
|
-
|
|
377
|
-
/**
|
|
378
|
-
* Executed before a post is rendered. Refer to post rendering to learn the execution steps.
|
|
379
|
-
*/
|
|
380
|
-
register(
|
|
381
|
-
type: "before_post_render",
|
|
382
|
-
fn: (data: { content: string; [key: string]: any }) => { content: string; [key: string]: any } | void,
|
|
383
|
-
priority?: number
|
|
384
|
-
): void;
|
|
385
|
-
|
|
386
|
-
/**
|
|
387
|
-
* Executed after a post is rendered. Refer to post rendering to learn the execution steps.
|
|
388
|
-
*/
|
|
389
|
-
register(
|
|
390
|
-
type: "after_post_render",
|
|
391
|
-
fn: (data: { content: string; [key: string]: any }) => { content: string; [key: string]: any } | void,
|
|
392
|
-
priority?: number
|
|
393
|
-
): void;
|
|
394
|
-
|
|
395
|
-
/**
|
|
396
|
-
* Executed before Hexo is about to exit – this will run right after `hexo.exit` is called.
|
|
397
|
-
*/
|
|
398
|
-
register(type: "before_exit", fn: () => void, priority?: number): void;
|
|
399
|
-
|
|
400
|
-
/**
|
|
401
|
-
* Executed before generation begins.
|
|
402
|
-
*/
|
|
403
|
-
register(type: "before_generate", fn: (data: any) => any, priority?: number): void;
|
|
404
|
-
|
|
405
|
-
/**
|
|
406
|
-
* Executed after generation finishes.
|
|
407
|
-
*/
|
|
408
|
-
register(type: "after_generate", fn: () => void, priority?: number): void;
|
|
409
|
-
|
|
410
|
-
/**
|
|
411
|
-
* Modify [local variables](https://hexo.io/docs/variables) in templates.
|
|
412
|
-
*/
|
|
413
|
-
register(type: "template_locals", fn: (locals: TemplateLocals) => TemplateLocals | void, priority?: number): void;
|
|
414
|
-
|
|
415
|
-
/**
|
|
416
|
-
* Executed after Hexo is initialized – this will run right after `hexo.init` completes.
|
|
417
|
-
*/
|
|
418
|
-
register(type: "after_init", fn: () => void, priority?: number): void;
|
|
419
|
-
|
|
420
|
-
/**
|
|
421
|
-
* Executed when creating a post to determine the path of new posts.
|
|
422
|
-
*/
|
|
423
|
-
register(
|
|
424
|
-
type: "new_post_path",
|
|
425
|
-
fn: (data: Post.Data, replace: boolean | undefined) => void,
|
|
426
|
-
priority?: number
|
|
427
|
-
): void;
|
|
428
|
-
|
|
429
|
-
/**
|
|
430
|
-
* Used to determine the permalink of posts.
|
|
431
|
-
*/
|
|
432
|
-
register(type: "post_permalink", fn: (permalink: string) => string, priority?: number): void;
|
|
433
|
-
|
|
434
|
-
/**
|
|
435
|
-
* Executed after rendering finishes. You can see rendering for more info.
|
|
436
|
-
*/
|
|
437
|
-
register(
|
|
438
|
-
type: "after_render:html",
|
|
439
|
-
fn: (result: string, data: { path: string; text: string; [key: string]: any }) => string | void,
|
|
440
|
-
priority?: number
|
|
441
|
-
): void;
|
|
442
|
-
|
|
443
|
-
/**
|
|
444
|
-
* Executed after generated files and cache are removed with hexo clean command.
|
|
445
|
-
*/
|
|
446
|
-
register(type: "after_clean", fn: () => void, priority?: number): void;
|
|
447
|
-
|
|
448
|
-
/**
|
|
449
|
-
* Add middleware to the server. app is a Connect instance.
|
|
450
|
-
*/
|
|
451
|
-
register(type: "server_middleware", fn: (app: connect.Server) => connect.Server | void, priority?: number): void;
|
|
452
|
-
|
|
453
|
-
unregister(type: string, fn: (...args: any[]) => any): void;
|
|
454
|
-
exec(type: string, data?: any, options?: Filter.Options): any;
|
|
455
|
-
execSync(type: string, data?: any, options?: Filter.Options): any;
|
|
456
|
-
}
|
|
457
|
-
namespace Filter {
|
|
458
|
-
interface Options {
|
|
459
|
-
/**
|
|
460
|
-
* `hexo` object.
|
|
461
|
-
*/
|
|
462
|
-
context?: Hexo | undefined;
|
|
463
|
-
/**
|
|
464
|
-
* Arguments. This must be an array.
|
|
465
|
-
*/
|
|
466
|
-
args?: any[] | undefined;
|
|
467
|
-
}
|
|
468
|
-
}
|
|
469
|
-
|
|
470
|
-
interface Generator {
|
|
471
|
-
register(
|
|
472
|
-
name: string,
|
|
473
|
-
fn: (
|
|
474
|
-
locals: Site
|
|
475
|
-
) => Generator.Return | Generator.Return[] | Bluebird<Generator.Return> | Bluebird<Generator.Return[]>
|
|
476
|
-
): void;
|
|
477
|
-
}
|
|
478
|
-
namespace Generator {
|
|
479
|
-
interface Return {
|
|
480
|
-
/**
|
|
481
|
-
* Path not including the prefixing `/` .
|
|
482
|
-
*/
|
|
483
|
-
path: string;
|
|
484
|
-
|
|
485
|
-
/**
|
|
486
|
-
* Layout. Specify the layouts for rendering. The value can be a string or an array. If it’s ignored then the route will return data directly.
|
|
487
|
-
*/
|
|
488
|
-
layout?: string | string[];
|
|
489
|
-
|
|
490
|
-
data: any;
|
|
491
|
-
}
|
|
492
|
-
}
|
|
493
|
-
|
|
494
|
-
interface Helper {
|
|
495
|
-
register(name: string, fn: (...args: any[]) => any): void;
|
|
496
|
-
list(): { [name: string]: (...args: any[]) => any };
|
|
497
|
-
get(name: string): ((...args: any[]) => any) | undefined;
|
|
498
|
-
}
|
|
499
|
-
|
|
500
|
-
interface Migrator {
|
|
501
|
-
register(name: string, fn: (args: ParsedArgs, fn: (err: any) => void) => void): void;
|
|
502
|
-
}
|
|
503
|
-
|
|
504
|
-
interface Processor {
|
|
505
|
-
register(pattern: RegExp | string | ((str: string) => any), fn: (file: Box.File) => void): void;
|
|
506
|
-
register(fn: (file: Box.File) => void): void;
|
|
507
|
-
}
|
|
508
|
-
|
|
509
|
-
interface Renderer {
|
|
510
|
-
register(
|
|
511
|
-
srcExt: string,
|
|
512
|
-
outExt: string,
|
|
513
|
-
fn: (this: Hexo, data: RendererData, options: any) => string,
|
|
514
|
-
sync: true
|
|
515
|
-
): void;
|
|
516
|
-
register(
|
|
517
|
-
srcExt: string,
|
|
518
|
-
outExt: string,
|
|
519
|
-
fn: (this: Hexo, data: RendererData, options: any) => Promise<string>,
|
|
520
|
-
sync?: false
|
|
521
|
-
): void;
|
|
522
|
-
register(
|
|
523
|
-
srcExt: string,
|
|
524
|
-
outExt: string,
|
|
525
|
-
fn: (this: Hexo, data: RendererData, options: any) => Promise<string>
|
|
526
|
-
): void;
|
|
527
|
-
}
|
|
528
|
-
|
|
529
|
-
interface RendererData {
|
|
530
|
-
/**
|
|
531
|
-
* File content.
|
|
532
|
-
*/
|
|
533
|
-
readonly text: string;
|
|
534
|
-
/**
|
|
535
|
-
* File path.
|
|
536
|
-
*/
|
|
537
|
-
readonly path?: string | undefined;
|
|
538
|
-
}
|
|
539
|
-
|
|
540
|
-
interface Tag {
|
|
541
|
-
register(name: string, fn: (args: string[], content: string | undefined) => string, options?: Tag.Options): void;
|
|
542
|
-
}
|
|
543
|
-
namespace Tag {
|
|
544
|
-
interface Options {
|
|
545
|
-
ends?: boolean | undefined;
|
|
546
|
-
async?: boolean | undefined;
|
|
547
|
-
}
|
|
548
|
-
}
|
|
549
|
-
}
|
|
550
|
-
|
|
551
|
-
interface Router {
|
|
552
|
-
/**
|
|
553
|
-
* The `get` method returns a `Stream`.
|
|
554
|
-
*/
|
|
555
|
-
get(path: string): Router.RouteStream | undefined;
|
|
556
|
-
|
|
557
|
-
/**
|
|
558
|
-
* The `set` method takes a string, a `Buffer` or a function.
|
|
559
|
-
*/
|
|
560
|
-
set(path: string, data: string | Buffer | util.Pattern<boolean> | Router.Data): this;
|
|
561
|
-
|
|
562
|
-
/**
|
|
563
|
-
* Remove a Path
|
|
564
|
-
*/
|
|
565
|
-
remove(path: string): this;
|
|
566
|
-
|
|
567
|
-
/**
|
|
568
|
-
* Get the List of Routes
|
|
569
|
-
*/
|
|
570
|
-
list(): string[];
|
|
571
|
-
|
|
572
|
-
/**
|
|
573
|
-
* The `format` method transforms a string to a valid path.
|
|
574
|
-
*/
|
|
575
|
-
format(path: string): string;
|
|
576
|
-
}
|
|
577
|
-
namespace Router {
|
|
578
|
-
interface Data {
|
|
579
|
-
data: string | Buffer | Callback;
|
|
580
|
-
modified: boolean;
|
|
581
|
-
}
|
|
582
|
-
|
|
583
|
-
interface RouteStream extends Stream.Readable {
|
|
584
|
-
readonly modified: boolean;
|
|
585
|
-
}
|
|
586
|
-
|
|
587
|
-
type Callback = ((err: any, result: string) => void) | (() => Promise<string>);
|
|
588
|
-
}
|
|
589
|
-
|
|
590
|
-
interface Scaffold {
|
|
591
|
-
/**
|
|
592
|
-
* Get a Scaffold
|
|
593
|
-
*/
|
|
594
|
-
get(name: string, fn?: (err: any, result: string) => void): Promise<string>;
|
|
595
|
-
/**
|
|
596
|
-
* Set a Scaffold
|
|
597
|
-
*/
|
|
598
|
-
set(name: string, content: string, fn?: (err: any) => void): Promise<void>;
|
|
599
|
-
/**
|
|
600
|
-
* Remove a Scaffold
|
|
601
|
-
*/
|
|
602
|
-
remove(name: string, fn?: (err: any) => void): Promise<void>;
|
|
603
|
-
}
|
|
604
|
-
|
|
605
|
-
interface Box extends EventEmitter {
|
|
606
|
-
/**
|
|
607
|
-
* Loads all files in the folder.
|
|
608
|
-
*/
|
|
609
|
-
process(fn: (err: any) => void): Promise<void>;
|
|
610
|
-
/**
|
|
611
|
-
* Loads all files in the folder and start watching for file changes.
|
|
612
|
-
*/
|
|
613
|
-
watch(fn?: (err: any) => void): Promise<void>;
|
|
614
|
-
/**
|
|
615
|
-
* Stop watching.
|
|
616
|
-
*/
|
|
617
|
-
unwatch(): void;
|
|
618
|
-
|
|
619
|
-
/**
|
|
620
|
-
* A processor is an essential element of `Box` and is used to process files.
|
|
621
|
-
* You can use path matching as described above to restrict what exactly the processor should process.
|
|
622
|
-
* Register a new processor with the `addProcessor` method.
|
|
623
|
-
*/
|
|
624
|
-
addProcessor(pattern: string | RegExp | util.Pattern<boolean>, fn: (file: Box.File) => void): void;
|
|
625
|
-
}
|
|
626
|
-
namespace Box {
|
|
627
|
-
interface File {
|
|
628
|
-
/**
|
|
629
|
-
* Full path of the file
|
|
630
|
-
*/
|
|
631
|
-
readonly source: string;
|
|
632
|
-
|
|
633
|
-
/**
|
|
634
|
-
* Relative path to the box of the file
|
|
635
|
-
*/
|
|
636
|
-
readonly path: string;
|
|
637
|
-
|
|
638
|
-
/**
|
|
639
|
-
* File type. The value can be `create` , `update` , `skip`, `delete` .
|
|
640
|
-
*/
|
|
641
|
-
readonly type: "create" | "update" | "skip" | "delete";
|
|
642
|
-
|
|
643
|
-
/**
|
|
644
|
-
* The information from path matching.
|
|
645
|
-
*/
|
|
646
|
-
readonly params: any;
|
|
647
|
-
|
|
648
|
-
/**
|
|
649
|
-
* Read a file
|
|
650
|
-
*/
|
|
651
|
-
read(
|
|
652
|
-
option?: {
|
|
653
|
-
encoding?: string | null | undefined;
|
|
654
|
-
flag?: string | undefined;
|
|
655
|
-
},
|
|
656
|
-
fn?: (err: any, result: string | Buffer) => void
|
|
657
|
-
): Promise<string | Buffer>;
|
|
658
|
-
read(fn?: (err: any, result: string | Buffer) => void): Promise<string | Buffer>;
|
|
659
|
-
|
|
660
|
-
/**
|
|
661
|
-
* Read a file synchronously
|
|
662
|
-
*/
|
|
663
|
-
readSync(option?: { encoding?: string | null | undefined; flag?: string | undefined }): string | Buffer;
|
|
664
|
-
|
|
665
|
-
/**
|
|
666
|
-
* Read the status of a file
|
|
667
|
-
*/
|
|
668
|
-
stat(fn?: (err: any, result: fs.Stats) => void): Promise<fs.Stats>;
|
|
669
|
-
|
|
670
|
-
/**
|
|
671
|
-
* Read the status of a file synchronously
|
|
672
|
-
*/
|
|
673
|
-
statSync(): fs.Stats;
|
|
674
|
-
|
|
675
|
-
/**
|
|
676
|
-
* Render a file
|
|
677
|
-
*/
|
|
678
|
-
render(fn?: (err: any, result: string) => void): Promise<string>;
|
|
679
|
-
render(option?: any, fn?: (err: any, result: string) => void): Promise<string>;
|
|
680
|
-
|
|
681
|
-
/**
|
|
682
|
-
* Render a file synchronously
|
|
683
|
-
*/
|
|
684
|
-
renderSync(option?: any): string;
|
|
685
|
-
}
|
|
686
|
-
}
|
|
687
|
-
|
|
688
|
-
interface Render {
|
|
689
|
-
render(data: Render.Data, option?: any, fn?: (err: any, result: string) => void): Promise<string>;
|
|
690
|
-
render(data: Render.Data, fn?: (err: any, result: string) => void): Promise<string>;
|
|
691
|
-
renderSync(data: Render.Data, option?: any): string;
|
|
692
|
-
|
|
693
|
-
/**
|
|
694
|
-
* Check whether a file is renderable synchronously.
|
|
695
|
-
*/
|
|
696
|
-
isRenderable(path: string): boolean;
|
|
697
|
-
|
|
698
|
-
/**
|
|
699
|
-
* Check whether a file is renderable.
|
|
700
|
-
*/
|
|
701
|
-
isRenderableSync(path: string): boolean;
|
|
702
|
-
|
|
703
|
-
/**
|
|
704
|
-
* Get the Output Extension
|
|
705
|
-
*/
|
|
706
|
-
getOutput(path: string): string;
|
|
707
|
-
}
|
|
708
|
-
namespace Render {
|
|
709
|
-
interface Data {
|
|
710
|
-
text?: string | undefined;
|
|
711
|
-
engine?: string | undefined;
|
|
712
|
-
path?: string | undefined;
|
|
713
|
-
}
|
|
714
|
-
}
|
|
715
|
-
|
|
716
|
-
interface Post {
|
|
717
|
-
/**
|
|
718
|
-
* Create a Post
|
|
719
|
-
*/
|
|
720
|
-
create(data: Post.Data, replace?: boolean, fn?: (err: any) => void): Promise<void>;
|
|
721
|
-
create(data: Post.Data, fn?: (err: any) => void): Promise<void>;
|
|
722
|
-
|
|
723
|
-
/**
|
|
724
|
-
* Publish a Draft
|
|
725
|
-
*/
|
|
726
|
-
publish(data: Post.Data, replace?: boolean, fn?: (err: any) => void): Promise<void>;
|
|
727
|
-
publish(data: Post.Data, fn?: (err: any) => void): Promise<void>;
|
|
728
|
-
|
|
729
|
-
render(source: string | null | undefined, data: Post.RenderData, fn: (err: any) => void): Promise<void>;
|
|
730
|
-
}
|
|
731
|
-
namespace Post {
|
|
732
|
-
interface Data {
|
|
733
|
-
title?: string | undefined;
|
|
734
|
-
slug?: string | undefined;
|
|
735
|
-
layout?: string | undefined;
|
|
736
|
-
path?: string | undefined;
|
|
737
|
-
date?: moment.MomentInput | undefined;
|
|
738
|
-
}
|
|
739
|
-
interface RenderData {
|
|
740
|
-
engine?: string | undefined;
|
|
741
|
-
content?: string | undefined;
|
|
742
|
-
}
|
|
743
|
-
}
|
|
744
|
-
|
|
745
|
-
interface Theme extends Box {
|
|
746
|
-
config: HexoConfig;
|
|
747
|
-
|
|
748
|
-
/**
|
|
749
|
-
* Get a View
|
|
750
|
-
*/
|
|
751
|
-
getView(path: string): View | undefined;
|
|
752
|
-
|
|
753
|
-
/**
|
|
754
|
-
* Set a View
|
|
755
|
-
*/
|
|
756
|
-
setView(path: string, data: any): void;
|
|
757
|
-
|
|
758
|
-
/**
|
|
759
|
-
* Remove a View
|
|
760
|
-
*/
|
|
761
|
-
removeView(path: string): void;
|
|
762
|
-
}
|
|
763
|
-
|
|
764
|
-
interface View {
|
|
765
|
-
readonly path: string;
|
|
766
|
-
readonly source: string;
|
|
767
|
-
|
|
768
|
-
/**
|
|
769
|
-
* Remove a View
|
|
770
|
-
*/
|
|
771
|
-
render(options?: any, fn?: (err: any, result: string) => void): Promise<string>;
|
|
772
|
-
render(fn: (err: any, result: string) => void): Promise<any>;
|
|
773
|
-
|
|
774
|
-
/**
|
|
775
|
-
* Remove a View synchronously.
|
|
776
|
-
*/
|
|
777
|
-
renderSync(options?: any): string;
|
|
778
|
-
}
|
|
779
|
-
}
|
|
780
|
-
/**
|
|
781
|
-
* Aliasing
|
|
782
|
-
*/
|
|
783
|
-
export type PageDataOfficial =
|
|
784
|
-
| Hexo.Locals.Post
|
|
785
|
-
| Hexo.Locals.Page
|
|
786
|
-
| Hexo.Locals.Category
|
|
787
|
-
| Hexo.Locals.Tag
|
|
788
|
-
| IndexPage
|
|
789
|
-
| ArchivePage
|
|
790
|
-
| CategoryPage
|
|
791
|
-
| TagPage;
|
|
792
|
-
/**
|
|
793
|
-
* Aliasing
|
|
794
|
-
* * IndexPage, ArchivePage, CategoryPage, TagPage
|
|
795
|
-
*/
|
|
796
|
-
export interface PageData extends Hexo.Locals.Post, Hexo.Locals.Page, Hexo.Locals.Category, Hexo.Locals.Tag {
|
|
797
|
-
[key: string]: any;
|
|
798
|
-
}
|
|
799
|
-
|
|
800
|
-
export interface TemplateLocals {
|
|
801
|
-
/**
|
|
802
|
-
* Underscore object
|
|
803
|
-
*/
|
|
804
|
-
_: underscore.UnderscoreStatic;
|
|
805
|
-
page: PageData;
|
|
806
|
-
path: string;
|
|
807
|
-
url: string;
|
|
808
|
-
|
|
809
|
-
/**
|
|
810
|
-
* Site settings in `_config.yml`
|
|
811
|
-
*/
|
|
812
|
-
config: HexoConfig;
|
|
813
|
-
theme: HexoConfig;
|
|
814
|
-
env: Hexo["env"];
|
|
815
|
-
layout: string;
|
|
816
|
-
view_dir: string;
|
|
817
|
-
site: any;
|
|
818
|
-
}
|
|
819
|
-
|
|
820
|
-
interface IndexPage {
|
|
821
|
-
per_page?: number | undefined;
|
|
822
|
-
total?: number | undefined;
|
|
823
|
-
current?: number | undefined;
|
|
824
|
-
current_url?: string | undefined;
|
|
825
|
-
posts?: Record<string, unknown> | undefined;
|
|
826
|
-
prev?: number | undefined;
|
|
827
|
-
prev_link?: string | undefined;
|
|
828
|
-
next?: number | undefined;
|
|
829
|
-
next_link?: string | undefined;
|
|
830
|
-
path?: string | undefined;
|
|
831
|
-
}
|
|
832
|
-
|
|
833
|
-
interface ArchivePage extends IndexPage {
|
|
834
|
-
archive?: boolean | undefined;
|
|
835
|
-
year?: number | undefined;
|
|
836
|
-
month?: number | undefined;
|
|
837
|
-
}
|
|
838
|
-
|
|
839
|
-
interface CategoryPage extends IndexPage {
|
|
840
|
-
category: string;
|
|
841
|
-
}
|
|
842
|
-
|
|
843
|
-
interface TagPage extends IndexPage {
|
|
844
|
-
tag: string;
|
|
845
|
-
}
|
|
846
|
-
|
|
847
|
-
export = Hexo;
|
|
848
|
-
export default Hexo;
|
|
849
|
-
module.exports = Hexo;
|