更新旧的RmarkDown Hugo网站陷入错误
自更新我的个人网站以来已经已经几年了: 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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这是与。我只是在此处复制答案:
如果您有一个旧网站,曾经有哇的魔术师/学术主题,那么不难使其继续运行。您唯一需要弄清楚的是您当时正在使用的Hugo版本。然后在
.rprofile
中固定雨果版本(请按照blogdown :: check_site()
的提示)。如果您现在不记得该版本,则可以查看旧站点的HTML源,然后查看是否写过雨果版本(form
&lt; meta name =“ generator” content = of form
&lt; lt>&lt; “ Hugo xy [.z]”/&gt;
或浏览雨果发行: https://github.com/gohugoioio/hugoio/hugo/hugo/relealeases 并猜测与创建旧站点时大约同时发布的版本。
然后使用
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 ofblogdown::check_site()
). If you don't remember the version now, you mayeither 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")
.