Add pug and html renderer. Implement hidden flag.

This commit is contained in:
Artur Gurgul 2025-08-14 07:29:40 +00:00
parent aa563e60ea
commit 3684688cdc
16 changed files with 119 additions and 33 deletions

19
src/renderer/html.ts Normal file
View file

@ -0,0 +1,19 @@
import Renderer , {File} from "../renderer.js"
import fs from 'fs'
import path from 'path'
import matter from 'gray-matter'
export default class Html implements Renderer {
name = "html"
fileExtensions = ["htm", "html"]
loadAsHTML(filePath: string): File {
const fileContents = fs.readFileSync(path.join("./", filePath), 'utf8')
const { data: metadata, content: htmlContent } = matter(fileContents)
return {
data: metadata,
html: htmlContent
}
}
}