如何访问集合中的静态文件?

时间:2019-03-24 20:44:54

标签: jekyll github-pages

如何访问集合中的静态文件?

(我认为)我已经按照

上的说明进行操作

https://jekyllrb.com/docs/collections/

我创建了一个目录In [220]: arr.sum(0, keepdims=True)==0 Out[220]: array([[False, False, False, True]]) In [221]: arr.sum(1, keepdims=True)==0 Out[221]: array([[False], [False], [ True], [False]]) In [222]: np.where(_220 & _221) # Out[220] etc Out[222]: (array([2]), array([3])) 和静态文件./_test./_test/a,并在./_test/b中添加了一个相应的收集条目:

_config.yml

此后,我不能使用collections: - test 来获取包含文件site.test.files./_test/a的数组(根据我对上述Jekyll文档的解释,这应该是可能的)。

(我使用GitHub-Pages提供的Jekyll版本。)

1 个答案:

答案 0 :(得分:2)

假设您同时具有yaml开头的文件和静态文件witch,这些文件都不会被jekyll处理。可以按以下方式访问这些文件:

  • 具有首要事项的文件:

    export const ResetPasswordByTokenMutation = {
        type: UserType,
        description: 'Sets a new password and sends an informing email with the password generated',
        args: {
            token: { type: new GraphQLNonNull(GraphQLString) },
            captcha: { type: GraphQLString },
        },
        resolve: async (root, args, request) => {
            const ip = getRequestIp(request);
            const user = await Auth.resetPasswordByToken(ip, args);
            return user.toJSON();
        }
    };
    
  • 静态文件:

    {% assign test_docs = site.test %}
    {{ test_docs }}
    

正如您明确要求的静态文件一样,在{% assign test_coll = site.collections | where: "label", "test" | first %} {{ test_coll.files }} 上面的代码中包含同时包含文件{{ test_coll.files }}/_test/a的数组。 但是,仅当这些文件没有Yaml前题。

相关问题