更新旧的RmarkDown Hugo网站陷入错误

发布于 2025-02-11 12:18:14 字数 1447 浏览 1 评论 0原文

自更新我的个人网站以来已经已经几年了: https://statsbylopez.netlify.com/

该网站建于现在似乎是过时的雨果主题(Hugo-Academic)。

在一台新计算机上,我下载了相同的存储库并进行了更改,但是当试图渲染网站时,会遇到错误。

blogdown:::serve_site()

导致以下错误

Launching the server via the command:
  C:/Users/michael.lopez/AppData/Roaming/Hugo/0.101.0/hugo.exe server --bind 127.0.0.1 -p 4321 --themesDir themes -t hugo-academic -D -F --navigateToChanged
Error: Error building site: failed to render pages: render of "page" failed: "C:\Users\michael.lopez\Documents\GitHub\mlopez\themes\hugo-academic\layouts\_default\single.html:1:3": execute of template failed: template: _default/single.html:1:3: executing "_default/single.html" at <partial "header.html" .>: error calling partial: "C:\Users\michael.lopez\Documents\GitHub\mlopez\themes\hugo-academic\layouts\partials\header.html:9:10": execute of template failed: template: partials/header.html:9:10: executing "partials/header.html" at <.Hugo.Generator>: can't evaluate field Hugo in type *hugolib.pageState

似乎已经过时了( wowchemy ),但是我还不建议知道更改主题(请参见在这里)。

有建议吗?

It's been a few year's since updating my personal website: https://statsbylopez.netlify.com/

That site was built with what now appears to be an outdated Hugo theme (hugo-academic).

On a new computer, I've downloaded the same repo and went to make changes, but when trying to render the site, ran into errors.

blogdown:::serve_site()

Renders the following error

Launching the server via the command:
  C:/Users/michael.lopez/AppData/Roaming/Hugo/0.101.0/hugo.exe server --bind 127.0.0.1 -p 4321 --themesDir themes -t hugo-academic -D -F --navigateToChanged
Error: Error building site: failed to render pages: render of "page" failed: "C:\Users\michael.lopez\Documents\GitHub\mlopez\themes\hugo-academic\layouts\_default\single.html:1:3": execute of template failed: template: _default/single.html:1:3: executing "_default/single.html" at <partial "header.html" .>: error calling partial: "C:\Users\michael.lopez\Documents\GitHub\mlopez\themes\hugo-academic\layouts\partials\header.html:9:10": execute of template failed: template: partials/header.html:9:10: executing "partials/header.html" at <.Hugo.Generator>: can't evaluate field Hugo in type *hugolib.pageState

It appears the original Hugo themes are outdated (wowchemy), but I also know changing themes is not recommended (see here).

Any advice?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

橘香 2025-02-18 12:18:14

这是与。我只是在此处复制答案:

如果您有一个旧网站,曾经有哇的魔术师/学术主题,那么不难使其继续运行。您唯一需要弄清楚的是您当时正在使用的Hugo版本。然后在.rprofile中固定雨果版本(请按照blogdown :: check_site()的提示)。如果您现在不记得该版本,则可以

然后使用blogdown :: install_hugo(“ that_version”)安装雨果版本。

This is the same problem as the one reported in the blogdown Github repo. I'm just copying the answer here:

If you have an old site with the wowchemy/academic theme that used to work, it shouldn't be too hard to make it continue to work. The only thing you need to figure out is which Hugo version you were using at that time. Then pin the Hugo version in .Rprofile (follow the tips of blogdown::check_site()). If you don't remember the version now, you may

  • either view the HTML source of the old site and see if the Hugo version was written there (of the form <meta name="generator" content="Hugo X.Y[.Z]" />

  • or browse the Hugo releases: https://github.com/gohugoio/hugo/releases and guess the version released at about the same time as when your old site was created.

Then install that version of Hugo with blogdown::install_hugo("THAT_VERSION").

垂暮老矣 2025-02-18 12:18:14
  1. 阅读文档。或至少搜索他们以寻找“ hugo.generator”,
  2. 请理解您不需要Hugo.Generator。
  3. 删除它。
  4. 看看它是否构建。
  1. Read the docs. Or at least search them for "hugo.generator"
  2. Understand you don't need Hugo.Generator.
  3. Delete it.
  4. See if it builds.
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文