@@ -197,6 +197,18 @@ export default {
197197 .filter (Boolean )
198198 .map ((text , i ) => ({ ' @type' : ' HowToStep' , position: i + 1 , text }))
199199 : [];
200+ const drinkKeywords = Array .isArray (this .drink .keywords )
201+ ? this .drink .keywords .map (k => k .toLowerCase ())
202+ : [];
203+ const getRecipeCategory = () => {
204+ if (drinkKeywords .includes (' alcoholic' )) return ' Cocktail' ;
205+ if (drinkKeywords .includes (' smoothie' )) return ' Smoothie' ;
206+ if (drinkKeywords .includes (' coffee' )) return ' Coffee Drink' ;
207+ if (drinkKeywords .includes (' tea' )) return ' Tea' ;
208+ if (drinkKeywords .includes (' juice' )) return ' Juice' ;
209+ return ' Drink' ;
210+ };
211+ const imageUrl = this .drink .img ? ` https://opendrinks.io${ this .drink .img } ` : undefined ;
200212 return {
201213 title: metaTitle,
202214 titleTemplate : title => ` ${ title} | Open Drinks` ,
@@ -208,11 +220,11 @@ export default {
208220 { property: ' og:site_name' , content: ' Open Drinks' },
209221 { property: ' og:url' , content: ` https://opendrinks.io${ window .location .pathname } ` },
210222 { property: ' og:description' , content: metaDescription },
211- { property: ' og:image' , content: ` https://opendrinks.io ${ this . drink . img } ` },
223+ { property: ' og:image' , content: imageUrl },
212224 { property: ' og:image:alt' , content: this .drink .name },
213225 { itemprop: ' name' , content: this .drink .name },
214226 { itemprop: ' description' , content: metaDescription },
215- { itemprop: ' image' , content: ` https://opendrinks.io ${ this . drink . img } ` },
227+ { itemprop: ' image' , content: imageUrl },
216228 ],
217229 script: [
218230 {
@@ -223,9 +235,10 @@ export default {
223235 name: this .drink .name ,
224236 url: ` https://opendrinks.io${ window .location .pathname } ` ,
225237 description: metaDescription,
226- image: ` https://opendrinks.io ${ this . drink . img } ` ,
238+ image: imageUrl ? [imageUrl] : undefined ,
227239 recipeIngredient,
228240 recipeInstructions,
241+ recipeCategory: getRecipeCategory (),
229242 keywords: Array .isArray (this .drink .keywords )
230243 ? this .drink .keywords .join (' , ' )
231244 : undefined ,
0 commit comments