Ruby 静态文件不';我不会出现在杰基尔

Ruby 静态文件不';我不会出现在杰基尔,ruby,static,jekyll,Ruby,Static,Jekyll,我正试图按照Jekyll文档中的以下基本步骤在我的页面中打印静态图像: 我的文件位于assets/img中,我的配置文件有以下几行(空格缩进) 我有一个全新的网站。现在在我的about.md页面中,我想打印所有图像: {% assign image_files = site.static_files | where: "image", true %} {% for myimage in image_files %} {{ myimage.path }} {% endf

我正试图按照Jekyll文档中的以下基本步骤在我的页面中打印静态图像:

我的文件位于
assets/img
中,我的配置文件有以下几行(空格缩进)

我有一个全新的网站。现在在我的
about.md
页面中,我想打印所有图像:

{% assign image_files = site.static_files | where: "image", true %}

{% for myimage in image_files %}
  {{ myimage.path }}
{% endfor %}
不用说,它不会打印任何东西

虽然我可以打印
{{site.static_files | inspect}}
包括所有文件:字体、图像、拉链等,但我无法打印
image_文件
变量,也无法打印
myimage


发生了什么?

在根项目中创建文件夹
assets
img
assets
文件夹中。 将您的图像放入
img

示例

myblog
.
├── 404.html
├── about.md
├── assets
│   └── img
│       └── filename.png
defaults:
  - scope:
      path: "assets/img"
    values:
      image: true
\u config.yml中:

myblog
.
├── 404.html
├── about.md
├── assets
│   └── img
│       └── filename.png
defaults:
  - scope:
      path: "assets/img"
    values:
      image: true
在您的帖子中,例如:
about.md
,写下这样的内容:

{% assign image_files = site.static_files | where: "image", true %}
{% for myimage in image_files %}
  ![{{myimage.name}}]({{ myimage.path }})
{% endfor %}

在根项目中,在
assets
文件夹内创建文件夹
assets
img
。 将您的图像放入
img

示例

myblog
.
├── 404.html
├── about.md
├── assets
│   └── img
│       └── filename.png
defaults:
  - scope:
      path: "assets/img"
    values:
      image: true
\u config.yml中:

myblog
.
├── 404.html
├── about.md
├── assets
│   └── img
│       └── filename.png
defaults:
  - scope:
      path: "assets/img"
    values:
      image: true
在您的帖子中,例如:
about.md
,写下这样的内容:

{% assign image_files = site.static_files | where: "image", true %}
{% for myimage in image_files %}
  ![{{myimage.name}}]({{ myimage.path }})
{% endfor %}

你把资产文件夹放在哪里了?你把资产文件夹放在哪里了?