feat(lessons/{2,3,5,6,7}): eleventy@v3 & ESM#16
Conversation
… configuration to package.json to treat all .js files as ESM. Added extra information to accompany these changes.
|
Pushed update for Lesson3 using ESM syntax to configure Eleventy to use Nunjucks. Fixed typo back in Lesson2 (meant line 39, not 24). |
|
I forgot to bring up for Lesson3, I was taking a look through the docs, I don't see anything recent on this configuration anywhere: I'm potentially thinking about omitting this. It hasn't broken the site my end at least removing it. |
|
I don't even see it in the source code! Good call. |
Added start script as suggested by the tip Co-authored-by: uncenter <47499684+uncenter@users.noreply.github.com>
Removed properties that aren't needed to function Co-authored-by: uncenter <47499684+uncenter@users.noreply.github.com>
Removed more properties not needed for functionality Co-authored-by: uncenter <47499684+uncenter@users.noreply.github.com>
Co-authored-by: uncenter <47499684+uncenter@users.noreply.github.com>
Information not relevant to project Co-authored-by: uncenter <47499684+uncenter@users.noreply.github.com>
Co-authored-by: uncenter <47499684+uncenter@users.noreply.github.com>
…n 2.md Co-authored-by: uncenter <47499684+uncenter@users.noreply.github.com>
Information provided not relevant to the project and should stick to the preferred implementation. Co-authored-by: uncenter <47499684+uncenter@users.noreply.github.com>
Co-authored-by: uncenter <47499684+uncenter@users.noreply.github.com>
…n as it does nothing
|
Changes done up to Lesson7, Lesson4 and 6 needed no updates. |
|
Just a question looking at Lesson8 and possibly for future lessons, pretty much they create a collection, then go into refactoring by creating the utility |
|
I think we can reorder it so after creating the first collection, and mentioning that we want to create another, we create the utility, update the first collection, and then use the new utility in the second collection from the get-go. We can also avoid using a src/utils folder and probably just define a new local function in the .eleventy.js file, outside of the exported config function. |
…s only used there to create collections and it is also a relatively short function. Removed steps to create utils folder as it is no longer needed. Updated collection creation syntax.
|
Updated Lesson8 with suggested changes. |
2.md
Outdated
| "version": "1.0.0", | ||
| "description": "", | ||
| "main": ".eleventy.js", | ||
| "main": "eleventy.config.js", |
There was a problem hiding this comment.
I actually don't think this is necessary for anything since I believe main only applies for published packages? Or how does this affect the project to your knowledge?
| config.addPassthroughCopy('./src/images/'); | ||
| eleventyConfig.addPassthroughCopy('src/images'); | ||
| ``` | ||
|
|
There was a problem hiding this comment.
I think we should add another "Your eleventy.config.js file should now look like this:" line here for clarity. (I'm planning to eventually refactor that kind of thing into "diff" views with https://shiki.style/packages/transformers#transformernotationdiff but for now this is good.)
|
Sorry for the length delay and lengthy review. Please let me know if you'd like to continue working on this pull request or not, if not (totally fine, I understand!) I'll merge this into a working branch (https://github.com/uncenter/learn-eleventy/tree/dev) and try to get this ESM refactor done there. |
|
Going to merge this with my fixes into the |
Lesson 2 got a number of updates:
-Config file name:
.eleventy.js->eleventy.config.js-Eleventy's behaviour is now configured through Eleventy's configuration API
-
package.jsonupdates-
package.jsonadditional configuration added to treat all.jsfiles as ES Modules (saves us needing to format.jsfiles as.mjs.-More informative info boxes and tips to support changes.
Couple of changes but I'm expecting it to go downhill from here for the rest of the lessons. I also just realised a small typo at line 24.
Lesson1 needed no updates.