Closed benbalter closed 7 years ago
I can add that this only happens when the document is not HTML. If the document has an .md
extension, Jekyll will process it as Markdown, and the Markdown processor will mangle the <!DOCTYPE>
tag.
When a document has been loaded from a file with a .md
extension, Jekyll will recognize that this file needs to be fed through a Markdown converter. The issue comes when the document contains redirect_to
in the YAML front matter. We replace the content of the document with our redirect page, and can override the layout
key so that no other layout is applied, but if the original document had a .md
extension then Jekyll will still try to process the page as Markdown.
I do not know how to convince Jekyll not to convert a Convertible
once it has been loaded. There is no way to change the file extension of an already loaded Document
.
Any ideas, @jekyll/core?
@pathawks Do you know why HTML is even parsed this way by kramdown? It usually allows HTML to pass through.
That's a good question; I do not know the answer.
Should we just document this and live with it? A bit sad but it seems outside of our hands.
Should we just document this and live with it? A bit sad but it seems outside of our hands.
The problem is, out of the box, our default template does not work with documents. Could we remove the doctype declaration entirely?
The problem is, out of the box, our default template does not work with documents.
It's just a Markdown issue, right? Renaming the file to have an .html
extension fixes the issue.
Our redirect template is designed to be served as is, without mangling from Markdown or any other processor. Removing the doctype would fix this problem, but there is no guarantee that other problems won't arise with other Markdown processors or future updates to Kramdown.
If there is no way to bypass Jekyll's converters entirely, it seems to be that the best solution is to document that users must use .html
for redirect pages, and possibly warn users at build time if a redirect page does not have an .html
extension.
Renaming the file to have an .html extension fixes the issue.
Duh. Not sure why I didn't think of that. If it has no content, it shouldn't be an issue.
If there is no way to bypass Jekyll's converters entirely, it seems to be that the best solution is to document that users must use .html for redirect pages, and possibly warn users at build time if a redirect page does not have an .html extension.
❤️ these two suggestions.
This issue has been automatically marked as stale because it has not been commented on for at least two months.
The resources of the Jekyll team are limited, and so we are asking for your help.
If this is a bug and you can still reproduce this error on the master
branch, please reply with all of the information you have about it in order to keep the issue open.
If this is a feature request, please consider whether it can be accomplished in another way. If it cannot, please elaborate on why it is core to this project and why you feel more than 80% of users would find this beneficial.
This issue will automatically be closed in two months if no further activity occurs. Thank you for all your contributions.
If there is no way to bypass Jekyll's converters entirely, it seems to be that the best solution is to document that users must use .html for redirect pages, and possibly warn users at build time if a redirect page does not have an .html extension.
Still outstanding.
This issue has been automatically marked as stale because it has not been commented on for at least two months.
The resources of the Jekyll team are limited, and so we are asking for your help.
If this is a bug and you can still reproduce this error on the master
branch, please reply with all of the information you have about it in order to keep the issue open.
If this is a feature request, please consider whether it can be accomplished in another way. If it cannot, please elaborate on why it is core to this project and why you feel more than 80% of users would find this beneficial.
This issue will automatically be closed in two months if no further activity occurs. Thank you for all your contributions.
I think this should be fixed on master after #131.
@benbalter If it is, would you please ship a quick test? :)
This issue has been automatically marked as stale because it has not been commented on for at least two months.
The resources of the Jekyll team are limited, and so we are asking for your help.
If this is a bug and you can still reproduce this error on the master
branch, please reply with all of the information you have about it in order to keep the issue open.
If this is a feature request, please consider whether it can be accomplished in another way. If it cannot, please elaborate on why it is core to this project and why you feel more than 80% of users would find this beneficial.
This issue will automatically be closed in two months if no further activity occurs. Thank you for all your contributions.
@pathawks, maybe you could ship a quick test? ❤️
This issue has been automatically marked as stale because it has not been commented on for at least two months.
The resources of the Jekyll team are limited, and so we are asking for your help.
If this is a bug and you can still reproduce this error on the master
branch, please reply with all of the information you have about it in order to keep the issue open.
If this is a feature request, please consider whether it can be accomplished in another way. If it cannot, please elaborate on why it is core to this project and why you feel more than 80% of users would find this beneficial.
This issue will automatically be closed in two months if no further activity occurs. Thank you for all your contributions.
This issue needs a test to confirm redirect pages are processed as non-munged HTML before it can be closed.
If you add the pinned
label, jekyllbot will stop trying to close it.
If you submit a PR to add a test & merge it, jekyllbot won't see this as open anymore :trollface: 😜
This issue has been automatically marked as stale because it has not been commented on for at least two months.
The resources of the Jekyll team are limited, and so we are asking for your help.
If this is a bug and you can still reproduce this error on the master
branch, please reply with all of the information you have about it in order to keep the issue open.
If this is a feature request, please consider whether it can be accomplished in another way. If it cannot, please elaborate on why it is core to this project and why you feel more than 80% of users would find this beneficial.
This issue will automatically be closed in two months if no further activity occurs. Thank you for all your contributions.
Steps to reproduce
Add the following YAML front matter:
Expected
Generated redirect output has a valid
<doctype>
tag.Actual:
Doctype tag is HTML entity encoded and appears in the rendered page.