说明
出于某种原因,如果没有“配置回购名称”,我无法构建或提供我的jekyll网站。我不知道为什么本地构建需要一个repo名称或者如何添加repo名称。
这是第一次发生这种情况。我尝试将默认网站从“minima”迁移到“jekyll-theme-primer”。当我在minima中将其解雇时,它输出了默认值。我迁移了默认帖子index.md和即将布局默认值。它没有启动并抛出这个错误。有人可以指定如何从这里继续前进吗?
输入:
jekyll -v: jekyll 3.7.2
预期行为:
Tobiass-MBP:tobi.codes Tobias$ bundle exec jekyll serve
Configuration file: /Users/Tobias/Jekyll Blog/tobi.codes/_config.yml
Source: /Users/Tobias/Jekyll Blog/tobi.codes/
Destination: /Users/Tobias/Jekyll Blog/tobi.codes/_site
Incremental build: disabled. Enable with --incremental
Generating...
done in 0.62 seconds.
Auto-regeneration: enabled for ' /Users/Tobias/Jekyll Blog/tobi.codes/'
Server address: http://127.0.0.1:4000/
Server running... press ctrl-c to stop.
实际行为:
Tobiass-MBP:tobi.codes Tobias$ bundle exec jekyll serve
Configuration file: /Users/Tobias/Jekyll Blog/tobi.codes/_config.yml
Source: /Users/Tobias/Jekyll Blog/tobi.codes
Destination: /Users/Tobias/Jekyll Blog/tobi.codes/_site
Incremental build: disabled. Enable with --incremental
Generating...
fatal: Not a git repository (or any of the parent directories): .git
fatal: Not a git repository (or any of the parent directories): .git
Liquid Exception: No repo name found. Specify using PAGES_REPO_NWO environment variables, 'repository' in your configuration, or set up an 'origin' git remote pointing to your github.com repository. in /_layouts/default.html
ERROR: YOUR SITE COULD NOT BE BUILT:
------------------------------------
No repo name found. Specify using PAGES_REPO_NWO environment variables, 'repository' in your configuration, or set up an 'origin' git remote pointing to your github.com repository.
答案 0 :(得分:2)
jekyll-theme-primer主题使用jekyll-github-metadata plugin。
调用site.github
时,default layout发生错误,因为您没有配置它。
您可以通过在 _layouts / default.html 中复制此文件并删除第19至23行来消除此错误。
{% if site.github.private != true and site.github.license %}
<div class="footer border-top border-gray-light mt-5 pt-3 text-right text-gray">
This site is open source. {% github_edit_link "Improve this page" %}.
</div>
{% endif %}