@@ -9,12 +9,20 @@ const { buildTagWall, getRecents, getRelated, buildTimestamps } = require('./src
99const addAsset = require ( './src/static/js/building/linking.js' ) ;
1010const { qka, quizButtons, quizQuestions } = require ( './src/static/js/building/quizzing.js' ) ;
1111const { buildVersionTag, buildKeywords } = require ( "./src/static/js/building/package.js" ) ;
12- const projectImages = require ( "./src/static/js/building/images .js" ) ;
12+ const { projectImages, getFeaturedProjects , getMainProjects , getOtherProjects } = require ( "./src/static/js/building/projects .js" ) ;
1313
1414module . exports = function ( eleventyConfig ) {
1515 eleventyConfig . addPlugin ( EleventyRenderPlugin ) ;
1616 eleventyConfig . addPlugin ( eleventyNavigationPlugin ) ;
1717
18+ eleventyConfig . addGlobalData ( "eleventyComputed" , {
19+ eleventyNavigation : {
20+ key : data => data . eleventyNavigation . key || data . page . fileSlug ,
21+ parent : data => data . eleventyNavigation . parent || data . page . parent ,
22+ title : data => data . eleventyNavigation . title || data . title ,
23+ }
24+ } ) ;
25+
1826 eleventyConfig . addPassthroughCopy ( "./src/static/js" ) ; // css is compiled by sass
1927 eleventyConfig . addPassthroughCopy ( "./assets" ) ;
2028 eleventyConfig . addPassthroughCopy ( "**.json" ) ;
@@ -59,6 +67,10 @@ module.exports = function (eleventyConfig) {
5967 return text . slice ( 0 , 160 ) + ( text . length > 160 ? "..." : "" ) ;
6068 } ) ;
6169
70+ eleventyConfig . addFilter ( "featuredProjects" , getFeaturedProjects ) ;
71+ eleventyConfig . addFilter ( "mainProjects" , getMainProjects ) ;
72+ eleventyConfig . addFilter ( "otherProjects" , getOtherProjects ) ;
73+
6274 eleventyConfig . setLibrary ( "njk" , new Nunjucks . Environment (
6375 new Nunjucks . FileSystemLoader ( "./" ) ,
6476 { lstripBlocks : true , trimBlocks : true }
0 commit comments