diff --git a/server/app.js b/server/app.js index 98e2c778c..2438aeea0 100644 --- a/server/app.js +++ b/server/app.js @@ -21,7 +21,7 @@ const splitTextStyleAndMetadata = (brew)=>{ const index = brew.text.indexOf('```\n\n'); const metadataSection = brew.text.slice(12, index - 1); const metadata = yaml.load(metadataSection); - Object.assign(brew, _.pick(metadata, ['title', 'description', 'tags', 'systems', 'renderer', 'theme'])); + Object.assign(brew, _.pick(metadata, ['title', 'description', 'tags', 'systems', 'renderer', 'theme', 'lang'])); brew.text = brew.text.slice(index + 5); } if(brew.text.startsWith('```css')) { @@ -173,6 +173,7 @@ app.get('/user/:username', async (req, res, next)=>{ 'pageCount', 'description', 'authors', + 'lang', 'published', 'views', 'shareId', diff --git a/server/googleActions.js b/server/googleActions.js index 7b86a34c1..925dfc226 100644 --- a/server/googleActions.js +++ b/server/googleActions.js @@ -126,6 +126,7 @@ const GoogleActions = { views : parseInt(file.properties.views), published : file.properties.published ? file.properties.published == 'true' : false, systems : [], + lang : file.properties.lang, thumbnail : file.properties.thumbnail }; }); @@ -255,6 +256,7 @@ const GoogleActions = { tags : obj.data.properties.tags ? obj.data.properties.tags : '', systems : obj.data.properties.systems ? obj.data.properties.systems.split(',') : [], authors : [], + lang : obj.data.properties.lang, published : obj.data.properties.published ? obj.data.properties.published == 'true' : false, trashed : obj.data.trashed, diff --git a/server/homebrew.api.js b/server/homebrew.api.js index 8210fbb65..b0f8c2454 100644 --- a/server/homebrew.api.js +++ b/server/homebrew.api.js @@ -80,7 +80,7 @@ const mergeBrewText = (brew)=>{ `\`\`\`\n\n` + `${text}`; } - const metadata = _.pick(brew, ['title', 'description', 'tags', 'systems', 'renderer', 'theme']); + const metadata = _.pick(brew, ['title', 'description', 'tags', 'systems', 'renderer', 'theme', 'lang']); text = `\`\`\`metadata\n` + `${yaml.dump(metadata)}\n` + `\`\`\`\n\n` + diff --git a/server/homebrew.model.js b/server/homebrew.model.js index a514e3fd8..b44f1dec9 100644 --- a/server/homebrew.model.js +++ b/server/homebrew.model.js @@ -15,6 +15,7 @@ const HomebrewSchema = mongoose.Schema({ description : { type: String, default: '' }, tags : [String], systems : [String], + lang : { type: String, default: 'en' }, renderer : { type: String, default: '' }, authors : [String], published : { type: Boolean, default: false },