jekyll - GitHub Pages Jekyll 模板存在问题

标签 jekyll github-pages jekyll-theme github-pages-deploy-action

我在使用 GitHub Pages 个人网站时遇到问题,我想从此模板创建该网站: portfolYOU by YoussefRaafatNasry

我能够弄清楚如何使用 Jekyll 在本地测试该网站,一切都运行良好。当我尝试将项目上传到 GitHub 后。

起初我忘记编辑 _config.yml 文件,该网站在主链接上工作,但转换到所有页面和所有交互元素都出现错误。

编辑 _config.yml 文件后,无法在 GitHub 上加载网站 - 我在 GitHub Actions 中观察到错误(GitHub 自行使用它),但我无法确定其原因。

Run actions/jekyll-build-pages@v1 /usr/bin/docker run --name ghcrioactionsjekyllbuildpagesv104_23b786 --label ea425b --workdir /github/workspace --rm -e "INPUT_SOURCE" -e "INPUT_DESTINATION" -e "INPUT_FUTURE" -e "INPUT_BUILD_REVISION" -e "INPUT_VERBOSE" -e "INPUT_TOKEN" -e "HOME" -e "GITHUB_JOB" -e "GITHUB_REF" -e "GITHUB_SHA" -e "GITHUB_REPOSITORY" -e "GITHUB_REPOSITORY_OWNER" -e "GITHUB_REPOSITORY_OWNER_ID" -e "GITHUB_RUN_ID" -e "GITHUB_RUN_NUMBER" -e "GITHUB_RETENTION_DAYS" -e "GITHUB_RUN_ATTEMPT" -e "GITHUB_REPOSITORY_ID" -e "GITHUB_ACTOR_ID" -e "GITHUB_ACTOR" -e "GITHUB_TRIGGERING_ACTOR" -e "GITHUB_WORKFLOW" -e "GITHUB_HEAD_REF" -e "GITHUB_BASE_REF" -e "GITHUB_EVENT_NAME" -e "GITHUB_SERVER_URL" -e "GITHUB_API_URL" -e "GITHUB_GRAPHQL_URL" -e "GITHUB_REF_NAME" -e "GITHUB_REF_PROTECTED" -e "GITHUB_REF_TYPE" -e "GITHUB_WORKFLOW_REF" -e "GITHUB_WORKFLOW_SHA" -e "GITHUB_WORKSPACE" -e "GITHUB_ACTION" -e "GITHUB_EVENT_PATH" -e "GITHUB_ACTION_REPOSITORY" -e "GITHUB_ACTION_REF" -e "GITHUB_PATH" -e "GITHUB_ENV" -e "GITHUB_STEP_SUMMARY" -e "GITHUB_STATE" -e "GITHUB_OUTPUT" -e "RUNNER_OS" -e "RUNNER_ARCH" -e "RUNNER_NAME" -e "RUNNER_TOOL_CACHE" -e "RUNNER_TEMP" -e "RUNNER_WORKSPACE" -e "ACTIONS_RUNTIME_URL" -e "ACTIONS_RUNTIME_TOKEN" -e "ACTIONS_CACHE_URL" -e "ACTIONS_ID_TOKEN_REQUEST_URL" -e "ACTIONS_ID_TOKEN_REQUEST_TOKEN" -e GITHUB_ACTIONS=true -e CI=true -v "/var/run/docker.sock":"/var/run/docker.sock" -v "/home/runner/work/_temp/_github_home":"/github/home" -v "/home/runner/work/_temp/_github_workflow":"/github/workflow" -v "/home/runner/work/_temp/_runner_file_commands":"/github/file_commands" -v "/home/runner/work/evklo.github.io/evklo.github.io":"/github/workspace" ghcr.io/actions/jekyll-build-pages:v1.0.4 Logging at level: debug Configuration file: /github/workspace/./_config.yml GitHub Pages: github-pages v227 GitHub Pages: jekyll v3.9.2 Theme: jekyll-theme-primer Theme source: /usr/local/bundle/gems/jekyll-theme-primer-0.6.0 Requiring: jekyll-github-metadata To use retry middleware with Faraday v2.0+, install faraday-retry gem Liquid Exception: Could not locate the included file 'elements/highlight.html' in any of ["/github/workspace/_includes"]. Ensure it exists in one of those directories and is not a symlink as those are not allowed in safe mode. in /github/workspace/_posts/2018-12-01-what-the-heck-is-a-callback.md /usr/local/bundle/gems/jekyll-3.9.2/lib/jekyll/tags/include.rb:121:in locate_include_file': Could not locate the included file 'elements/highlight.html' in any of ["/github/workspace/_includes"]. Ensure it exists in one of those directories and is not a symlink as those are not allowed in safe mode. (IOError) from /usr/local/bundle/gems/jekyll-3.9.2/lib/jekyll/tags/include.rb:130:in render' from /usr/local/bundle/gems/liquid-4.0.3/lib/liquid/block_body.rb:103:in render_node_to_output' from /usr/local/bundle/gems/liquid-4.0.3/lib/liquid/block_body.rb:91:in render' from /usr/local/bundle/gems/liquid-4.0.3/lib/liquid/template.rb:208:in block in render' from /usr/local/bundle/gems/liquid-4.0.3/lib/liquid/template.rb:242:in with_profiling' from /usr/local/bundle/gems/liquid-4.0.3/lib/liquid/template.rb:207:in render' from /usr/local/bundle/gems/liquid-4.0.3/lib/liquid/template.rb:220:in render!' from /usr/local/bundle/gems/jekyll-3.9.2/lib/jekyll/liquid_renderer/file.rb:30:in block (2 levels) in render!' from /usr/local/bundle/gems/jekyll-3.9.2/lib/jekyll/liquid_renderer/file.rb:42:in measure_bytes' from /usr/local/bundle/gems/jekyll-3.9.2/lib/jekyll/liquid_renderer/file.rb:29:in block in render!' from /usr/local/bundle/gems/jekyll-3.9.2/lib/jekyll/liquid_renderer/file.rb:49:in measure_time' from /usr/local/bundle/gems/jekyll-3.9.2/lib/jekyll/liquid_renderer/file.rb:28:in render!' from /usr/local/bundle/gems/jekyll-3.9.2/lib/jekyll/renderer.rb:126:in render_liquid' from /usr/local/bundle/gems/jekyll-3.9.2/lib/jekyll/renderer.rb:79:in render_document' from /usr/local/bundle/gems/jekyll-3.9.2/lib/jekyll/renderer.rb:62:in run' from /usr/local/bundle/gems/jekyll-3.9.2/lib/jekyll/site.rb:479:in render_regenerated' from /usr/local/bundle/gems/jekyll-3.9.2/lib/jekyll/site.rb:464:in block (2 levels) in render_docs' from /usr/local/bundle/gems/jekyll-3.9.2/lib/jekyll/site.rb:463:in each' from /usr/local/bundle/gems/jekyll-3.9.2/lib/jekyll/site.rb:463:in block in render_docs' from /usr/local/bundle/gems/jekyll-3.9.2/lib/jekyll/site.rb:462:in each_value' from /usr/local/bundle/gems/jekyll-3.9.2/lib/jekyll/site.rb:462:in render_docs' from /usr/local/bundle/gems/jekyll-3.9.2/lib/jekyll/site.rb:191:in render' from /usr/local/bundle/gems/jekyll-3.9.2/lib/jekyll/site.rb:71:in process' from /usr/local/bundle/gems/jekyll-3.9.2/lib/jekyll/command.rb:28:in process_site' from /usr/local/bundle/gems/jekyll-3.9.2/lib/jekyll/commands/build.rb:65:in build' from /usr/local/bundle/gems/jekyll-3.9.2/lib/jekyll/commands/build.rb:36:in process' from /usr/local/bundle/gems/github-pages-227/bin/github-pages:70:in block (3 levels) in <top (required)>' from /usr/local/bundle/gems/mercenary-0.3.6/lib/mercenary/command.rb:220:in block in execute' from /usr/local/bundle/gems/mercenary-0.3.6/lib/mercenary/command.rb:220:in each' from /usr/local/bundle/gems/mercenary-0.3.6/lib/mercenary/command.rb:220:in execute' from /usr/local/bundle/gems/mercenary-0.3.6/lib/mercenary/program.rb:42:in go' from /usr/local/bundle/gems/mercenary-0.3.6/lib/mercenary.rb:19:in program' from /usr/local/bundle/gems/github-pages-227/bin/github-pages:6:in <top (required)>' from /usr/local/bundle/bin/github-pages:23:in load' from /usr/local/bundle/bin/github-pages:23:in ' Requiring: jekyll-seo-tag Requiring: jemoji Requiring: jekyll-coffeescript Requiring: jekyll-commonmark-ghpages Requiring: jekyll-gist Requiring: jekyll-github-metadata Requiring: jekyll-paginate Requiring: jekyll-relative-links Requiring: jekyll-optional-front-matter Requiring: jekyll-readme-index Requiring: jekyll-default-layout Requiring: jekyll-titles-from-headings Requiring: jekyll-remote-theme GitHub Metadata: Initializing... Source: /github/workspace/. Destination: /github/workspace/./_site Incremental build: disabled. Enable with --incremental Generating... Theme: evklo/evklo.github.io Theme source: /tmp/jekyll-remote-theme-20230123-7-1e2b06p Remote Theme: Using theme evklo/evklo.github.io Remote Theme: Downloading https://codeload.github.com/evklo/evklo.github.io/zip/HEAD to /tmp/jekyll-remote-theme-20230123-7-zbex2n.zip Remote Theme: Unzipping /tmp/jekyll-remote-theme-20230123-7-zbex2n.zip to /tmp/jekyll-remote-theme-20230123-7-1e2b06p Reading: _posts/2016-07-23-a-better-hello-world.md Reading: _posts/2016-02-09-what-is-version-control.md Reading: _posts/2019-02-15-learn-react-js.md Reading: _posts/2018-12-01-what-the-heck-is-a-callback.md Reading: _posts/2015-09-25-how-to-undo-your-git-failure.md Reading: _posts/2019-02-20-digital-minimalism.md Reading: _posts/2018-12-10-clean-coding.md Reading: _posts/2018-05-09-four-lessons-after-eleven-years-in-silicon-valley.md Reading: _posts/2016-04-17-do-not-go-gentle-into-that-good-night.md Reading: _posts/2017-01-01-github-flow.md Reading: _projects/(2) Awesome Project.md Reading: _projects/(6) Dummy Project.md Reading: _projects/(1) PlaceHolder Project.md Reading: _projects/(4) VVG on GitHub.md Reading: _projects/(5) The Fabulous.md Reading: _projects/(3) Empty Project.md Generating: JekyllOptionalFrontMatter::Generator finished in 4.24e-05 seconds. Generating: JekyllReadmeIndex::Generator finished in 5.13e-05 seconds. Generating: Jekyll::Paginate::Pagination finished in 8.5e-06 seconds. Generating: JekyllRelativeLinks::Generator finished in 4.8201e-05 seconds. Generating: JekyllDefaultLayout::Generator finished in 0.002420515 seconds. Generating: JekyllTitlesFromHeadings::Generator finished in 5.65e-05 seconds. Rendering: _posts/2015-09-25-how-to-undo-your-git-failure.md Pre-Render Hooks: _posts/2015-09-25-how-to-undo-your-git-failure.md Rendering Markup: _posts/2015-09-25-how-to-undo-your-git-failure.md Requiring: kramdown-parser-gfm Rendering Layout: _posts/2015-09-25-how-to-undo-your-git-failure.md Rendering: _posts/2016-02-09-what-is-version-control.md Pre-Render Hooks: _posts/2016-02-09-what-is-version-control.md Rendering Markup: _posts/2016-02-09-what-is-version-control.md Rendering Layout: _posts/2016-02-09-what-is-version-control.md Rendering: _posts/2016-04-17-do-not-go-gentle-into-that-good-night.md Pre-Render Hooks: _posts/2016-04-17-do-not-go-gentle-into-that-good-night.md Rendering Markup: _posts/2016-04-17-do-not-go-gentle-into-that-good-night.md Rendering Layout: _posts/2016-04-17-do-not-go-gentle-into-that-good-night.md Rendering: _posts/2016-07-23-a-better-hello-world.md Pre-Render Hooks: _posts/2016-07-23-a-better-hello-world.md Rendering Markup: _posts/2016-07-23-a-better-hello-world.md Rendering Layout: _posts/2016-07-23-a-better-hello-world.md Rendering: _posts/2017-01-01-github-flow.md Pre-Render Hooks: _posts/2017-01-01-github-flow.md Rendering Markup: _posts/2017-01-01-github-flow.md Rendering Layout: _posts/2017-01-01-github-flow.md Rendering: _posts/2018-05-09-four-lessons-after-eleven-years-in-silicon-valley.md Pre-Render Hooks: _posts/2018-05-09-four-lessons-after-eleven-years-in-silicon-valley.md Rendering Markup: _posts/2018-05-09-four-lessons-after-eleven-years-in-silicon-valley.md Rendering Layout: _posts/2018-05-09-four-lessons-after-eleven-years-in-silicon-valley.md Rendering: _posts/2018-12-01-what-the-heck-is-a-callback.md Pre-Render Hooks: _posts/2018-12-01-what-the-heck-is-a-callback.md Rendering Liquid: _posts/2018-12-01-what-the-heck-is-a-callback.md github-pages 227 | Error: Could not locate the included file 'elements/highlight.html' in any of ["/github/workspace/_includes"]. Ensure it exists in one of those directories and is not a symlink as those are not allowed in safe mode. Remote Theme: Cleaning up /tmp/jekyll-remote-theme-20230123-7-1e2b06p

