我正在使用 {% include some_file.ext %}
从 _includes
文件夹中为 Jekyll 提取内容/strong> powered GitHub page/gh-pages
-branch.
所有包含,如 header.html
等,都可以正常工作。但是引入其他东西,比如 css/js
文件(包含在完全相同文件夹的 all.*
文件中),是行不通的。使用 {{ site.baseurl }}
设置的文件路径只是保持为空。
转储变量也不会输出任何内容。看起来 {{}}
变量不可访问,而其他一切正常。换句话说,将以下内容添加到 index.html
中只会返回空标签:
<pre>{{ site }}</pre>
(本地工作的)all.css
文件。
---
---
{% include css/grid.css %}
{% include css/style.css %}
all.css
(和all.js
)文件的位置:
~/root
├── /_includes
│ ├── css
│ │ ├── grid.css
│ │ └── style.css
│ ├── js
│ │ ├── analytics.js
│ │ └── general.js
│ └── head.html
├── index.html
├── all.js
└── all.css
最佳答案
如果有任何帮助。我在 github 页面上运行一个博客,我们使用 index.md。我在 _layouts/index.html
{{ var }}
关于ruby - 未返回 GitHub Pages 配置变量,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17622357/