Tell us about your environment
What did you do? Please include the actual source code causing the issue.
According to the UG, adding raw JS and CSS files to the <head> is supported.
I attempted to insert a custom CSS file into the head of a page.
index.md
<frontmatter>
header: header.md
pageNav: 2
pageNavTitle: "Chapters of This Page"
siteNav: site-nav.md
head: customStyles.css
</frontmatter>
customStyles.css
.test {
color: red;
}
What did you expect to happen?
I expected the contents of customStyles.css to be wrapped in a <style> tag and inserted.
What actually happened? Please include the actual, raw output.
The contents of customStyles.css is inserted raw, i.e. without being wrapped in a <style> tag.
This issue also affects JS files inserted this way.
Proposed solution:
Edit Page.js to wrap contents in <style> and <script> tags for CSS and JS files respectively.
Seems like this feature never exist before, the PR that the claim originated from (#361) doesn't seem to support this.
I feel there is little value in supporting other file types since it is trivial for an author to prepare a .md file.
And moving forward, we should transition to expressive layouts (#631, PR #944).
Agreed, perhaps the best remedy now is simply to remove that claim from the documentation.
I feel there is little value in supporting other file types since it is trivial for an author to prepare a
.mdfile.And moving forward, we should transition to expressive layouts (#631, PR #944).
Agreed, perhaps the best remedy now is simply to remove that claim from the documentation.
In that case, should we aim to deprecate this feature?
In that case, should we aim to deprecate this feature?
Perhaps the feature never existed except in the UG? In that case just remove it from the UG should be enough (as opposed to a formal deprecation).
Sorry, I meant the head content insertion feature, since layouts provides a better way of achieving the same thing
Sorry, I meant the head content insertion feature, since layouts provides a better way of achieving the same thing
In the future possibility. This feature is commonly used, so it is probably going to stay around for a few versions at least.