github - Jekyll 找不到布局
问题描述
我正在使用 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 repo 中,我在_layouts
文件夹中有布局。archive.html
并且single.html
都在里面。
那么可能导致问题的原因是什么?
一个问题是,我是否应该将所有这些文件放在硬盘上的 git 网站文件夹中?由于我分叉了主题 repo,所以文件都在我的 git repo 上,我的硬盘上没有布局文件。
解决方案
从https://github.com/academicpages/academicpages.github.io中的文档
- 在本地运行(不在 GitHub Pages 上,在您自己的计算机上提供服务)
- 克隆存储库并进行更新,如上所述
- 确保安装了 ruby-dev、bundler 和 nodejs:sudo apt install ruby-dev ruby-bundler nodejs
- 运行 bundle clean 清理目录(无需运行 --force)
- 运行 bundle install 来安装 ruby 依赖项。如果出现错误,请删除 Gemfile.lock 并重试。
- 运行 bundle exec jekyll liveserve 生成 HTML 并从 localhost:4000 提供它,本地服务器将在更改时自动重建和刷新页面。
所以,是的,基本上你克隆 repo 以在你的硬盘上拥有所有文件,然后安装依赖项,最后你在本地使用jekyll serve
or启动你的站点jekyll serve -i
。
推荐阅读
- java - 如果我试图不断检查目录是否存在,最佳实践是什么?JAVA
- android - 哪个版本的 SQLite 添加了对 lead() 和 lag() 函数的支持?
- linux - Getopts 默认案例 bash 脚本
- spring-boot - 如何浏览器测试 Vue.js 应用程序模拟 API 调用?
- angular - 标签 mat-ltab 中 Ngfor 的使用
- javascript - Google Maps API 搜索的迭代 - 首先搜索“i”次,然后回调“i”次
- docker - CircleCI docker 镜像拉取策略
- javascript - 登录时显示用户头像
- javascript - 有没有办法将 h.264 视频流转换为客户端 Javascript 可读的内容?
- python - 为什么 logging.Logger 在 Windows 的新进程中重置其状态?