mirror of
https://github.com/muerwre/vk-tg-bot.git
synced 2025-04-24 22:46:41 +07:00
removed this.processor from template
This commit is contained in:
parent
d5228ef146
commit
436a931720
1 changed files with 2 additions and 3 deletions
|
@ -8,7 +8,6 @@ import toVFile from "to-vfile";
|
|||
import path from "path";
|
||||
|
||||
export class Template<T extends Record<string, any>> {
|
||||
private processor: Processor;
|
||||
public fields: T = {} as T;
|
||||
public template: string = "";
|
||||
|
||||
|
@ -18,14 +17,14 @@ export class Template<T extends Record<string, any>> {
|
|||
return;
|
||||
}
|
||||
|
||||
this.processor = unified()
|
||||
const processor = unified()
|
||||
.use(parser)
|
||||
.use(compiler)
|
||||
.use(frontmatter)
|
||||
.use(extract, { yaml: parse });
|
||||
|
||||
const file = toVFile.readSync(path.join(__dirname, "../../", filename));
|
||||
const result = this.processor.processSync(file);
|
||||
const result = processor.processSync(file);
|
||||
|
||||
this.fields = result.data as T;
|
||||
this.template = result
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue