【问题标题】:Jekyll unable to locate default layoutJekyll 无法找到默认布局
【发布时间】:2020-11-15 20:20:24
【问题描述】:

我有以下文件夹树:

我的 index.html

---
layout: default
title: Home
---
<h1>{{ "Hello World!" | downcase }}</h1>

我的默认.html

<!doctype html>
<html>
  <head>
    <meta charset="utf-8">
    <title>{{ page.title }}</title>
  </head>
  <body>
    {{ include navigation.html }}
    {{ content }}
  </body>
</html>

我的导航.html:

<nav>
    <a href="/">Home</a>
    <a href="/about.html">About</a>
</nav>

我的 about.md:

---
layout: default
title: About
---
# About page

This page tells you a little bit about me.

我正在关注Jekyll website 上的官方文档。我的页面收到以下构建警告:

Configuration file: none
            Source: /Users/doug/Documents/portfolio
       Destination: /Users/doug/Documents/portfolio/_site  Incremental build: disabled. Enable with --incremental
      Generating... 
     Build Warning: Layout 'default' requested in root/about.md does not exist.
     Build Warning: Layout 'default' requested in root/index.html does not exist.
                    done in 0.038 seconds.  Auto-regeneration: enabled for '/Users/doug/Documents/portfolio'
    Server address: http://127.0.0.1:4000   Server running... press ctrl-c to stop.

你对我在这里做错了什么有什么建议吗?我不断查看我的代码并进行比较,但无法确定我错在哪里。我敢肯定这很愚蠢。

感谢您的宝贵时间。

【问题讨论】:

    标签: ruby jekyll


    【解决方案1】:

    需要从根文件夹运行以下命令:

    jekyll serve
    

    引用以下GitHub issue

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2019-11-30
      • 2019-03-13
      • 1970-01-01
      • 1970-01-01
      • 2012-10-22
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多