-
-
Notifications
You must be signed in to change notification settings - Fork 633
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
.editorconfig's use of tabs instead of spaces causes eleventyNavigation to fail #171
Comments
Another example from this repo, changed spaces to tabs in the frontmatter of
Error:
Sadly I don't think .editorconf spec and implementations support mixing spaces and tabs in the same file type based on further rules? |
@fapdash yes, easy fix! But I don't understand why it was switched to tabs... seems like it breaks stuff with no upside other than maybe somebody's personal preference? |
@jayjansheski zachleat shared this link back then when the change happened: https://adamtuttle.codes/blog/2021/tabs-vs-spaces-its-an-accessibility-issue/, see e6dc55c#commitcomment-99554645 |
@fapdash I think that's a fine argument (the argument is that tabs allow people to choose their own indentation width) but if tabs break the build, it seems like an odd change to make. For anyone using an editor that respects |
This wasted multiple hours of my time. New to Eleventy, I could not figure out why even copy-pasted examples of On the whole, this is very surprising behaviour. One might hope that modern editors would be aware of YAML front matter and how its formatting rules might contradict those defined in To my mind, there are four options here:
Option 1 is undesirable, as the accessibility argument seems reasonable, so defaulting the template repo to use tabs where appropriate is fair. Option 2 is straight forward but falls short; people who learn by diving in instead of first reading documentation will still have their finite lives wasted as they clone the samples in this repo and hit this problem (cf. non-western language users repeatedly having problems with the default Eleventy Option 3 requires work to implement and still has shortcomings; people will only learn about the problem when running a build, increasing cycle time. Also, unless this error explicitly signposts Option 4 is easy and keeps to the principle of least surprise; only people who go on to explicitly create their own Ideally, options 2, 3, and 4 would all be applied to provide complete coverage for this situation. However, in the short term, option 4 would resolve this gotcha for the majority of people starting out with this template repo, with Option 2 being a possible fast follow to help anyone using a version of this repo pre-Option 4. |
Marginally related to 11ty/eleventy#2126 which has better error messaging for tabs in YAML front matter. Additionally, we’ll mitigate some of this by swapping to I’m also open to removing |
Eleventy Base Blog v9 has shipped |
Thanks for the update! Option 3 definitely seems to be ticked by 11ty/eleventy#2126 Regarding option 4, if YAML is the defacto standard for frontmatter, perhaps it might be best to go ahead with removing The mitigation applied in 1ad494c likely wouldn't assist people migrating content in from other systems that use YAML frontmatter, and they may well run into this issue as they update their existing YAML frontmatter if their editor obeys Even with 11ty/eleventy#2126 catching the issue at build time, they would have to constantly fight their editor inserting tabs in the YAML, and avoiding this issue entirely by removing |
First, thanks for 11ty!
Here's an issue I'm seeing:
.editorconfig
was changed to use tabs instead of spaces, but that seems to causeeleventyNavigation
to fail. (Tabs are forbidden in YAML.)Here's how the issue can be reproduced:
git clone https://github.com/11ty/eleventy-base-blog.git
cd eleventy-base-blog
npm install
books/index.md
parallel toabout/index.md
about/index.md
tobooks/index.md
, changingkey
toBooks
andorder
to4
. Optionally, change the markdown content. I'm using VSCode on macOS.npm start
and visit the site atlocalhost:8080
; noticeBooks
doesn't show up in the menu.Change the tabs before
key
andorder
to spaces and it'll work fine.The text was updated successfully, but these errors were encountered: