Commit 04f6265f authored by Isabella Skořepová's avatar Isabella Skořepová

Absolute path for OG

parent 1013b0a3
Pipeline #624 passed with stage
in 6 seconds
......@@ -7,6 +7,7 @@ var nunjucks = require('nunjucks');
var fs = require('fs');
var dateFilter = require('nunjucks-date-filter');
var util = require('util');
var url = require('url')
var config = require('./config');
console.log('watch: '+config.watch);
......@@ -50,6 +51,10 @@ env.addFilter('relURL', function(filename, dir){
return dir+'/'+filename;
})
env.addFilter('absURL', function(rel, base){
return url.resolve(base, rel)
})
var formats = {};
module.exports = function(data, type, config) {
......
......@@ -4,7 +4,7 @@
<meta property="og:type" content="article" />
<meta property="article:published_time" content="{{ metadata.date.creation }}" />
<meta property="og:image" content="{{ metadata.image }}" />
{% if metadata.image %} <meta property="og:image" content="{{ metadata.image | absURL( canonicalURL ) }}" /> {% endif %}
<meta property="og:description" content="{% if metadata.perex %}{{metadata.perex}}{% else %}{% if metadata.perex_e %}{{metadata.perex_e | truncate}}{% else %}{% if content %}{{ content | striptags | truncate }}{% endif %}{% endif %}{% endif %}" />
{{ super() }}
......
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