-
Notifications
You must be signed in to change notification settings - Fork 57
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
Add javascript to header html #378
Comments
You should be able to use the With this you can pass a If you put the line above in a file then include it this way, it should be enough. You can see an example on this repo found in Github search : https://github.com/beatrizmilz/slidesR/blob/bae491168f8f702133c733b61b8f4afb9865f94f/docs/_site.yml#L28-L32 Documentation about
Hope it helps |
Thanks for the swift reply! It totally seems to work when I add this to the output:
distill::distill_article:
css: styles.css
includes:
in_header: header.html |
I see this is closed, but the solution given works only for Distill sites, not for Distill documents. I can confirm that everything works fine with the header given in _site.yml for Distill sites, but if the same is given in the yaml section of a Distill article this doesn't work. As it turns out, this is due to This may be fine in many instances, but it doesn't work with tracking scripts such as the ones used by Plausible (or, for that matter, Google Analytics). In the case of Google Analytics, the end result of including a link to an external script even if It would be nice if there was a way to leave If |
The process to make a document If you add this to your element, Pandoc should leave the element alone.
Can you try this ? |
Thanks a lot @cderv, that's perfect, I can confirm this works. I see this is really a pandoc issue, that is adequately documented there. Considering the different behaviour this has depending if one is using a Distill website or Distill article, perhaps it would anyway make sense to add a short reference in the documentation, to save others the lengthy troubleshooting. Either way, thank you for your swift reply, it is much appreciated. |
This is for all type of production using R Markdown: You won't have this issue with format like website as they are using But this |
Thanks for the thoughtful reply. Yes, I did notice that this happens with regular Rmarkdown documents as well as I was troubleshooting, and now I understand the reasoning and the logic. But at first, I re-read the Rmarkdown documentation, and made online searches with reference to Of course, with hindsight, when this happens and why is all clear and obvious, but, even a brief reference in the R Markdown Cookbook or documentation would make this a matter of minutes to find for anybody having this or similar issue. |
The documentation of my analytics provider tells me that the only supported method of adding tracking to my blog is to add a tag to the
<head>
of my page.Is that even possible with distill? It seems to only support GA, but I could imagine that javascript libraries like jquery also cannot be placed in the header.
The text was updated successfully, but these errors were encountered: