Skip to content

Conversation

@darekkay
Copy link

Excluded files (permalink: false) won't be rendered, hence bundling of CSS/JS resources is not required. This change not only improves the build performance, it fixes a bug where "renderFile" with WebC fails for excluded files (e.g. drafts).

Here's the high-level flow of what is happening:

  • eleventyWebcTemplate.js calls the css and js shortcodes with data.page.url as the last parameter. For draft posts, this value is false.
  • eleventy.shortcodes.js checks for urlOverride || this.page.url. As the urlOverride is false, it tries to access this.page.url. As this.page is undefined, this throws an error.

I have added a new test to verify the problem. Revert the code change that I did to see the test failing.

Fixes: #59

Excluded files (permalink: false) won't be rendered, hence bundling of CSS/JS resources is not required. This change not only improves the build performance, it fixes a bug where "renderFile" with WebC fails for excluded files (e.g. drafts).

Fixes: 11ty#59
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

Successfully merging this pull request may close these issues.

renderFile of a WebC include within a draft fails on build

1 participant