0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2026-01-06 12:12:42 +00:00

more renaming engine to renderer

This commit is contained in:
Trevor Buckner
2024-07-13 18:08:00 -04:00
parent e222811d03
commit 591cae0e8f

View File

@@ -259,13 +259,13 @@ const api = {
Important parameter members: Important parameter members:
req.params.id: This is the shareId ( User theme ) or name ( static theme ) req.params.id: This is the shareId ( User theme ) or name ( static theme )
loaded first. loaded first.
req.params.engine: This is the Markdown+ version for the static theme. If a req.params.renderer: This is the Markdown+ version for the static theme. If a
User theme the value will come from the User Theme metadata. User theme the value will come from the User Theme metadata.
*/ */
let parentReq = {}; let parentReq = {};
const completeStyles = []; const completeStyles = [];
const completeSnippets = []; const completeSnippets = [];
if(!req.params.engine) { if(!req.params.renderer) {
// If this is not set, our *first* theme is a User theme. // If this is not set, our *first* theme is a User theme.
const finalChildBrew = req.brew; const finalChildBrew = req.brew;
// Break up the frontmatter // Break up the frontmatter
@@ -307,7 +307,7 @@ const api = {
id : req.params.id, id : req.params.id,
// This is the name of the theme // This is the name of the theme
}, },
renderer : req.params.engine renderer : req.params.renderer
// The renderer is needed for the static pathing. // The renderer is needed for the static pathing.
}; };
} }
@@ -348,16 +348,16 @@ const api = {
}, },
//Return CSS for a static theme, with @include endpoint for its parent theme if any //Return CSS for a static theme, with @include endpoint for its parent theme if any
getStaticThemeCSS : async(req, res)=>{ getStaticThemeCSS : async(req, res)=>{
if(!isStaticTheme(req.params.engine, req.params.id)) if(!isStaticTheme(req.params.renderer, req.params.id))
res.status(404).send(`Invalid Theme - Renderer: ${req.params.engine}, Name: ${req.params.id}`); res.status(404).send(`Invalid Theme - Renderer: ${req.params.renderer}, Name: ${req.params.id}`);
else { else {
res.setHeader('Content-Type', 'text/css'); res.setHeader('Content-Type', 'text/css');
res.setHeader('Cache-Control', 'public, max-age: 43200, must-revalidate'); res.setHeader('Cache-Control', 'public, max-age: 43200, must-revalidate');
const themeParent = Themes[req.params.engine][req.params.id].baseTheme; const themeParent = Themes[req.params.renderer][req.params.id].baseTheme;
console.log(`getStaticThemeCSS for ${req.params.id}`); console.log(`getStaticThemeCSS for ${req.params.id}`);
console.log(`and parentThemeImport for ${themeParent}`); console.log(`and parentThemeImport for ${themeParent}`);
const parentThemeImport = themeParent ? `@import url(\"/css/${req.params.engine}/${themeParent}\");\n/* Static Theme ${Themes[req.params.engine][themeParent].name} */\n` : ''; const parentThemeImport = themeParent ? `@import url(\"/css/${req.params.renderer}/${themeParent}\");\n/* Static Theme ${Themes[req.params.renderer][themeParent].name} */\n` : '';
return res.status(200).send(`${parentThemeImport}@import url(\"/themes/${req.params.engine}/${req.params.id}/style.css\");\n/* Static Theme ${Themes[req.params.engine][req.params.id].name} */\n`); return res.status(200).send(`${parentThemeImport}@import url(\"/themes/${req.params.renderer}/${req.params.id}/style.css\");\n/* Static Theme ${Themes[req.params.renderer][req.params.id].name} */\n`);
} }
}, },
updateBrew : async (req, res)=>{ updateBrew : async (req, res)=>{