Improved title of pages

This commit is contained in:
Marcus Noble
2017-10-15 17:36:59 +01:00
parent bd38076041
commit 62d3f0ab14
2 changed files with 7 additions and 1 deletions

6
app.js
View File

@@ -39,6 +39,12 @@ Handlebars.registerHelper('moment', function(date, format) {
Handlebars.registerHelper("striptags", function(text){
return striptags(text);
});
Handlebars.registerHelper("buildTitle", function(title, siteTitle){
if (title.indexOf(siteTitle) < 0) {
title = `'${title}' by ${siteTitle}`;
}
return title;
});
Metalsmith(__dirname)