Make protocol dynamic for opengraph tags

parent d46e0dc2
Pipeline #1455 passed with stage
in 36 seconds
...@@ -150,7 +150,8 @@ app.get('/generate.png', function (req, res) { ...@@ -150,7 +150,8 @@ app.get('/generate.png', function (req, res) {
}); });
app.get('/', function(req, res) { app.get('/', function(req, res) {
res.render('index', {host: req.headers.host, res.render('index', {protocol: req.protocol,
host: req.headers.host,
imageParams: req._parsedUrl.query, imageParams: req._parsedUrl.query,
subdir: config.subdir}); subdir: config.subdir});
}) })
......
...@@ -6,8 +6,8 @@ ...@@ -6,8 +6,8 @@
<meta name="twitter:card" content="summary_large_image" /> <meta name="twitter:card" content="summary_large_image" />
<meta property="og:title" content="Soutenez La Quadrature du Net !" /> <meta property="og:title" content="Soutenez La Quadrature du Net !" />
<meta property="og:description" content="Soutenez La Quadrature du Net !" /> <meta property="og:description" content="Soutenez La Quadrature du Net !" />
<meta property="og:url" content="http://<%= host %>/<%= subdir %>?<%= imageParams %>" /> <meta property="og:url" content="<%= protocol %>://<%= host %>/<%= subdir %>?<%= imageParams %>" />
<meta property="og:image" content="http://<%= host %>/<%= subdir %>/generate.png?<%= imageParams %>" /> <meta property="og:image" content="<%= protocol %>://<%= host %>/<%= subdir %>/generate.png?<%= imageParams %>" />
<meta property="og:image:width" content="600" /> <meta property="og:image:width" content="600" />
<meta property="og:image:height" content="413" /> <meta property="og:image:height" content="413" />
<meta property="og:type" content="website" /> <meta property="og:type" content="website" />
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment