Verified Commit f12cfe3a authored by Thibaut Broggi's avatar Thibaut Broggi
Browse files

Get correct opengraph image

	Fix URLs writing
parent 9f01135e
Pipeline #1357 passed with stage
in 53 seconds
......@@ -107,7 +107,7 @@ app.get('/generate.png', function (req, res) {
});
app.get('/', function(req, res) {
res.render('index', {host: req.headers.host});
res.render('index', {host: req.headers.host, imageParams: req._parsedUrl.query});
})
app.listen(process.env.PORT || config.port || 80);
......@@ -94,11 +94,12 @@ let draw = function() {
// Edit URL
history.replaceState('', '', window.location.pathname + '?'
+ encodeURIComponent('bg-color=' + bgColor
+ '&fg-color=' + fgColor
+ '&text=' + fillText
+ '&font=' + font
+ '&signature=' + signature)
+ 'bg-color=' + encodeURIComponent(bgColor)
+ '&fg-color=' + encodeURIComponent(fgColor)
+ '&text=' + encodeURIComponent(fillText)
+ '&font=' + encodeURIComponent(font)
+ '&icon=' + encodeURIComponent(icon)
+ '&signature=' + encodeURIComponent(signature)
+ window.location.hash);
}
......
......@@ -6,7 +6,7 @@
<meta property="og:title" content="Soutenez La Quadrature du Net !" />
<meta property="og:description" content="Soutenez La Quadrature du Net !" />
<meta property="og:url" content="http://<%= host %>" />
<meta property="og:image" content="http://<%= host %>/generate.png" />
<meta property="og:image" content="http://<%= host %>/generate.png?<%= imageParams %>" />
<link rel="stylesheet" href="./bootstrap-grid.min.css" />
<link rel="stylesheet" href="./font-awesome.min.css" />
<link rel="stylesheet" href="./style.css" />
......
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