Use ejs as template engine

    Fix open graph tags
parent bbbbe803
Pipeline #1325 passed with stage
in 32 seconds
......@@ -13,6 +13,7 @@
"license": "GPL-3.0",
"dependencies": {
"canvas": "2.0.0-alpha.5",
"ejs": "^2.5.7",
"express": "^4.16.1"
}
}
......@@ -8,6 +8,7 @@ const app = express();
const config = require('./config.json');
app.set('x-powered-by', false);
app.set('view engine', 'ejs');
app.use(express.static('./static'));
// {name: filepath}
......@@ -106,7 +107,7 @@ app.get('/generate.png', function (req, res) {
});
app.get('/', function(req, res) {
res.sendfile('./static/index.html');
res.render('index', {host: req.headers.host});
})
app.listen(process.env.PORT || config.port || 80);
......@@ -4,9 +4,9 @@
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta property="og:title" content="Soutenez La Quadrature du Net !" />
<meta property="og:type" content="" />
<meta property="og:url" content="." />
<meta property="og:image" content="./generate.png" />
<meta property="og:type" content="Soutenez La Quadrature du Net !" />
<meta property="og:url" content="http://<%= host %>" />
<meta property="og:image" content="http://<%= host %>/generate.png" />
<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