Skip to content
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

Content Insertion into <head> does not respect file types #993

Closed
alyip98 opened this issue Jan 22, 2020 · 7 comments · Fixed by #1294
Closed

Content Insertion into <head> does not respect file types #993

alyip98 opened this issue Jan 22, 2020 · 7 comments · Fixed by #1294

Comments

@alyip98
Copy link
Contributor

alyip98 commented Jan 22, 2020

Tell us about your environment

  • MarkBind Version: 2.9.0

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.

@alyip98 alyip98 changed the title Content Insertion into <head> does not handle file types Content Insertion into <head> does not handle file types properly Jan 22, 2020
@alyip98 alyip98 changed the title Content Insertion into <head> does not handle file types properly Content Insertion into <head> does not respect file types Jan 22, 2020
@yamgent
Copy link
Member

yamgent commented Jan 23, 2020

Seems like this feature never exist before, the PR that the claim originated from (#361) doesn't seem to support this.

@acjh
Copy link
Contributor

acjh commented Jan 23, 2020

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).

@yamgent
Copy link
Member

yamgent commented Jan 23, 2020

Agreed, perhaps the best remedy now is simply to remove that claim from the documentation.

@alyip98
Copy link
Contributor Author

alyip98 commented Jan 23, 2020

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.

In that case, should we aim to deprecate this feature?

@damithc
Copy link
Contributor

damithc commented Jan 23, 2020

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).

@alyip98
Copy link
Contributor Author

alyip98 commented Jan 24, 2020

Sorry, I meant the head content insertion feature, since layouts provides a better way of achieving the same thing

@yamgent
Copy link
Member

yamgent commented Jan 24, 2020

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants