将 html 文件的内容放在 GitHub 页面布局文件的特定部分
Place an html file's contents in a specific part of a GitHub pages layout file
我在 GitHub 页中使用 Jekyll,我想将整个 HTML 文件的内容放入 Jekyll 布局文件中。
这有点像 Android Studio Activity 片段(我相信),如果您只在浏览器中查看片段代码,则不会有用。
我想像 {{ content: fragment.html }}
而不是当前页面的内容 ({{ content }}
)。
使用这个语法:
{% include fragment.html %}
不要将 fragment.html
包裹在 <html>
元素中。
默认情况下,您的片段文件应位于 _includes
目录 (/root/_includes/
) 中。
我在 GitHub 页中使用 Jekyll,我想将整个 HTML 文件的内容放入 Jekyll 布局文件中。
这有点像 Android Studio Activity 片段(我相信),如果您只在浏览器中查看片段代码,则不会有用。
我想像 {{ content: fragment.html }}
而不是当前页面的内容 ({{ content }}
)。
使用这个语法:
{% include fragment.html %}
不要将 fragment.html
包裹在 <html>
元素中。
默认情况下,您的片段文件应位于 _includes
目录 (/root/_includes/
) 中。