eleventy icon indicating copy to clipboard operation
eleventy copied to clipboard

`.markdown` files not processed from custom extension alias (v3.0.0-alpha.11 and above)

Open paulrobertlloyd opened this issue 1 year ago • 14 comments

Operating system

macOS Sonoma 14.5

Eleventy

v3.0.0-alpha.11+

Describe the bug

Using any version of v3.0.0-alpha after alpha.10 results in 80% of files no longer being written to disk:

  • Copied 2046 files / Wrote 2647 files in 8.08 seconds (3.1ms each, v3.0.0-alpha.10)
  • Copied 2046 files / Wrote 556 files in 2.59 seconds (4.7ms each, v3.0.0-alpha.11)

I thought this might be an issue with incremental builds, but running eleventy without any flags gives the same result. 🤷🏼

Reproduction steps

  1. npm i
  2. npm start

Reproduction URL

https://github.com/paulrobertlloyd/paulrobertlloyd-v4

paulrobertlloyd avatar Jun 27 '24 20:06 paulrobertlloyd

(Am just seeing if I can update my build so that it works if the required env variables are not present…)

paulrobertlloyd avatar Jun 27 '24 20:06 paulrobertlloyd

Have updated my repo such that if the env variables are not present, the site will still build. Interestingly, even more files (~89%) do not get written in this case:

  • Copied 2046 files / Wrote 2318 files in 13.18 seconds (5.7ms each, v3.0.0-alpha.10)
  • Copied 2046 files / Wrote 227 files in 1.24 seconds (5.5ms each, v3.0.0-alpha.11)

paulrobertlloyd avatar Jun 27 '24 20:06 paulrobertlloyd

Investigating…

zachleat avatar Jun 27 '24 21:06 zachleat

This is almost certainly #3302

zachleat avatar Jun 27 '24 21:06 zachleat

I think it’ll be fixed with an addTemplateFormats in your configuration file:

eleventy.addTemplateFormats("markdown");
eleventy.addExtension("markdown", { key: "md" });

but I haven’t confirmed in your project yet (I’m seeing some other duplicate permalink issues that might be from missing environment variables)

zachleat avatar Jun 27 '24 21:06 zachleat

Ahhh, okay, that makes sense – something to add to the upgrade docs/plugin!

I’m getting the duplicate permalinks error now too, and that’s with the environment variables set. Will dig into it, but this wasn’t reported as an error before – might have this been silently erroring until this point?

paulrobertlloyd avatar Jun 27 '24 21:06 paulrobertlloyd

That might be a mistake—I did some changes in that code recently for https://github.com/11ty/eleventy/issues/3327 I might’ve missed something there. That was shipped in -alpha.14.

It doesn’t look like you were using htmlOutputSuffix but additional messaging was added to make sure output files don’t ovewrite input files—are you doing that on purpose?

zachleat avatar Jun 27 '24 21:06 zachleat

If it helps, I get DuplicatePermalinkOutputError in alpha.11.

paulrobertlloyd avatar Jun 27 '24 21:06 paulrobertlloyd

Oh! This is a bug related to #2780. Aliasing extensions should inherit their permalink processing options and it looks like this alias is just using raw permalinks without processing. Filed that one as #3339.

zachleat avatar Jun 27 '24 21:06 zachleat

Using the uncommon-but-Gruber-preferred .markdown extension has really thrown some spanners in the works, eh! 😬

paulrobertlloyd avatar Jun 27 '24 21:06 paulrobertlloyd

After fixing #3339, I see a new conflict that I’ll have to dive into tomorrow, nothing is jumping out at me yet:

[11ty] Output conflict: multiple input files are writing to `./www/2018/014/n1/index.html`. Use distinct `permalink` values to resolve this conflict.
[11ty]   1. ./src/content/notes/2018-01-15-1.markdown
[11ty]   2. ./src/content/notes/2018-01-14-1.markdown (via DuplicatePermalinkOutputError)

zachleat avatar Jun 27 '24 22:06 zachleat

That one may very well be time zone dependent; I’ll let you know once alpha.15 ships.

paulrobertlloyd avatar Jun 27 '24 22:06 paulrobertlloyd

oh—oh no! that’s probably it. Not sure the best way to fix that globally but the brand new https://github.com/11ty/eleventy/issues/867#issuecomment-2195653973 will probably give you an escape hatch, if you’re interested.

zachleat avatar Jun 27 '24 22:06 zachleat

Oooh, that might be just the ticket, thanks!

paulrobertlloyd avatar Jun 27 '24 22:06 paulrobertlloyd

https://github.com/11ty/eleventy/releases/tag/v3.0.0-alpha.15 is now available—going to consider this one resolved unless I hear otherwise, thank you!

zachleat avatar Jul 10 '24 17:07 zachleat