Add page title filter
I want the home page to use just `title` as the page title, but I want other pages to add the site name to the page title. This filter does that and spits out the final title.
This commit is contained in:
parent
960966dcc4
commit
e901a8360f
2 changed files with 27 additions and 18 deletions
|
|
@ -20,6 +20,13 @@ module.exports = function(eleventyConfig) {
|
|||
"node_modules/simpledotcss/simple.css": "css/simple.css",
|
||||
});
|
||||
|
||||
eleventyConfig.addFilter("buildPageTitle", function(title) {
|
||||
if (this.page.url === '/') {
|
||||
return title;
|
||||
} else {
|
||||
return title + ' ⇢ Devon.LoL 😆';
|
||||
}
|
||||
});
|
||||
eleventyConfig.addFilter("stringToDate", function(value) {
|
||||
return new Date(value);
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue