【问题标题】:Liquid ignoring _config.yml infos for jekyll themeLiquid 忽略 jekyll 主题的 _config.yml 信息
【发布时间】:2016-09-11 14:47:00
【问题描述】:

我是 jekyll 的新手,我阅读了他们网站上的信息并做了基本的工作,一切正常。现在,我正在尝试通过为它做一个主题来了解更多。我的想法是我有一个 html 模板,我正试图让它成为 jekyll。回购地址为prologue-like-jekyll-theme。

我有一个包含一些信息的 _config.yml:

# Site settings
title: Personal Jekyll theme based on Prologue by HTML5 UP.
description: "Write your site description here."
baseurl: ""
url: ""
avatar: images/avatar.png
email: your-email@yourdomain.com
copyright_name: Your/Project/Corporate Name

我做了一个 default.html 布局:

<!DOCTYPE HTML>
<html>
    <head>
    <title>{{ site.title }}</title>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1" />
    <!--[if lte IE 8]><script src="assets/js/ie/html5shiv.js"></script><![endif]-->
    <link rel="stylesheet" href="assets/css/main.css" />
    <!--[if lte IE 8]><link rel="stylesheet" href="assets/css/ie8.css" /><![endif]-->
    <!--[if lte IE 9]><link rel="stylesheet" href="assets/css/ie9.css" /><![endif]-->
</head>
<body>

    <!-- Header -->
        {% include header.html %}

    <!-- Main -->
    <div id="main">
        {{ content }}
    </div>

    <!-- Footer -->
    {% include footer.html %}

    </body>
</html>

我执行jekyll server,它运行但site.title 没有加载。有趣的是,如果我更改为site.time,它会起作用。不知道为什么会这样,有什么线索吗?

【问题讨论】:

    标签: themes jekyll liquid


    【解决方案1】:

    _config.yml 文件在_layouts 文件夹中,它应该在根文件夹中。

    【讨论】:

    • 感谢您的宝贵时间和回复!我没有意识到我在_layout 文件夹中创建了_config.yml,而不是在根目录中!
    猜你喜欢
    • 1970-01-01
    • 2012-04-21
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-12-12
    • 2019-02-17
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多