diff --git a/routes/show-routes.js b/routes/show-routes.js index ee080bf7..f8d2334d 100644 --- a/routes/show-routes.js +++ b/routes/show-routes.js @@ -79,7 +79,7 @@ module.exports = (app) => { } // serve the file or the show route postToStats('show', originalUrl, ip, fileInfo.name, fileInfo.claimId, 'success'); - res.status(200).render('show', { fileInfo }); + res.status(200).render('show', { layout: 'show', fileInfo }); }) .catch(error => { errorHandlers.handleRequestError('show', originalUrl, ip, error, res); @@ -97,7 +97,7 @@ module.exports = (app) => { } // serve the show route postToStats('show', originalUrl, ip, fileInfo.name, fileInfo.claimId, 'success'); - res.status(200).render('show', { fileInfo }); + res.status(200).render('show', { layout: 'show', fileInfo }); }) .catch(error => { errorHandlers.handleRequestError('show', originalUrl, ip, error, res); diff --git a/speech.js b/speech.js index 11390776..51854570 100644 --- a/speech.js +++ b/speech.js @@ -72,21 +72,15 @@ const hbs = expressHandlebars.create({ return options.inverse(this); } }, - grouped_each (every, context, options) { - let out = ''; - let subcontext = []; - let i; - if (context && context.length > 0) { - for (i = 0; i < context.length; i++) { - if (i > 0 && i % every === 0) { - out += options.fn(subcontext); - subcontext = []; - } - subcontext.push(context[i]); - } - out += options.fn(subcontext); - } - return out; + twitterCard (type) { + return new Handlebars.SafeString(` + + + + + + + `); }, }, }); diff --git a/views/layouts/main.handlebars b/views/layouts/main.handlebars index a3babda6..dc6c235c 100644 --- a/views/layouts/main.handlebars +++ b/views/layouts/main.handlebars @@ -7,6 +7,7 @@ Spee.ch + {{ twitterCard }} {{{ body }}} diff --git a/views/layouts/show.handlebars b/views/layouts/show.handlebars new file mode 100644 index 00000000..662242c0 --- /dev/null +++ b/views/layouts/show.handlebars @@ -0,0 +1,23 @@ + + + + + + + Spee.ch + + + + + + + + + + + + {{{ body }}} + + {{ googleAnalytics }} + + \ No newline at end of file