【发布时间】:2016-08-04 18:04:02
【问题描述】:
我正在开发一个使用 Jekyll 制作并托管在 GitHub 上的静态网站。其中一个帖子看起来像this
另外,我创建了一个 Rmarkdown 文件,我想将生成的 html 文件嵌入到帖子中。我读到here 我只需要这样做:
您只需在项目的 DocumentRoot 中创建一个名为 _includes/ 的文件夹,然后在其中创建一个 HTML 文件,例如“mycomponent.html”并在您的帖子中调用它像这样:
{% include mycomponent.html %}
我在 _includes/ 文件夹中添加了我的 html 文件,并在相应帖子的降价文件末尾添加了这样一段代码。但是,当我这样做时,网站布局会完全改变
有什么办法可以避免这种情况吗?网站所有文件都存储在here。
编辑:
我发现了另一个问题,建议做this:
我认为最好的解决方案是:
使用 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>
我完全不明白。不知何故,网站的布局恢复了,但现在一些图像和 htmlwidgets 丢失了。另外,页面的页脚完全乱了。
【问题讨论】:
标签: html jekyll r-markdown