Improved title of pages
This commit is contained in:
parent
bd38076041
commit
62d3f0ab14
6
app.js
6
app.js
@ -39,6 +39,12 @@ Handlebars.registerHelper('moment', function(date, format) {
|
|||||||
Handlebars.registerHelper("striptags", function(text){
|
Handlebars.registerHelper("striptags", function(text){
|
||||||
return striptags(text);
|
return striptags(text);
|
||||||
});
|
});
|
||||||
|
Handlebars.registerHelper("buildTitle", function(title, siteTitle){
|
||||||
|
if (title.indexOf(siteTitle) < 0) {
|
||||||
|
title = `'${title}' by ${siteTitle}`;
|
||||||
|
}
|
||||||
|
return title;
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
Metalsmith(__dirname)
|
Metalsmith(__dirname)
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
|
|
||||||
<title>{{ site.title }}</title>
|
<title>{{ buildTitle title site.title }}</title>
|
||||||
|
|
||||||
<meta property="og:url" content="{{ site.url}}/{{ path }}"/>
|
<meta property="og:url" content="{{ site.url}}/{{ path }}"/>
|
||||||
<meta property="og:title" content="{{ title }}"/>
|
<meta property="og:title" content="{{ title }}"/>
|
||||||
|
Loading…
Reference in New Issue
Block a user