ruby - 未返回 GitHub Pages 配置变量

标签 ruby jekyll liquid github-pages

我正在使用 {% 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/

相关文章:

loops - 按修改日期而不是发布日期对 Jekyll 帖子进行排序?

jquery - 使用 JQuery 删除液体创建列表中的重复项

ruby - 如何在 $SAFE = 1 时加载文件

ruby - Ruby 1.9 中的 Lambda

hyperlink - jekyll本地开发时将site.url改为localhost

html - 在 jekyll 站点中预览博客文章

ruby - 迭代包含散列和/或数组的嵌套散列

ruby-on-rails - #<String :0x00000003a27a58> 的未定义方法 `each'

ruby - 为什么 jekyll --server 返回错误

syntax-error - 液体警告: Unexpected character