我请求您帮助理解这个项目的部署并解决这个问题。

如果有用,请提供我的测试 GitHub 的链接:

My test GitHub

最佳答案

问题似乎出在您的主题上,您要使用的主题不是“受支持的主题”,因此必须通过 remote_theme 添加它。

在您的配置中,您将站点存储库列为远程主题,但存储库中没有主题信息。您的帖子链接了您想要使用的主题 - 要使用它,配置中的远程主题应如下所示:

remote_theme:  YoussefRaafatNasry/portfolYOU

查看 Github 页面 docs on themes

关于jekyll - GitHub Pages Jekyll 模板存在问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/75212400/

相关文章:

css - sass 无法编译,文件不可读或找不到

ruby - 在 Linux Mint 上安装 Jekyll,从未被识别

html - 在 Jekyll 模板中自定义 CSS 样式

css - 覆盖 SCSS 属性

ruby - 尝试在 Windows 8 (x64) : Error installing fast-stemmer-1. 0.2.gem 上安装 Jekyll

css - Markdown 无法使用 Jekyll 正确呈现(尽管我怀疑 CSS 是罪魁祸首)

html - 设置 GitHub Pages 元素页面。页面打开但图像和 main.css 未加载

ssl - Github 页面没有看到 CNAME 或设置 SSL?

node.js - Socket.io 和 Express ERR_SSL_VERSION_OR_CIPHER_MISMATCH