-
Notifications
You must be signed in to change notification settings - Fork 33
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
All included content is run through the template renderer, even if it shouldn't be #529
Comments
I've added the |
preaction
added a commit
that referenced
this issue
Jan 31, 2017
When we're including a file that contains content that _looks_ like a Mojolicious template directive, we get strange errors that are difficult to track down. We should fix this by requiring people to use certain extensions to enable rendering (like `.ep` and the document extensions as known by the store (`.markdown` and `.md` by default)), but we should also allow people to override these heuristics. So, for now, we'll add the flag that allows overriding the behavior, and then later we can fix our heuristics for determining if we should run the content through the renderer. Refs #529
preaction
added a commit
that referenced
this issue
Jan 31, 2017
When we're including a file that contains content that _looks_ like a Mojolicious template directive, we get strange errors that are difficult to track down. We should fix this by requiring people to use certain extensions to enable rendering (like `.ep` and the document extensions as known by the store (`.markdown` and `.md` by default)), but we should also allow people to override these heuristics. So, for now, we'll add the flag that allows overriding the behavior, and then later we can fix our heuristics for determining if we should run the content through the renderer. Refs #529
preaction
added a commit
that referenced
this issue
Jan 31, 2017
[Added] - The new `statocles status` command shows you a quick status of your site, including the last time it was deployed and what date it was deployed up to (if different from the last date it was deployed). We will be adding more things to this later, so let us know if there are any statistics you'd like to know about your site! Thanks @perlancar [Github #516] - The `include` helper now accepts a `-raw` flag to disable the template renderer. This allows you to easily include Perl code and not have it mistaken for a template. Thanks justinQuiring on IRC for the bug report [Github #529] This isn't the end of this: We will likely fix the heuristics to ignore file types (extensions) that do not look like templates. This will be a breaking change, sorry.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Right now, all uses of the
include
helper function have their included file run through the template processor. This makes a huge problem if the file we're including looks similar enough to a template (has a%
in the first column, for example, like most any Perl code would).So if I have a file called
script.pl
that looks like:And I then try to include that file using
include
:I will get an error about the "bareword
files
not allowed here" since it's being run through the template generator.We should make this as intuitive as possible for the common case, while also allowing people to override the intuitive behavior to force the behavior they want. To achieve this, we should make it so only some types of files are rendered automatically, like
.ep
,.markdown
, and.md
. We should also add some flags to theinclude
helper that allow disabling the rendering (-raw
) or forcing the rendering (-render
).This is a breaking change, so we'll have to be vocal about it. If we can find a way to smooth this change over, that would be ideal, but I'm not coming up with a good idea right now.
The text was updated successfully, but these errors were encountered: