尝试构建或使用新主题时出现 Git 相关错误
Getting an Git related Error when trying to build or serve with new theme
描述:
出于某种原因,我无法在没有 "configuring a repo name" 的情况下构建或提供我的 jekyll 站点。我不知道为什么本地构建需要一个回购名称或如何添加回购名称。
这是第一次出现这种情况。我尝试将默认站点从 "minima" 迁移到 "jekyll-theme-primer"。当我以最小值启动它时,它输出默认的一面。我迁移了默认 post、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.
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 %}
描述:
出于某种原因,我无法在没有 "configuring a repo name" 的情况下构建或提供我的 jekyll 站点。我不知道为什么本地构建需要一个回购名称或如何添加回购名称。
这是第一次出现这种情况。我尝试将默认站点从 "minima" 迁移到 "jekyll-theme-primer"。当我以最小值启动它时,它输出默认的一面。我迁移了默认 post、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.
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 %}