在Netlify上部署hugo静态站点

时间:2019-11-25 07:05:07

标签: deployment netlify hugo

我在NETLIFY上从Hugo部署静态站点时遇到问题。

  • 回购链接:https://github.com/glaiveVII/hugo_quickstart

  • 我已经仔细检查了netlify.toml文件,重新设置了基础并重新创建了子模块,但是主题子模块仍然存在问题

  • 我以前从未遇到过此类问题,开发人员日志:

2:57:08 PM: Build ready to start
2:57:17 PM: build-image version: 9e0f207a27642d0115b1ca97cd5e8cebbe492f63
2:57:17 PM: build-image tag: v3.3.2
2:57:17 PM: buildbot version: a2bab682ae0761baa4d123ebd00c57be933655dc
2:57:17 PM: Fetching cached dependencies
2:57:17 PM: Failed to fetch cache, continuing with build
2:57:17 PM: Starting to prepare the repo for build
2:57:18 PM: No cached dependencies found. Cloning fresh repo
2:57:18 PM: git clone https://github.com/glaiveVII/hugo_quickstart
2:57:18 PM: Preparing Git Reference refs/heads/master
2:57:21 PM: Error checking out submodules: Submodule 'themes/ananke' (https://github.com/budparr/gohugo-theme-ananke.git) registered for path 'themes/ananke'
Submodule 'themes/hyde-hyde' (https://github.com/htr3n/hyde-hyde.git) registered for path 'themes/hyde-hyde'
Cloning into '/opt/build/repo/themes/ananke'...
Cloning into '/opt/build/repo/themes/hyde-hyde'...
Submodule path 'themes/ananke': checked out '11246e470dedf8e563af4e215f388ce2bcc4685a'
error: Server does not allow request for unadvertised object 984f6bcfc2385be29cd05246f0eaf3bcfdef18fd
Fetched in submodule path 'themes/hyde-hyde', but it did not contain 984f6bcfc2385be29cd05246f0eaf3bcfdef18fd. Direct fetching of that commit failed.
2:57:21 PM: Failing build: Failed to prepare repo
2:57:21 PM: failed during stage 'preparing repo': Error checking out submodules: Submodule 'themes/ananke' (https://github.com/budparr/gohugo-theme-ananke.git) registered for path 'themes/ananke'
Submodule 'themes/hyde-hyde' (https://github.com/htr3n/hyde-hyde.git) registered for path 'themes/hyde-hyde'
Cloning into '/opt/build/repo/themes/ananke'...
Cloning into '/opt/build/repo/themes/hyde-hyde'...
Submodule path 'themes/ananke': checked out '11246e470dedf8e563af4e215f388ce2bcc4685a'
error: Server does not allow request for unadvertised object 984f6bcfc2385be29cd05246f0eaf3bcfdef18fd
Fetched in submodule path 'themes/hyde-hyde', but it did not contain 984f6bcfc2385be29cd05246f0eaf3bcfdef18fd. Direct fetching of that commit failed.
: exit status 1
2:57:21 PM: Finished processing build request in 4.298914476s
  • 我的netlify.toml文件:
[build]
  publish = "public"
  command = "hugo"

[context.production.environment]
  HUGO_VERSION = "0.59.1"
  HUGO_ENV = "production"
  HUGO_ENABLEGITINFO = "true"
  • 我的子模块文件:
[submodule "themes/ananke"]
    path = themes/ananke
    url = https://github.com/budparr/gohugo-theme-ananke.git

[submodule "themes/hyde-hyde"]
    path = themes/hyde-hyde
    url = https://github.com/htr3n/hyde-hyde.git

  • 我的config.toml文件的重要部分:

languageCode = "en-us"
title = "Julien Pelegri"
theme = "hyde-hyde"

## Basic Configuration
baseurl = "https://pelegri.netlify.com/"
  • 提前感谢您的回复!

1 个答案:

答案 0 :(得分:0)

我解决了我的问题,做了很多事情: -在我的netlify.toml中升级我的hugo版本 - 清除缓存 -重新添加子模块