Refactoring
This commit is contained in:
parent
1e3833f7d0
commit
aa563e60ea
37 changed files with 472 additions and 2392 deletions
20
src/yaml.ts
Normal file
20
src/yaml.ts
Normal file
|
@ -0,0 +1,20 @@
|
|||
import yaml from 'js-yaml'
|
||||
import Renderer , {File} from "./renderer.js"
|
||||
import fs from 'fs'
|
||||
|
||||
export default class Yaml implements Renderer {
|
||||
name = "yml"
|
||||
|
||||
loadAsHTML(file: string): File {
|
||||
const fileContents = fs.readFileSync(file, 'utf8')
|
||||
|
||||
// let data = {...site.data}
|
||||
// delete data.layout
|
||||
// parseMarkdown(data)
|
||||
|
||||
return {
|
||||
data: yaml.load(fileContents) as { [key: string]: any },
|
||||
html: ""
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue