Hugo Error - 当前主题不支持当前版本

时间:2017-09-10 22:49:15

标签: linux amazon-web-services ubuntu amazon-s3 hugo

我正在尝试构建我的hugo网站但是当我运行hugo check时,我看到以下错误日志:

ERROR: 2017/09/10 Current theme does not support Hugo version 0.14. Minimum version required is 0.18
ERROR: 2017/09/10 template: theme/_default/baseof.html:2: function "default" not defined
ERROR: 2017/09/10 template: redefinition of template "main"
ERROR: 2017/09/10 template: theme/_default/single.html:7: function "humanize" not defined
ERROR: 2017/09/10 template: redefinition of template "main"
ERROR: 2017/09/10 template: theme/_default/terms.html:12: function "relLangURL" not defined
ERROR: 2017/09/10 template: theme/index.html:6: function "default" not defined
ERROR: 2017/09/10 template: theme/partials/menu-contextual.html:12: function "humanize" not defined
ERROR: 2017/09/10 template: theme/partials/page-header.html:9: function "default" not defined
ERROR: 2017/09/10 template: theme/partials/site-footer.html:4: function "now" not defined
ERROR: 2017/09/10 template: theme/partials/site-header.html:1: function "default" not defined
ERROR: 2017/09/10 template: theme/partials/social-follow.html:5: function "dict" not defined
ERROR: 2017/09/10 template: theme/partials/summary.html:3: function "humanize" not defined
ERROR: 2017/09/10 template: theme/post/single.html:11: function "humanize" not defined
ERROR: 2017/09/10 template: redefinition of template "main"

它说我需要Hugo版本0.18但是当我运行sudo apt-get install hugo它告诉我:

hugo is already the newest version
0 upgraded, 0 newly installed, 0 to remove and 15 not upgraded.

所以我很困惑为什么我会收到错误。有没有人遇到这个错误?知道如何解决它吗?

2 个答案:

答案 0 :(得分:11)

Ubuntu的主要下载存储库由Canonical维护,对于GoHugo最新版本而言,它们已过时。因此,sudo apt upgrade hugo不会有太大帮助。即使是现在,Hugo的最新版本是8月份的0.48,但apt只给我最多0.40的日期(截至4月份)。

  

始终尝试在Ubuntu中使用sudo snap install hugo以获得Go Hugo的最新体验。快照的维护和更新非常好。因此,即使您错过手动更新程序包的时间,它也会在到达Snap Store后的12小时内在后台无缝更新。

     

卸载Hugo的所有实例,并尝试使用快照进行全新安装,因为新版本总是倾向于保留对某些旧配置的支持。您可以尝试使用sudo snap search hugo验证所需的hugo版本,该版本详细说明了快照存储中当前提供了哪个最新版本。

     

或者您可以手动下载最新版本link并更新您的版本,最后检查sudo hugo version。您还可以通过whereis hugo确认其在系统中的主要位置,并将其替换为较新的版本。

答案 1 :(得分:1)

如果您没有使用apt获取最新版本的Hugo,那么您应该尝试直接从Github repository下载它。单击最新版本(或您需要的任何版本)。进入发布页面后,向下滚动到“下载”部分,然后通过单击该文件或使用wget下载压缩文件来下载该文件。然后解压缩文件并运行./hugo version以确认版本。

相关问题