renaming index.html to index.njk throws error in Eleventy

Viewed 30

I am working through the tutorial by Kevin Powell about Eleventy, "Turn static HTML/CSS into a blog with CMS using the JAMStack" https://www.youtube.com/watch?v=4wD00RT6d-g

At 18:40 into the video Kevin converts his index.html into an index.njk file. When I do that the build breaks and I get a TypeError "[11ty] TypeError: str.indexOf is not a function".

What is going wrong? Do I need to add something to my .eleventy.js config file?

Later in the video Kevin inserts a reverse filter into his for-post template – {%- for post in collections.post | reverse -%}

This is also not working. Could these two issues be related? How do I resolve these two issues?

My project prototype is here: https://github.com/cwebba1/eleventyone

0 Answers
Related