You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Not sure if this should go here or in 11ty/webc. Sorry!
It seems that if you have a blank line at the start of a webc page file, the built page will be missing the html and doctype and head elements. This also happens if there's a blank line after the front matter. For example, if I have the following index.webc file:
---
test: "hi"
---
<!DOCTYPE html><htmllang="en"><head><metacharset="UTF-8" /><metahttp-equiv="X-UA-Compatible" content="IE=edge" /><metaname="viewport" content="width=device-width, initial-scale=1.0" /><title>Test</title></head><body><h1>Hi, this is a test</h1></body></html>
will output:
<metacharset="UTF-8"><metahttp-equiv="X-UA-Compatible" content="IE=edge"><metaname="viewport" content="width=device-width, initial-scale=1.0"><title>Test</title><h1>Hi, this is a test</h1>
If you remove the blank line it seems to output correctly. However, Prettier adds a newline after the front matter (and my editor runs prettier on save), which can make it a bit tedious to manage. Would probably be nice if the plugin trimmed any newlines from the start of a file before determining which rendering mode to use.
Not sure if this should go here or in 11ty/webc. Sorry!
It seems that if you have a blank line at the start of a
webc
page file, the built page will be missing thehtml
anddoctype
andhead
elements. This also happens if there's a blank line after the front matter. For example, if I have the followingindex.webc
file:will output:
If you remove the blank line it seems to output correctly. However, Prettier adds a newline after the front matter (and my editor runs prettier on save), which can make it a bit tedious to manage. Would probably be nice if the plugin trimmed any newlines from the start of a file before determining which rendering mode to use.
A reproduction can be found here: https://github.com/mdarrik/11ty-plugin-webc-test-page-webc
The text was updated successfully, but these errors were encountered: