diff --git a/server/config.js b/server/config.js new file mode 100644 index 000000000..a11cf8bd2 --- /dev/null +++ b/server/config.js @@ -0,0 +1,17 @@ +module.exports = { + // Search and metadata + title: 'Imagine, Program, Share', + description: + 'Scratch is a free programming language and online community ' + + 'where you can create your own interactive stories, games, ' + + 'and animations.', + + // Open graph + og_image: 'https://scratch.mit.edu/images/og_image.jpg', + og_image_type: 'image/jpeg', + og_image_width: 986, + og_image_height: 860, + + // Analytics & Monitoring + ga_tracker: process.env.GA_TRACKER || '' +}; diff --git a/server/defaults.json b/server/defaults.json deleted file mode 100644 index 259a423a8..000000000 --- a/server/defaults.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "title": "Imagine, Program, Share", - "description": "Scratch is a free programming language and online community where you can create your own interactive stories, games, and animations." -} diff --git a/server/handler.js b/server/handler.js index cc3134385..f093625d8 100644 --- a/server/handler.js +++ b/server/handler.js @@ -4,12 +4,14 @@ var fs = require('fs'); var mustache = require('mustache'); var path = require('path'); +var config = require('./config'); + /** * Constructor */ function Handler (route) { // Route definition - defaults(route, require('./defaults.json')); + defaults(route, config); // Render template var location = path.resolve(__dirname, './template.html'); diff --git a/server/template.html b/server/template.html index 56e1fc6da..771e477cf 100644 --- a/server/template.html +++ b/server/template.html @@ -10,13 +10,19 @@