【问题标题】:Jekyll can't find layoutJekyll 找不到布局
【发布时间】:2019-11-30 00:51:28
【问题描述】:

我正在使用 git page 制作一个 github 网站。我正在使用academicpages/academicpages.github.io。我将此 repo 复制到我的 gitpage repo,并编辑了 /_pages 文件夹中的页面。但是当我使用 jekyll 构建网站时,我得到以下信息:

  Jekyll Feed: Generating feed for posts
 Build Warning: Layout 'single' requested in pages/about.md does not exist.
 Build Warning: Layout 'archive' requested in pages/dissertation.md does not exist.
 Build Warning: Layout 'archive' requested in pages/research.md does not exist.
 Build Warning: Layout 'archive' requested in pages/software does not exist.
 Build Warning: Layout 'archive' requested in pages/teaching.md does not exist.

我没有关注这个,因为在我创建的 git 存储库中,我在 _layouts 文件夹中有布局。 archive.htmlsingle.html 都在里面。

那么可能是什么导致了问题呢?

一个问题是,我是否应该将所有这些文件放在我硬盘上的 git 网站文件夹中?由于我 fork 主题 repo,文件都在我的 git repo 上,我的硬盘上没有布局文件。

【问题讨论】:

  • 你能链接你的github repo吗?如果我能看到您对/_pages 文件夹所做的更改,将更容易帮助您调试问题。
  • 请更新 repo 链接。我猜你的意思是academicpages/academicpages.github.io

标签: github jekyll


【解决方案1】:

来自https://github.com/academicpages/academicpages.github.io中的文档

  1. 在本地运行(不在 GitHub Pages 上,在您自己的计算机上提供服务)
  2. 克隆存储库并进行更新,如上所述
  3. 确保您已安装 ruby​​-dev、bundler 和 nodejs:sudo apt install ruby​​-dev ruby​​-bundler nodejs
  4. 运行 bundle clean 清理目录(无需运行 --force)
  5. 运行 bundle install 来安装 ruby​​ 依赖项。如果出现错误,请删除 Gemfile.lock 并重试。
  6. 运行 bundle exec jekyll liveserve 生成​​ HTML 并从 localhost:4000 提供它,本地服务器将在更改时自动重建和刷新页面。

所以,是的,基本上你克隆 repo 以在你的硬盘上拥有所有文件,然后安装依赖项,最后你使用 jekyll servejekyll serve -i 在本地启动你的站点。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2017-02-14
    • 2018-04-13
    • 2019-05-25
    • 1970-01-01
    • 1970-01-01
    • 2018-05-15
    • 1970-01-01
    相关资源
    最近更新 更多