all repos — archive/homestead @ 18eeadd14e4ab99f75167f1c97776b57e05bcb74

My future indieweb platform

feat: beautify HTML output Indent child templates according to the their place in the parent template, and likewise for rendered posts Needs refactoring

Alan Pearce
commit

18eeadd14e4ab99f75167f1c97776b57e05bcb74

parent

6f9b41464f25d12a24b2672dbf12b43c7df81dd2

1 file changed, 5 insertions(+), 1 deletion(-)

changed files
M src/domain/posts.jssrc/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) }