首页 > 解决方案 > 从 Github 下载了 Jekyll 网站,但它不在本地服务

问题描述

我用 Jekyll 创建了一个网站并将其上传到 github。这让我可以在此处免费托管我的网站(目前主要只是一个模板)回购:

https://github.com/themallardcomplexion/themallardcomplexion.github.io

它使用域名在线服务良好,但我尝试下载并在本地提供服务,但出现以下错误:

配置文件:无 来源:C:/Users/isw/Desktop/Taijisoce/themallardcomplexion.github.io-master 目的地:C:/Users/isw/Desktop/Taijisoce/themallardcomplexion.github.io-master/_site 增量构建:禁用. 启用 --incremental Generating... 构建警告:在 theallardcomplexion.github.io-master/_posts/2019-01-19-welcome-to-jekyll.markdown 中请求的布局“帖子”不存在。构建警告:在 theallardcomplexion.github.io-master/404.html 中请求的布局“默认”不存在。构建警告:在 theallardcomplexion.github.io-master/about.md 中请求的布局“页面”不存在。构建警告:在 theallardcomplexion.github.io-master/index.md 中请求的布局“主页”不存在。在 0.587 秒内完成。自动再生:http://127.0.0.1:4000 服务器正在运行...按 ctrl-c 停止。

它没有格式,只显示一个纯文本站点....有什么想法吗?

我尝试通过 Github 应用程序下载代码并将其下载为 zip

标签: githubjekyll

解决方案


错误来自 Jekyll 为您构建的页面寻找布局。您需要创建一个/_layouts/包含站点所需的所有布局的文件夹:

/_layouts/
  |
  |--default.html
  |
  |--post.html
  |
  |--page.html
  |

这些都对应于即将出现的构建警告。有关更多详细信息,请参阅 Jekyll教程文档

此外,与其下载 repo,不如克隆它。这样您就可以在本地处理更改,然后将更改推送到 GitHub。这是用于克隆 repo的文档的链接


推荐阅读