I'm working on a static website made with Jekyll and hosted on GitHub. One of the post looks like this
Also, I created an Rmarkdown file, and I want to embed the resulting html file into the post. I read here that I only needed to do this:
You just have to create a folder with the name _includes/ in the DocumentRoot of your project, then, create an HTML file inside, for example "mycomponent.html" and call it in your post with something like this:
{% include mycomponent.html %}
I added my html file in the _includes/ folder and added such piece of code at the end of the markdown file for the corresponding post. However, when I do that, the website layout changes completely
Is there I way I can avoid this? All the files of the website are store here.
EDIT:
I found another question where it is suggested to do this:
In my opinion the best solution is:
Using jQuery:
a.html:
<html> <head> <script src="jquery.js"></script> <script> $(function(){ $("#includedContent").load("b.html"); }); </script> </head> <body> <div id="includedContent"></div> </body> </html>
b.html:
<p> This is my include file </p>
I do not understand it completely. Somehow the layout of the site is recovered, but now some images and htmlwidgets are lost. Also, the footer of the page is completely messed up.