20 lines
No EOL
462 B
TypeScript
20 lines
No EOL
462 B
TypeScript
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: ""
|
|
}
|
|
}
|
|
} |