File tree Expand file tree Collapse file tree 3 files changed +11
-1
lines changed
Expand file tree Collapse file tree 3 files changed +11
-1
lines changed Original file line number Diff line number Diff line change 11const lodashGet = require ( "lodash/get" ) ;
22const yaml = require ( "js-yaml" ) ;
3+ const { URL } = require ( "url" ) ;
34
45module . exports = function ( eleventyConfig ) {
56 // Support yaml data files
@@ -38,6 +39,10 @@ module.exports = function (eleventyConfig) {
3839 return md . render ( content ) ;
3940 } ) ;
4041
42+ eleventyConfig . addFilter ( 'absoluteUrl' , ( url , base ) => {
43+ return ( new URL ( url , base ) ) . toString ( ) || url
44+ } )
45+
4146
4247 eleventyConfig . addFilter ( 'convertFromEpoc' , ( time ) => {
4348 let date = new Date ( 0 ) ;
Original file line number Diff line number Diff line change 1+ module . exports = {
2+ lang : "en" ,
3+ url : process . env . URL || "http://localhost:8080" ,
4+ } ;
Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ ogimage: "/img/og/default-og-image.png"
55---
66
77<!doctype html>
8- <html lang =" en " >
8+ <html lang =" {{ meta.lang }} " >
99 <head >
1010 <meta charset =" utf-8" >
1111 <meta name =" viewport" content =" width=device-width, initial-scale=1.0" >
@@ -18,6 +18,7 @@ ogimage: "/img/og/default-og-image.png"
1818 <link rel =" apple-touch-icon" sizes =" 180x180" href =" /img/favicons/apple-touch-icon.png" >
1919 <link rel =" icon" type =" image/png" sizes =" 32x32" href =" /img/favicons/favicon-32x32.png" >
2020 <link rel =" icon" type =" image/png" sizes =" 16x16" href =" /img/favicons/favicon-16x16.png" >
21+ <link rel =" canonical" href =" {{ page.url | url | absoluteUrl(meta.url) }}" />
2122{%- for url in preconnect %}
2223 <link rel =" preconnect" href =" {{ url }}" >
2324{%- endfor %}
You can’t perform that action at this time.
0 commit comments