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
I’m using Pug as my template language of choice, and I just tried to add some Front Matter to a layout for the first time. Pug sees the front matter code and chokes when attempting to parse it.
Error output
[11ty] Original error stack trace: Error: _src/_layouts/default.pug:2:1
[11ty] 1| ---js
[11ty] > 2| {
[11ty] -------^
[11ty] 3| cssListAppend: null
[11ty] 4| }
[11ty] 5| ---
[11ty]
[11ty] unexpected text "{
[11ty] "
[11ty] at makeError (/Users/amrogers/Projects/uof-11ty/node_modules/pug-error/index.js:34:13)
[11ty] at Lexer.error (/Users/amrogers/Projects/uof-11ty/node_modules/pug-lexer/index.js:62:15)
[11ty] at Lexer.fail (/Users/amrogers/Projects/uof-11ty/node_modules/pug-lexer/index.js:1629:10)
[11ty] at Lexer.advance (/Users/amrogers/Projects/uof-11ty/node_modules/pug-lexer/index.js:1694:12)
[11ty] at Lexer.callLexerFunction (/Users/amrogers/Projects/uof-11ty/node_modules/pug-lexer/index.js:1647:23)
[11ty] at Lexer.getTokens (/Users/amrogers/Projects/uof-11ty/node_modules/pug-lexer/index.js:1706:12)
[11ty] at lex (/Users/amrogers/Projects/uof-11ty/node_modules/pug-lexer/index.js:12:42)
[11ty] at Object.lex (/Users/amrogers/Projects/uof-11ty/node_modules/pug/lib/index.js:104:9)
[11ty] at Function.loadString [as string] (/Users/amrogers/Projects/uof-11ty/node_modules/pug-load/index.js:53:24)
[11ty] at /Users/amrogers/Projects/uof-11ty/node_modules/pug-load/index.js:37:27
[11ty] Copied 27 files / Wrote 0 files in 4.61 seconds (v1.0.2)
My speculation
Since each parser only knows its own language (but not front matter), my guess is that Eleventy is sending the entire file contents to the Pug parser, when it should be pre-processing the front matter first and sending only Pug code to the Pug parser.
Eleventy Version
Eleventy version: 1.0.2
The text was updated successfully, but these errors were encountered:
Relevant Docs
The docs for Layouts say:
The problem
I’m using Pug as my template language of choice, and I just tried to add some Front Matter to a layout for the first time. Pug sees the front matter code and chokes when attempting to parse it.
Error output
My speculation
Since each parser only knows its own language (but not front matter), my guess is that Eleventy is sending the entire file contents to the Pug parser, when it should be pre-processing the front matter first and sending only Pug code to the Pug parser.
Eleventy Version
The text was updated successfully, but these errors were encountered: