Skip to content
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

IdAttributePlugin doesn't generate ids #3379

Closed
johannesrave opened this issue Jul 24, 2024 · 7 comments
Closed

IdAttributePlugin doesn't generate ids #3379

johannesrave opened this issue Jul 24, 2024 · 7 comments

Comments

@johannesrave
Copy link

johannesrave commented Jul 24, 2024

Operating system

Ubuntu 23.10

Eleventy

3.0.0-alpha.17

Describe the bug

being the good canary that i am, i am trying to use the new IdAttributePlugin introduced in 3.0.0.-alpha.17 to generate a table of contents for my blog entries.

i added the plugin like in the Simple usage example in #3363

in my project have two layouts, _base.webc and _post.webc, with the latter being nested in the former. i use the layouts like so: <article @raw="content"></article>.
i work with .webc for layouts and components (and some pages) and .md for blog-entries exclusively.

the plugin DOES add ids to eg. my index.webc or about.webc templates, which directly use the _base layout.
however it does NOT generate ids for headings in my blog-entry.md templates, which use _post.webc (which in turn uses _base.webc).

ideas that i have about the potential reasons:

  • i'm using it wrong (maybe i shouldn't be using @raw or content?)
  • it's related to the webc-layout being nested (because there was an issue like that in the past)
  • it's related to the combination of markdown and webc

i have tried using @html inside the layout instead, thinking that that will allow the html-transform to process the content and add the ids, but that should probably have happened before this step anyway?
i often have the feeling i might be misunderstanding something in eleventy, so that is very possible of course - if so, what should i change or try?

thanks in advance!

Reproduction steps

  1. use nested webc layouts for markdown files using @raw="content"
  2. see that no ids are added to headings in the rendered page

Expected behavior

id are added to all headings in all types of templates before the time that content is used in layouts.

Reproduction URL

No response

Screenshots

No response

@zachleat
Copy link
Member

Howdy! I did attempt to reproduce this with the instructions you provided and was unable to reproduce—can you provide a minimum test case?

@zachleat zachleat added needs-test-case Please submit a reproducible test case showcasing the issue! release: canary A release on the canary channel needs-reproduction Having trouble reproducing! Can anyone confirm? and removed needs-triage labels Jul 24, 2024
@johannesrave
Copy link
Author

thanks so much for checking out my issue!
while building the minimum reproduction i simply deleted stuff from my blog-project until the ids appeared.
the crucial line was the permalink in the frontmatter of the nesting _post.webc layout:

---
layout: "_base.webc"
permalink: "posts/{{ page.date | date: '%Y%m%d' }}/{{ title | slugify }}" <-- after deleting this, the ids appear
tags: ["post"]
---

<article @html="content"></article>

so like house MD says, 'everybody lies', and maybe i did without meaning to:
i'm not exclusively using webc and md like i wrote, since in this frontmatter and only here, i'm in fact using nunchucks (or liquid?). this was a workaround from an earlier issue, which i couldn't figure out back then.
with my understanding slowly growing ever so slightly, i was able to change it to

---js
{
  "layout": "_base.webc",
  "permalink": function({page, title}){
    return `posts/${page.date.toISOString().split('T')[0]}/${this.slugify(title)}`
  },
  "tags": ["post"]
}
---

and have it compile. however, still no ids.
i am still cleaning up the minimal reproduction, but basically, that's it: removing permalink from the frontmatter (also in the js version) makes the ids appear.

@johannesrave
Copy link
Author

okay, sorry for the wait, MRE is at:
https://github.com/johannesrave/eleventy-mre-id-attributeplugin

to reproduce:

thanks again for having a look!

@rdela
Copy link
Contributor

rdela commented Jul 28, 2024

I checked this out and opened a PR with some minor changes here johannesrave/eleventy-mre-id-attributeplugin#1

