-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
From CommonJS to ESM, while also using SWC with Jest in unit tests
- Loading branch information
Showing
9 changed files
with
450 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,52 @@ | ||
/** @param {import("@11ty/eleventy").UserConfig} eleventyConfig */ | ||
module.exports = function(eleventyConfig) { | ||
/*************** | ||
* NAGINATA.fi * | ||
*************** | ||
* Juga Paazmaya <paazmaya@yahoo.com> | ||
* License: Attribution-ShareAlike 4.0 Unported | ||
* http://creativecommons.org/licenses/by-sa/4.0/ | ||
*/ | ||
import facebook from './lib/facebook-meta'; | ||
import flickrImageList from './lib/flickr-image-list'; | ||
|
||
eleventyConfig.addPassthroughCopy({"src/img": "img"}); | ||
eleventyConfig.addPassthroughCopy({"src/icons": "icons"}); | ||
eleventyConfig.addPassthroughCopy({"assets": "/"}); | ||
/** @param {import("@11ty/eleventy").UserConfig} eleventyConfig */ | ||
export default function(eleventyConfig) { | ||
|
||
const facebook = require("./lib/facebook-meta"); | ||
eleventyConfig.addGlobalData("facebook", facebook()); | ||
eleventyConfig.addPassthroughCopy({ | ||
'src/img': 'img' | ||
}); | ||
eleventyConfig.addPassthroughCopy({ | ||
'src/icons': 'icons' | ||
}); | ||
eleventyConfig.addPassthroughCopy({ | ||
assets: '/' | ||
}); | ||
|
||
const flickrImageList = require("./lib/flickr-image-list"); | ||
eleventyConfig.addGlobalData("prefetch", flickrImageList()); | ||
eleventyConfig.addGlobalData('facebook', facebook()); | ||
eleventyConfig.addGlobalData('prefetch', flickrImageList()); | ||
|
||
// Create language specific collections, to reduce complexity in templates | ||
eleventyConfig.addCollection("en", function(api) { | ||
eleventyConfig.addCollection('en', function(api) { | ||
return api.getFilteredByGlob('*/en/*.md'); | ||
}); | ||
eleventyConfig.addCollection("fi", function(api) { | ||
eleventyConfig.addCollection('fi', function(api) { | ||
return api.getFilteredByGlob('*/fi/*.md'); | ||
}); | ||
eleventyConfig.addCollection("ja", function(api) { | ||
eleventyConfig.addCollection('ja', function(api) { | ||
return api.getFilteredByGlob('*/ja/*.md'); | ||
}); | ||
|
||
return { | ||
dir: { | ||
|
||
input: "content", | ||
includes: "../views", // relative to dir.input | ||
input: 'content', | ||
includes: '../views', // relative to dir.input | ||
|
||
output: "dist" | ||
output: 'dist' | ||
}, | ||
data: { | ||
layout: "index.html", | ||
layout: 'index.html' | ||
}, | ||
markdownTemplateEngine: "njk", | ||
htmlTemplateEngine: "njk" | ||
} | ||
}; | ||
markdownTemplateEngine: 'njk', | ||
htmlTemplateEngine: 'njk' | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.