feat: beautify HTML output Indent child templates according to the their place in the parent template, and likewise for rendered posts Needs refactoring
1 file changed, 5 insertions(+), 1 deletion(-)
changed files
M src/domain/posts.js → src/domain/posts.js
@@ -4,6 +4,7 @@ const fs = require('fs') const path = require('path') const matter = require('gray-matter') const markdown = require('../modules/markdown.js') +const { indentForTemplate, postIndentLevel } = require('../responders.js') const grayMatterOptions = { lang: 'toml',@@ -33,7 +34,10 @@ function get (filename) { const fileMatter = matter.read(filename, grayMatterOptions) fileMatter.basename = getTitle(fileMatter) delete fileMatter.orig - fileMatter.body = markdown(fileMatter.content) + fileMatter.body = indentForTemplate( + markdown(fileMatter.content), + postIndentLevel + ) return canonicaliseMetadata(fileMatter) }