尝试使用新主题构建或提供服务时出现 Git 相关错误

Tob*_*olb 5 git rubygems ruby-on-rails jekyll

描述:

出于某种原因,如果不“配置存储库名称”,我就无法构建或提供我的 jekyll 站点。我不知道为什么本地构建需要一个 repo 名称或如何添加 repo 名称。

这是第一次发生这种情况。我试图将默认站点从“minima”迁移到“jekyll-theme-primer”。当我以最小值启动它时,它向我输出了默认的一面。我迁移了默认帖子,index.md 并即将布局默认。它没有启动并抛出这个错误。有人可以指定如何从这里继续前进吗?

输入:

jekyll -v: jekyll 3.7.2
Run Code Online (Sandbox Code Playgroud)

预期行为:

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.
Run Code Online (Sandbox Code Playgroud)

实际行为:

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.
Run Code Online (Sandbox Code Playgroud)

Dav*_*uel 4

jekyll-theme-primer 主题使用jekyll-github-metadata 插件

调用时在默认布局中发生错误site.github,因为您没有配置它。

您可以通过复制_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 %}
Run Code Online (Sandbox Code Playgroud)