0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2026-01-03 10:32:39 +00:00

Move Snippets store to metadata block.

Note this still stores the snippets as a string for the passed about brew object.
This commit is contained in:
David Bolack
2025-04-07 23:22:47 -05:00
parent 8e8f520eaa
commit d0c3765f8f
2 changed files with 2 additions and 11 deletions

View File

@@ -170,12 +170,6 @@ const api = {
mergeBrewText : (brew)=>{
let text = brew.text;
if(brew.snippets !== undefined) {
text = `\`\`\`snippets\n` +
`${yaml.dump(brewSnippetsToJSON('brew_snippets', brew.snippets, null, false))}` +
`\`\`\`\n\n` +
`${text}`;
}
if(brew.style !== undefined) {
text = `\`\`\`css\n` +
`${brew.style || ''}\n` +
@@ -183,6 +177,7 @@ const api = {
`${text}`;
}
const metadata = _.pick(brew, ['title', 'description', 'tags', 'systems', 'renderer', 'theme']);
metadata.snippets = brewSnippetsToJSON('brew_snippets', brew.snippets, null, false);
text = `\`\`\`metadata\n` +
`${yaml.dump(metadata)}\n` +
`\`\`\`\n\n` +