【问题标题】:Jekyll: ERROR files not foundJekyll:找不到错误文件
【发布时间】:2020-02-07 00:01:06
【问题描述】:

我只是为 github 页面设置了一个本地 jekyll 实例。在遵循 GitHub 上的所有说明并将所有文件放入本地存储库后,我运行了 jekyll (sudo bundle exec jekyll serve)。

我收到以下错误:

^CSeans-MacBook-Air:docs-gh-pages seanmcintyre$ sudo bundle exec jekyll serve
Password:
Configuration file: none
Configuration file: none
            Source: /Users/SnapRouteDocs/docs-gh-pages
       Destination: /Users/SnapRouteDocs/docs-gh-pages/_site
 Incremental build: disabled. Enable with --incremental
      Generating... 
                    done in 0.82 seconds.
 Auto-regeneration: enabled for '/Users/SnapRouteDocs/docs-gh-pages'
Configuration file: none
    Server address: http://127.0.0.1:4000/
  Server running... press ctrl-c to stop.
[2017-04-13 13:35:12] ERROR `/_static/js/modernizr.min.js' not found.
[2017-04-13 13:35:12] ERROR `/_static/js/theme.js' not found.
[2017-04-13 13:35:12] ERROR `/_static/doctools.js' not found.
[2017-04-13 13:35:12] ERROR `/_static/jquery.js' not found.
[2017-04-13 13:35:12] ERROR `/_static/underscore.js' not found.
[2017-04-13 13:35:17] ERROR `/_static/css/theme.css' not found.
[2017-04-13 13:35:17] ERROR `/_static/jquery.js' not found.
[2017-04-13 13:35:17] ERROR `/_static/underscore.js' not found.
[2017-04-13 13:35:17] ERROR `/_static/doctools.js' not found.
[2017-04-13 13:35:17] ERROR `/_static/js/theme.js' not found.

我已经检查过了,所有文件实际上都在那里。

我该如何解决这个问题?

【问题讨论】:

    标签: jekyll


    【解决方案1】:

    可能是因为 Jekyll 不知道它们,所以它们没有编译到构建文件夹 _site 中。尝试将其添加到 _config.yml 文件中:

    include:
      - _static
    

    如果这不起作用,只需删除下划线,Jekyll 就会自动包含在构建中。无论如何,这可能是最好的方法。

    【讨论】:

    • 此方法也适用于以.(隐藏)开头的目录
    【解决方案2】:

    除了@keruilin 的回答,Jekyll 错误如

    ERROR `/resources/biokdd-review-nlp.htm' not found.
    

    有时只是由于在浏览器中打开的 Jekyll 构建的站点页面之一中的 Web URL 格式错误。检查打开的网页,然后重新加载。

    在我的情况下(例如)如果我手动/错误地打开格式错误的 URL

    127.0.0.1:4000/resources/biokdd-review-nlp. html
    

    (注意.html 之前的空格,我收到 Jekyll 错误,直到我更正 URL 并重新加载页面。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-01-03
      • 2013-12-29
      • 2020-08-26
      • 2015-09-06
      相关资源
      最近更新 更多