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

permalink: false not working in WebC files or using WebC layouts #86

Open
anghelos opened this issue Jul 12, 2023 · 2 comments
Open

permalink: false not working in WebC files or using WebC layouts #86

anghelos opened this issue Jul 12, 2023 · 2 comments

Comments

@anghelos
Copy link

Possibly related to this comment in issue #32.

Adding permalink: false to a *.webc file's frontmatter data results in an error.

Example

<!-- false.webc -->
---
permalink: false
---

<h1>This is a test</h1>
[11ty] Problem writing Eleventy templates: (more in DEBUG output)
[11ty] 1. Having trouble rendering webc template ./false.webc (via TemplateContentRenderError)
[11ty] 2. Cannot read properties of undefined (reading 'url') (via TypeError)
[11ty]
[11ty] Original error stack trace: TypeError: Cannot read properties of undefined (reading 'url')
[11ty]     at Object.addContent (C:\NODEJS\Eleventy\webc_test\node_modules\.pnpm\@[email protected]\node_modules\@11ty\eleventy-plugin-bundle\eleventy.shortcodes.js:24:39)
[11ty]     at Object.css (C:\NODEJS\Eleventy\webc_test\node_modules\.pnpm\@[email protected]\node_modules\@11ty\eleventy\src\BenchmarkGroup.js:32:26)   
[11ty]     at Object.<anonymous> (C:\NODEJS\Eleventy\webc_test\node_modules\.pnpm\@[email protected]\node_modules\@11ty\eleventy-plugin-webc\src\eleventyWebcTemplate.js:155:37)
[11ty]     at async Template._render (C:\NODEJS\Eleventy\webc_test\node_modules\.pnpm\@[email protected]\node_modules\@11ty\eleventy\src\TemplateContent.js:514:22)
[11ty]     at async Template.renderWithoutLayout (C:\NODEJS\Eleventy\webc_test\node_modules\.pnpm\@[email protected]\node_modules\@11ty\eleventy\src\Template.js:456:27)
[11ty]     at async TemplateMap.populateContentDataInMap (C:\NODEJS\Eleventy\webc_test\node_modules\.pnpm\@[email protected]\node_modules\@11ty\eleventy\src\TemplateMap.js:589:39)
[11ty]     at async TemplateMap.cache (C:\NODEJS\Eleventy\webc_test\node_modules\.pnpm\@[email protected]\node_modules\@11ty\eleventy\src\TemplateMap.js:483:5)
[11ty]     at async TemplateWriter._createTemplateMap (C:\NODEJS\Eleventy\webc_test\node_modules\.pnpm\@[email protected]\node_modules\@11ty\eleventy\src\TemplateWriter.js:330:5)
[11ty]     at async TemplateWriter.generateTemplates (C:\NODEJS\Eleventy\webc_test\node_modules\.pnpm\@[email protected]\node_modules\@11ty\eleventy\src\TemplateWriter.js:360:5)
[11ty]     at async TemplateWriter.write (C:\NODEJS\Eleventy\webc_test\node_modules\.pnpm\@[email protected]\node_modules\@11ty\eleventy\src\TemplateWriter.js:407:23)
[11ty] Wrote 0 files in 0.45 seconds (v2.0.1)
@PersonMeetup
Copy link

This issue should be resolved with #93, as it adds a check to ensure data.page.url exists before trying to read from it.

@satgo1546
Copy link

Leaving a note here: The same error is thrown also if permalink is set to a string. Example:

---
permalink: "test-permalink/"
---

<h1>This is a test</h1>

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

No branches or pull requests

3 participants