(EDIT: PR branch here https://github.com/rdela/eleventy-mre-id-attributeplugin/tree/rd-debug)

Short version is I was not able to determine why IdAttributePlugin did not generate IDs beyond what Johannes wrote:

removing permalink from the frontmatter (also in the js version) makes the ids appear.

I added ## who am i? h2 in about.md and we see IdAttributePlugin working there but not on post, which is now linked from index/home page.

Tried debug script but nothing jumped out, here is output:

jrave_codes@1.0.0-rdela.1 debug
> DEBUG=Eleventy* npx @11ty/eleventy

  Eleventy:cmd command: eleventy { _: [], quiet: null, version: false, watch: false, dryrun: false, help: false, serve: false, 'ignore-initial': false, to: 'fs' } +0ms
  Eleventy:EventBus Setting up global EventBus. +0ms
  Eleventy:EventBus EventBus max listener count: 100 +1ms
  Eleventy:UserConfig Resetting EleventyConfig to initial values. +0ms
  Eleventy:ImportJsonSync Found 'package.json' searching parent directories at: '/Users/r/Documents/code/gh/rdela/eleventy/repro/eleventy-mre-id-attributeplugin' +0ms
  Eleventy Setting process.env.ELEVENTY_ROOT: '/Users/r/Documents/code/gh/rdela/eleventy/repro/eleventy-mre-id-attributeplugin' +0ms
  Eleventy:UserConfig Adding '@11ty/eleventy-plugin-bundle' plugin +8ms
  Eleventy:UserConfig Adding new Universal Shortcode "'getBundle'" via `'addShortcode'('getBundle')` +1ms
  Eleventy:UserConfig Adding new Liquid Shortcode "'getBundle'" via `'addLiquidShortcode'('getBundle')` +0ms
  Eleventy:UserConfig Adding new JavaScript Shortcode "'getBundle'" via `'addJavaScriptShortcode'('getBundle')` +0ms
  Eleventy:UserConfig Adding new JavaScript Function "'getBundle'" via `'addJavaScriptFunction'('getBundle')` +0ms
  Eleventy:UserConfig Adding new Nunjucks Shortcode "'getBundle'" via `'addNunjucksShortcode'('getBundle')` +1ms
  Eleventy:UserConfig Adding new Universal Shortcode "'getBundleFileUrl'" via `'addShortcode'('getBundleFileUrl')` +0ms
  Eleventy:UserConfig Adding new Liquid Shortcode "'getBundleFileUrl'" via `'addLiquidShortcode'('getBundleFileUrl')` +0ms
  Eleventy:UserConfig Adding new JavaScript Shortcode "'getBundleFileUrl'" via `'addJavaScriptShortcode'('getBundleFileUrl')` +0ms
  Eleventy:UserConfig Adding new JavaScript Function "'getBundleFileUrl'" via `'addJavaScriptFunction'('getBundleFileUrl')` +0ms
  Eleventy:UserConfig Adding new Nunjucks Shortcode "'getBundleFileUrl'" via `'addNunjucksShortcode'('getBundleFileUrl')` +0ms
  Eleventy:UserConfig Adding '@11ty/eleventy/inputpath-to-url-filter-plugin' plugin +0ms
  Eleventy:UserConfig Adding new Universal Filter "'inputPathToUrl'" via `'addFilter'('inputPathToUrl')` +0ms
  Eleventy:UserConfig Adding new Liquid Filter "'inputPathToUrl'" via `'addLiquidFilter'('inputPathToUrl')` +0ms
  Eleventy:UserConfig Adding new JavaScript Filter "'inputPathToUrl'" via `'addJavaScriptFilter'('inputPathToUrl')` +0ms
  Eleventy:UserConfig Adding new JavaScript Function "'inputPathToUrl'" via `'addJavaScriptFunction'('inputPathToUrl')` +0ms
  Eleventy:UserConfig Adding new Nunjucks Filter "'inputPathToUrl'" via `'addNunjucksFilter'('inputPathToUrl')` +0ms
  Eleventy:UserConfig Adding new Universal Filter "'slug'" via `'addFilter'('slug')` +0ms
  Eleventy:UserConfig Adding new Liquid Filter "'slug'" via `'addLiquidFilter'('slug')` +0ms
  Eleventy:UserConfig Adding new JavaScript Filter "'slug'" via `'addJavaScriptFilter'('slug')` +0ms
  Eleventy:UserConfig Adding new JavaScript Function "'slug'" via `'addJavaScriptFunction'('slug')` +0ms
  Eleventy:UserConfig Adding new Nunjucks Filter "'slug'" via `'addNunjucksFilter'('slug')` +0ms
  Eleventy:UserConfig Adding new Universal Filter "'slugify'" via `'addFilter'('slugify')` +0ms
  Eleventy:UserConfig Adding new Liquid Filter "'slugify'" via `'addLiquidFilter'('slugify')` +0ms
  Eleventy:UserConfig Adding new JavaScript Filter "'slugify'" via `'addJavaScriptFilter'('slugify')` +0ms
  Eleventy:UserConfig Adding new JavaScript Function "'slugify'" via `'addJavaScriptFunction'('slugify')` +1ms
  Eleventy:UserConfig Adding new Nunjucks Filter "'slugify'" via `'addNunjucksFilter'('slugify')` +0ms
  Eleventy:UserConfig Adding new Universal Filter "'url'" via `'addFilter'('url')` +0ms
  Eleventy:UserConfig Adding new Liquid Filter "'url'" via `'addLiquidFilter'('url')` +0ms
  Eleventy:UserConfig Adding new JavaScript Filter "'url'" via `'addJavaScriptFilter'('url')` +0ms
  Eleventy:UserConfig Adding new JavaScript Function "'url'" via `'addJavaScriptFunction'('url')` +0ms
  Eleventy:UserConfig Adding new Nunjucks Filter "'url'" via `'addNunjucksFilter'('url')` +0ms
  Eleventy:UserConfig Adding new Universal Filter "'log'" via `'addFilter'('log')` +0ms
  Eleventy:UserConfig Adding new Liquid Filter "'log'" via `'addLiquidFilter'('log')` +0ms
  Eleventy:UserConfig Adding new JavaScript Filter "'log'" via `'addJavaScriptFilter'('log')` +0ms
  Eleventy:UserConfig Adding new JavaScript Function "'log'" via `'addJavaScriptFunction'('log')` +0ms
  Eleventy:UserConfig Adding new Nunjucks Filter "'log'" via `'addNunjucksFilter'('log')` +0ms
  Eleventy:UserConfig Adding new Universal Filter "'getCollectionItemIndex'" via `'addFilter'('getCollectionItemIndex')` +0ms
  Eleventy:UserConfig Adding new Liquid Filter "'getCollectionItemIndex'" via `'addLiquidFilter'('getCollectionItemIndex')` +0ms
  Eleventy:UserConfig Adding new JavaScript Filter "'getCollectionItemIndex'" via `'addJavaScriptFilter'('getCollectionItemIndex')` +0ms
  Eleventy:UserConfig Adding new JavaScript Function "'getCollectionItemIndex'" via `'addJavaScriptFunction'('getCollectionItemIndex')` +0ms
  Eleventy:UserConfig Adding new Nunjucks Filter "'getCollectionItemIndex'" via `'addNunjucksFilter'('getCollectionItemIndex')` +0ms
  Eleventy:UserConfig Adding new Universal Filter "'getCollectionItem'" via `'addFilter'('getCollectionItem')` +0ms
  Eleventy:UserConfig Adding new Liquid Filter "'getCollectionItem'" via `'addLiquidFilter'('getCollectionItem')` +0ms
  Eleventy:UserConfig Adding new JavaScript Filter "'getCollectionItem'" via `'addJavaScriptFilter'('getCollectionItem')` +0ms
  Eleventy:UserConfig Adding new JavaScript Function "'getCollectionItem'" via `'addJavaScriptFunction'('getCollectionItem')` +0ms
  Eleventy:UserConfig Adding new Nunjucks Filter "'getCollectionItem'" via `'addNunjucksFilter'('getCollectionItem')` +0ms
  Eleventy:UserConfig Adding new Universal Filter "'getPreviousCollectionItem'" via `'addFilter'('getPreviousCollectionItem')` +0ms
  Eleventy:UserConfig Adding new Liquid Filter "'getPreviousCollectionItem'" via `'addLiquidFilter'('getPreviousCollectionItem')` +0ms
  Eleventy:UserConfig Adding new JavaScript Filter "'getPreviousCollectionItem'" via `'addJavaScriptFilter'('getPreviousCollectionItem')` +0ms
  Eleventy:UserConfig Adding new JavaScript Function "'getPreviousCollectionItem'" via `'addJavaScriptFunction'('getPreviousCollectionItem')` +0ms
  Eleventy:UserConfig Adding new Nunjucks Filter "'getPreviousCollectionItem'" via `'addNunjucksFilter'('getPreviousCollectionItem')` +0ms
  Eleventy:UserConfig Adding new Universal Filter "'getNextCollectionItem'" via `'addFilter'('getNextCollectionItem')` +0ms
  Eleventy:UserConfig Adding new Liquid Filter "'getNextCollectionItem'" via `'addLiquidFilter'('getNextCollectionItem')` +0ms
  Eleventy:UserConfig Adding new JavaScript Filter "'getNextCollectionItem'" via `'addJavaScriptFilter'('getNextCollectionItem')` +0ms
  Eleventy:UserConfig Adding new JavaScript Function "'getNextCollectionItem'" via `'addJavaScriptFunction'('getNextCollectionItem')` +0ms
  Eleventy:UserConfig Adding new Nunjucks Filter "'getNextCollectionItem'" via `'addNunjucksFilter'('getNextCollectionItem')` +0ms
  Eleventy:UserConfig Adding new Universal Filter "'renderTransforms'" via `'addAsyncFilter'('renderTransforms')` +0ms
  Eleventy:UserConfig Adding new Liquid Filter "'renderTransforms'" via `'addLiquidFilter'('renderTransforms')` +0ms
  Eleventy:UserConfig Adding new JavaScript Filter "'renderTransforms'" via `'addJavaScriptFilter'('renderTransforms')` +0ms
  Eleventy:UserConfig Adding new JavaScript Function "'renderTransforms'" via `'addJavaScriptFunction'('renderTransforms')` +0ms
  Eleventy:UserConfig Adding new Nunjucks Filter "'renderTransforms'" via `'addNunjucksAsyncFilter'('renderTransforms')` +0ms
  Eleventy:TemplateConfig Default Eleventy config { templateFormats: [ 'liquid', 'md', 'njk', 'html', '11ty.js' ], pathPrefix: '/', markdownTemplateEngine: 'liquid', htmlTemplateEngine: 'liquid', dataFileSuffixes: [ '.11tydata', '' ], dataFileDirBaseNameOverride: false, keys: { package: 'pkg', layout: 'layout', permalink: 'permalink', permalinkRoot: 'permalinkBypassOutputDir', engineOverride: 'templateEngineOverride', computed: 'eleventyComputed', dataSchema: 'eleventyDataSchema' }, dir: { input: '.', includes: '_includes', data: '_data', output: '_site' }, nunjucksFilters: {} } +0ms
  Eleventy:TemplateConfig Merging default config with eleventy.config.js +1ms
  Eleventy:TemplateConfig Setting directories via `dir` object return from configuration file: { input: 'src', output: 'build', layouts: '_layouts', includes: '_components' } +4ms
  Eleventy:Util:ProjectTemplateFormats Using configuration `templateFormats`, `setTemplateFormats()`, `addTemplateFormats()`: [ 'md', 'webc', 'njk' ] +0ms
  Eleventy:UserConfig Adding 'anonymous' plugin +6ms
  Eleventy:UserConfig Adding '@11ty/eleventy-plugin-bundle' plugin +0ms
  Eleventy:UserConfig Adding new Universal Paired Shortcode "'css'" via `'addPairedShortcode'('css')` +0ms
  Eleventy:UserConfig Adding new Nunjucks Paired Shortcode "'css'" via `'addPairedNunjucksShortcode'('css')` +0ms
  Eleventy:UserConfig Adding new Liquid Paired Shortcode "'css'" via `'addPairedLiquidShortcode'('css')` +0ms
  Eleventy:UserConfig Adding new JavaScript Paired Shortcode "'css'" via `'addPairedJavaScriptShortcode'('css')` +0ms
  Eleventy:UserConfig Adding new JavaScript Function "'css'" via `'addJavaScriptFunction'('css')` +0ms
  Eleventy:UserConfig Adding new Universal Paired Shortcode "'js'" via `'addPairedShortcode'('js')` +1ms
  Eleventy:UserConfig Adding new Nunjucks Paired Shortcode "'js'" via `'addPairedNunjucksShortcode'('js')` +0ms
  Eleventy:UserConfig Adding new Liquid Paired Shortcode "'js'" via `'addPairedLiquidShortcode'('js')` +0ms
  Eleventy:UserConfig Adding new JavaScript Paired Shortcode "'js'" via `'addPairedJavaScriptShortcode'('js')` +0ms
  Eleventy:UserConfig Adding new JavaScript Function "'js'" via `'addJavaScriptFunction'('js')` +0ms
  Eleventy:UserConfig Adding new Universal Paired Shortcode "'html'" via `'addPairedShortcode'('html')` +0ms
  Eleventy:UserConfig Adding new Nunjucks Paired Shortcode "'html'" via `'addPairedNunjucksShortcode'('html')` +0ms
  Eleventy:UserConfig Adding new Liquid Paired Shortcode "'html'" via `'addPairedLiquidShortcode'('html')` +0ms
  Eleventy:UserConfig Adding new JavaScript Paired Shortcode "'html'" via `'addPairedJavaScriptShortcode'('html')` +0ms
  Eleventy:UserConfig Adding new JavaScript Function "'html'" via `'addJavaScriptFunction'('html')` +0ms
  Eleventy:UserConfig Warning, overwriting previous Universal Shortcode "'getBundle'" via `'addShortcode'('getBundle')` +0ms
  Eleventy:UserConfig Warning, overwriting previous Liquid Shortcode "'getBundle'" via `'addLiquidShortcode'('getBundle')` +0ms
  Eleventy:UserConfig Warning, overwriting previous JavaScript Shortcode "'getBundle'" via `'addJavaScriptShortcode'('getBundle')` +0ms
  Eleventy:UserConfig Warning, overwriting previous JavaScript Function "'getBundle'" via `'addJavaScriptFunction'('getBundle')` +0ms
  Eleventy:UserConfig Warning, overwriting previous Nunjucks Shortcode "'getBundle'" via `'addNunjucksShortcode'('getBundle')` +0ms
  Eleventy:UserConfig Warning, overwriting previous Universal Shortcode "'getBundleFileUrl'" via `'addShortcode'('getBundleFileUrl')` +0ms
  Eleventy:UserConfig Warning, overwriting previous Liquid Shortcode "'getBundleFileUrl'" via `'addLiquidShortcode'('getBundleFileUrl')` +0ms
  Eleventy:UserConfig Warning, overwriting previous JavaScript Shortcode "'getBundleFileUrl'" via `'addJavaScriptShortcode'('getBundleFileUrl')` +0ms
  Eleventy:UserConfig Warning, overwriting previous JavaScript Function "'getBundleFileUrl'" via `'addJavaScriptFunction'('getBundleFileUrl')` +0ms
  Eleventy:UserConfig Warning, overwriting previous Nunjucks Shortcode "'getBundleFileUrl'" via `'addNunjucksShortcode'('getBundleFileUrl')` +0ms
  Eleventy:UserConfig Adding new Universal Filter "'webcGetCss'" via `'addFilter'('webcGetCss')` +0ms
  Eleventy:UserConfig Adding new Liquid Filter "'webcGetCss'" via `'addLiquidFilter'('webcGetCss')` +0ms
  Eleventy:UserConfig Adding new JavaScript Filter "'webcGetCss'" via `'addJavaScriptFilter'('webcGetCss')` +0ms
  Eleventy:UserConfig Adding new JavaScript Function "'webcGetCss'" via `'addJavaScriptFunction'('webcGetCss')` +0ms
  Eleventy:UserConfig Adding new Nunjucks Filter "'webcGetCss'" via `'addNunjucksFilter'('webcGetCss')` +0ms
  Eleventy:UserConfig Adding new Universal Filter "'webcGetJs'" via `'addFilter'('webcGetJs')` +0ms
  Eleventy:UserConfig Adding new Liquid Filter "'webcGetJs'" via `'addLiquidFilter'('webcGetJs')` +0ms
  Eleventy:UserConfig Adding new JavaScript Filter "'webcGetJs'" via `'addJavaScriptFilter'('webcGetJs')` +0ms
  Eleventy:UserConfig Adding new JavaScript Function "'webcGetJs'" via `'addJavaScriptFunction'('webcGetJs')` +0ms
  Eleventy:UserConfig Adding new Nunjucks Filter "'webcGetJs'" via `'addNunjucksFilter'('webcGetJs')` +0ms
  Eleventy:UserConfig Adding 'IdAttributePlugin' plugin +0ms
  Eleventy:Util:ProjectTemplateFormats Using configuration `templateFormats`, `setTemplateFormats()`, `addTemplateFormats()`: [ 'md', 'webc', 'njk' ] +2ms
  Eleventy:TemplateConfig Configuration overrides: {} +2ms
  Eleventy:TemplateConfig Current configuration: { templateFormats: [ 'md', 'webc', 'njk' ], pathPrefix: '/', markdownTemplateEngine: 'liquid', htmlTemplateEngine: 'liquid', dataFileSuffixes: [ '.11tydata', '' ], dataFileDirBaseNameOverride: false, keys: { package: 'pkg', layout: 'layout', permalink: 'permalink', permalinkRoot: 'permalinkBypassOutputDir', engineOverride: 'templateEngineOverride', computed: 'eleventyComputed', dataSchema: 'eleventyDataSchema' }, dir: { input: 'src', includes: '_components', data: '_data', output: 'build', layouts: '_layouts' }, nunjucksFilters: { inputPathToUrl: [Function: fn], slug: [Function: fn], slugify: [Function: fn], url: [Function: fn], log: [Function: fn], getCollectionItemIndex: [Function: fn], getCollectionItem: [Function: fn], getPreviousCollectionItem: [Function: fn], getNextCollectionItem: [Function: fn], webcGetCss: [Function: fn], webcGetJs: [Function: fn] }, directories: { input: [Getter], inputFile: [Getter], inputGlob: [Getter], data: [Getter], includes: [Getter], layouts: [Getter], output: [Getter] }, transforms: { '@11ty/eleventy-bundle': [Function: fn], '@11ty/eleventy/html-transformer': [Function: fn] }, linters: {}, preprocessors: {}, globalData: {}, layoutAliases: {}, layoutResolution: true, passthroughCopies: {}, liquidOptions: {}, liquidTags: {}, liquidFilters: { inputPathToUrl: [Function: fn], slug: [Function: fn], slugify: [Function: fn], url: [Function: fn], log: [Function: fn], getCollectionItemIndex: [Function: fn], getCollectionItem: [Function: fn], getPreviousCollectionItem: [Function: fn], getNextCollectionItem: [Function: fn], renderTransforms: [Function: fn], webcGetCss: [Function: fn], webcGetJs: [Function: fn] }, liquidShortcodes: { getBundle: [Function: fn], getBundleFileUrl: [Function: fn] }, liquidPairedShortcodes: { css: [Function: fn], js: [Function: fn], html: [Function: fn] }, liquidParameterParsing: 'legacy', nunjucksEnvironmentOptions: { dev: true }, nunjucksPrecompiledTemplates: {}, nunjucksAsyncFilters: { renderTransforms: [Function: fn] }, nunjucksTags: {}, nunjucksGlobals: {}, nunjucksAsyncShortcodes: {}, nunjucksShortcodes: { getBundle: [Function: fn], getBundleFileUrl: [Function: fn] }, nunjucksAsyncPairedShortcodes: {}, nunjucksPairedShortcodes: { css: [Function: fn], js: [Function: fn], html: [Function: fn] }, javascriptFunctions: { getBundle: [Function: fn], getBundleFileUrl: [Function: fn], inputPathToUrl: [Function: fn], slug: [Function: fn], slugify: [Function: fn], url: [Function: fn], log: [Function: fn], getCollectionItemIndex: [Function: fn], getCollectionItem: [Function: fn], getPreviousCollectionItem: [Function: fn], getNextCollectionItem: [Function: fn], renderTransforms: [Function: fn], css: [Function: fn], js: [Function: fn], html: [Function: fn], webcGetCss: [Function: fn], webcGetJs: [Function: fn] }, javascriptShortcodes: { getBundle: [Function: fn], getBundleFileUrl: [Function: fn] }, javascriptPairedShortcodes: { css: [Function: fn], js: [Function: fn], html: [Function: fn] }, javascriptFilters: { inputPathToUrl: [Function: fn], slug: [Function: fn], slugify: [Function: fn], url: [Function: fn], log: [Function: fn], getCollectionItemIndex: [Function: fn], getCollectionItem: [Function: fn], getPreviousCollectionItem: [Function: fn], getNextCollectionItem: [Function: fn], renderTransforms: [Function: fn], webcGetCss: [Function: fn], webcGetJs: [Function: fn] }, markdownHighlighter: null, libraryOverrides: {}, dynamicPermalinks: true, useGitIgnore: true, ignores: Set(3) { '**/node_modules/**', '.git/**', 'src/_components/**/*.webc' }, watchIgnores: Set(2) { '**/node_modules/**', '.git/**' }, dataDeepMerge: true, watchJavaScriptDependencies: true, additionalWatchTargets: [ 'src/_components/**/*.webc' ], serverOptions: {}, chokidarConfig: {}, watchThrottleWaitTime: 0, frontMatterParsingOptions: { engines: { yaml: [Function: bound load$1], javascript: [Function: default], jsLegacy: [Object], node: [Function: default] } }, dataExtensions: Map(0) {}, extensionMap: Set(1) { { key: 'webc', extension: 'webc', outputFileExtension: 'html', compileOptions: [Object], compile: [AsyncFunction: compile] } }, quietMode: true, events: AsyncEventEmitter { _events: [Object: null prototype] { 'eleventy.before': [Array], 'eleventy.contentMap': [Function (anonymous)], 'eleventy.config': [Function (anonymous)] }, _eventsCount: 3, _maxListeners: undefined, [Symbol(shapeMode)]: false, [Symbol(kCapture)]: false }, benchmarkManager: BenchmarkManager { benchmarkGroups: { Configuration: [BenchmarkGroup], Aggregate: [BenchmarkGroup] }, isVerbose: true, start: 238.938292 }, plugins: [ { plugin: [Function (anonymous)], options: [Object], pluginNamespace: '' }, { plugin: [Function: IdAttributePlugin], options: [Object], pluginNamespace: '' } ], useTemplateCache: true, precompiledCollections: {}, dataFilterSelectors: Set(0) {}, libraryAmendments: {}, serverPassthroughCopyBehavior: 'copy', urlTransforms: [], virtualTemplates: {}, freezeReservedData: true, customDateParsing: Set(0) {} } +0ms
  Eleventy Eleventy warm up time: 257.918625 (ms) +18ms
  Eleventy:Util:ProjectTemplateFormats Using configuration `templateFormats`, `setTemplateFormats()`, `addTemplateFormats()`: [ 'md', 'webc', 'njk' ] +2ms
  Eleventy:TemplatePassthroughManager Resetting counts to 0 +0ms
  Eleventy:EleventyFiles .gitignore,.eleventyignore,src/.eleventyignore ignoring: ./node_modules/** +0ms
  Eleventy:EleventyFiles .gitignore,.eleventyignore,src/.eleventyignore ignoring: ./build/** +0ms
  Eleventy Directories:
  Eleventy   Input:
  Eleventy     Directory: ./src/
  Eleventy     File: false
  Eleventy     Glob: false
  Eleventy   Data: ./src/_data/
  Eleventy   Includes: ./src/_components/
  Eleventy   Layouts: ./src/_layouts/
  Eleventy   Output: ./build/
  Eleventy Template Formats: md,webc,njk
  Eleventy Verbose Output: false +1ms
  Eleventy:EleventyFiles Searching for: [ './src/**/*.{md,webc,njk}' ] +64ms
  Eleventy:FastGlobManager Glob search ('templates') searching for: [ './src/**/*.{md,webc,njk}' ] +0ms
  Eleventy:FastGlobManager Glob search ('templates') ignoring: [ 'node_modules/**', 'build/**', 'src/_components/**', 'src/_layouts/**', 'src/_data/**', '**/node_modules/**', '.git/**', 'src/_components/**/*.webc' ] +0ms
  Eleventy:TemplatePassthroughManager TemplatePassthrough copy started. +69ms
  Eleventy:TemplatePassthroughManager `addPassthroughCopy` config API paths: {} +0ms
  Eleventy:TemplatePassthroughManager `addPassthroughCopy` config API normalized paths: [] +0ms
  Eleventy:TemplateData Using [ '.11tydata', '' ] suffixes to find data files. +0ms
  Eleventy:TemplateData getLocalDataPaths('./src/about.md'): [ './src/about.11tydata.js', './src/about.11tydata.cjs', './src/about.11tydata.mjs', './src/about.11tydata.json', './src/about.json', './src/src.11tydata.js', './src/src.11tydata.cjs', './src/src.11tydata.mjs', './src/src.11tydata.json', './src/src.json' ] +1ms
  Eleventy:TemplateData Using [ '.11tydata', '' ] suffixes to find data files. +0ms
  Eleventy:TemplateData getLocalDataPaths('./src/index.webc'): [ './src/index.11tydata.js', './src/index.11tydata.cjs', './src/index.11tydata.mjs', './src/index.11tydata.json', './src/index.json', './src/src.11tydata.js', './src/src.11tydata.cjs', './src/src.11tydata.mjs', './src/src.11tydata.json', './src/src.json' ] +0ms
  Eleventy:TemplateData Using [ '.11tydata', '' ] suffixes to find data files. +0ms
  Eleventy:TemplateData getLocalDataPaths('./src/posts/rationale.md'): [ './src/posts/rationale.11tydata.js', './src/posts/rationale.11tydata.cjs', './src/posts/rationale.11tydata.mjs', './src/posts/rationale.11tydata.json', './src/posts/rationale.json', './src/posts/posts.11tydata.js', './src/posts/posts.11tydata.cjs', './src/posts/posts.11tydata.mjs', './src/posts/posts.11tydata.json', './src/posts/posts.json', './src/src.11tydata.js', './src/src.11tydata.cjs', './src/src.11tydata.mjs', './src/src.11tydata.json', './src/src.json' ] +0ms
  Eleventy:TemplatePassthroughManager TemplatePassthrough copy finished. Current count: 0 (size: 0) +2ms
  Eleventy:ImportJsonSync Found 'package.json' searching parent directories at: '/Users/r/Documents/code/gh/rdela/eleventy/repro/eleventy-mre-id-attributeplugin' +90ms
  Eleventy:FastGlobManager Glob search ('global-data') searching for: [ './src/_data/**/*.{json,mjs,cjs,js}' ] +8ms
  Eleventy:TemplateEngineManager Engine cache miss 'md' (should only happen once per type) +0ms
  Eleventy:TemplateEngineManager Engine cache miss 'webc' (should only happen once per type) +0ms
  Eleventy:TemplateContent 'ISO-8859-1' encoding detected on './src/index.webc'. +0ms
  Eleventy:TemplateContent 'ISO-8859-1' encoding detected on './src/_layouts/_base.webc'. +3ms
  Eleventy:Template Template date: using file’s 'birthtimeMs' for './src/index.webc' of 2024-07-28T15:20:37.581Z (from 1722180037581.835) +0ms
  Eleventy:TemplateContent 'ISO-8859-1' encoding detected on './src/about.md'. +18ms
  Eleventy:TemplateContent 'ISO-8859-1' encoding detected on './src/posts/rationale.md'. +0ms
  Eleventy:TemplateContent 'ISO-8859-1' encoding detected on './src/_layouts/_post.webc'. +0ms
  Eleventy:Template getMappedDate: using a date in the data for './src/posts/rationale.md' of 2023-08-27T21:45:00.000Z +18ms
  Eleventy:Template getMappedDate: found Date instance (maybe from YAML): 2023-08-27T21:45:00.000Z +0ms
  Eleventy:Template Template date: using file’s 'birthtimeMs' for './src/about.md' of 2024-07-28T15:20:37.581Z (from 1722180037581.7441) +0ms
  Eleventy:TemplateMap Caching collections objects. +0ms
  Eleventy:Template Rendering permalink for './src/posts/rationale.md': function({page, title}){
    return `posts/${page.date.toISOString().split('T')[0]}/${this.slugify(title)}`
  } becomes 'posts/2023-08-27/why-blog' +2ms
  Eleventy:TemplateMap Collection: collections.all size: 3 +3ms
  Eleventy:TemplateMap Collection: collections.post size: 1 +0ms
  Eleventy:TemplateMap Collection: collections.personal size: 1 +0ms
  Eleventy:TemplateMap Collection: collections.all size: 3 +0ms
  Eleventy:TemplateEngineManager Engine cache miss 'liquid' (should only happen once per type) +37ms
  Eleventy:TemplateWriter Template map created. +0ms
  Eleventy:Bundle Adding code to bundle 'css' for '/' (bucket: 'default'): [ 'body {\n    margin: 0;\n    width: 100vw;\n    height: 100vh;\n  }' ] +0ms
  Eleventy:Bundle Adding code to bundle 'css' for '/about/' (bucket: 'default'): [ 'body {\n    margin: 0;\n    width: 100vw;\n    height: 100vh;\n  }' ] +0ms
  Eleventy:Transforms Running '@11ty/eleventy-bundle' transform on './src/index.webc': './build/index.html' +0ms
  Eleventy:Transforms Running '@11ty/eleventy-bundle' transform on './src/about.md': './build/about/index.html' +1ms
  Eleventy:Bundle WARNING! `./src/index.webc` has unbundled `css` assets (in the 'default' bucket) that were not written to or used on the page. You might want to add a call to `getBundle('css', 'default')` to your content! Learn more: https://github.com/11ty/eleventy-plugin-bundle#asset-bucketing +0ms
  Eleventy:Bundle WARNING! `./src/about.md` has unbundled `css` assets (in the 'default' bucket) that were not written to or used on the page. You might want to add a call to `getBundle('css', 'default')` to your content! Learn more: https://github.com/11ty/eleventy-plugin-bundle#asset-bucketing +0ms
  Eleventy:Transforms Running '@11ty/eleventy/html-transformer' transform on './src/index.webc': './build/index.html' +0ms
  Eleventy:Transforms Running '@11ty/eleventy/html-transformer' transform on './src/about.md': './build/about/index.html' +4ms
  Eleventy:Logger Writing ./build/index.html from ./src/index.webc +0ms
  Eleventy:Template ./build/index.html written. +36ms
  Eleventy:Logger Writing ./build/about/index.html from ./src/about.md (liquid) +0ms
  Eleventy:Template ./build/about/index.html written. +0ms
  Eleventy:Bundle Adding code to bundle 'css' for '/posts/2023-08-27/why-blog' (bucket: 'default'): [ 'body {\n    margin: 0;\n    width: 100vw;\n    height: 100vh;\n  }' ] +8ms
  Eleventy:Transforms Running '@11ty/eleventy-bundle' transform on './src/posts/rationale.md': './build/posts/2023-08-27/why-blog' +3ms
  Eleventy:Bundle WARNING! `./src/posts/rationale.md` has unbundled `css` assets (in the 'default' bucket) that were not written to or used on the page. You might want to add a call to `getBundle('css', 'default')` to your content! Learn more: https://github.com/11ty/eleventy-plugin-bundle#asset-bucketing +7ms
  Eleventy:Transforms Running '@11ty/eleventy/html-transformer' transform on './src/posts/rationale.md': './build/posts/2023-08-27/why-blog' +0ms
  Eleventy:Logger Writing ./build/posts/2023-08-27/why-blog from ./src/posts/rationale.md (liquid) +1ms
  Eleventy:Template ./build/posts/2023-08-27/why-blog written. +1ms
  Eleventy:Benchmark Benchmark      0ms   0%     3× (Configuration) "@11ty/eleventy-bundle" Transform +0ms
  Eleventy:Benchmark Benchmark      1ms   1%     1× (Configuration) "slugify" JavaScript Function +0ms
  Eleventy:Benchmark Benchmark      5ms   3%     3× (Configuration) "@11ty/eleventy/html-transformer" Transform +1ms
  Eleventy:Benchmark Benchmark      0ms   0%     5× (Configuration) "css" JavaScript Function +0ms
  Eleventy:Benchmark Benchmark      0ms   0%     5× (Configuration) "js" JavaScript Function +0ms
  Eleventy:Benchmark Benchmark      4ms   3%     5× (Aggregate) Configuration addPlugin +0ms
  Eleventy:Benchmark Benchmark      2ms   1%     1× (Aggregate) Processing plugins in config +0ms
  Eleventy:Benchmark Benchmark      4ms   3%     1× (Aggregate) Searching the file system (templates) +0ms
  Eleventy:Benchmark Benchmark      1ms   0%     1× (Aggregate) Searching the file system (data) +0ms
  Eleventy:Benchmark Benchmark      5ms   3%     5× (Aggregate) Template Read +0ms
  Eleventy:Benchmark Benchmark      0ms   0%     3× (Aggregate) (count) getOutputLocations +0ms
  Eleventy:Benchmark Benchmark      0ms   0%     5× (Aggregate) (count) Template Compile Cache Miss +0ms
  Eleventy:Benchmark Benchmark     13ms   8%     5× (Aggregate) Template Compile +0ms
  Eleventy:Benchmark Benchmark     10ms   7%     3× (Aggregate) Render +0ms
  Eleventy:Benchmark Benchmark      8ms   5%     1× (Aggregate) > Render > ./src/index.webc +0ms
  Eleventy:Benchmark Benchmark     13ms   8%     1× (Aggregate) > Compile > ./src/posts/rationale.md +0ms
  Eleventy:Benchmark Benchmark      2ms   1%     1× (Aggregate) > Render > ./src/posts/rationale.md +0ms
  Eleventy:Benchmark Benchmark      5ms   3%     2× (Aggregate) Transforming `html` with posthtml +0ms
  Eleventy:Benchmark Benchmark      0ms   0%     3× (Aggregate) Template make parent directory +0ms
  Eleventy:Benchmark Benchmark      0ms   0%     3× (Aggregate) Template Write +0ms
[11ty] Wrote 3 files in 0.14 seconds (v3.0.0-alpha.17)
  Eleventy Finished. +137ms
  Eleventy 
  Eleventy Have a suggestion/feature request/feedback? Feeling frustrated? I want to hear it!
  Eleventy Open an issue: https://github.com/11ty/eleventy/issues/new +0ms

@zachleat zachleat added education and removed release: canary A release on the canary channel needs-test-case Please submit a reproducible test case showcasing the issue! needs-reproduction Having trouble reproducing! Can anyone confirm? labels Jul 30, 2024
@zachleat
Copy link
Member

A ha, found the issue:

https://github.com/johannesrave/eleventy-mre-id-attributeplugin/blob/2795f3fdf1aa4b6f9a93945b994e02b14d0eb410/src/_layouts/_post.webc#L5

You need to use a trailing slash here or .html extension so that we know you’re outputting an html file:

// trailing slash
return `posts/${page.date.toISOString().split('T')[0]}/${this.slugify(title)}/

// or .html
return `posts/${page.date.toISOString().split('T')[0]}/${this.slugify(title)}.html

@zachleat zachleat added this to the Eleventy 3.0.0 milestone Jul 30, 2024
@johannesrave
Copy link
Author

johannesrave commented Aug 1, 2024

ah, thank you for taking the time! it works!

for future readers and crawlers, the fact that i left out the trailing slash also lead to github pages delivering these transformed mds with content-type application/octet-stream because, like zach said, they don't get file-endings this way. so if that happens, check your permalinks.

i never noticed when using the local dev server, because i think it's more lenient or cleverer about the content type?
anyways, thanks again!

@zachleat
Copy link
Member

zachleat commented Aug 1, 2024

Filed an error messaging improvement issue at #3399 if you want to subscribe!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants