今天按照教程成功在本地可以通过blogdown::serversite()
预览到写好的网页,但是在build
之后将public文件夹上传到github之后然后使用netlify部署过程中出错了,并且报错再别处都没有找到。
5:49:54 PM: 1. build.command from netlify.toml
5:49:54 PM: ────────────────────────────────────────────────────────────────
5:49:54 PM:
5:49:54 PM: $ hugo
5:49:54 PM: Start building sites …
5:49:54 PM: Total in 18 ms
5:49:54 PM: Error: Error building site: "/opt/build/repo/content/post/2021-05-28-statistical-software-home-work/index.html:11:14": failed to extract shortcode: template for shortcode "blogdown/postref" not found
5:49:54 PM:
5:49:54 PM: ────────────────────────────────────────────────────────────────
5:49:54 PM: "build.command" failed
5:49:54 PM: ────────────────────────────────────────────────────────────────
5:49:54 PM:
5:49:54 PM: Error message
5:49:54 PM: Command failed with exit code 255: hugo
5:49:54 PM:
5:49:54 PM: Error location
5:49:54 PM: In build.command from netlify.toml:
5:49:54 PM: hugo
5:49:54 PM:
5:49:54 PM: Resolved config
5:49:54 PM: build:
5:49:54 PM: command: hugo
5:49:54 PM: commandOrigin: config
5:49:54 PM: environment:
5:49:54 PM: - HUGO_VERSION
5:49:54 PM: - HUGO_ENV
5:49:54 PM: publish: /opt/build/repo/public
5:49:54 PM: functions:
5:49:54 PM: '*': {}
5:49:54 PM: Caching artifacts
5:49:54 PM: Started saving build plugins
5:49:54 PM: Finished saving build plugins
5:49:54 PM: Started saving pip cache
5:49:54 PM: Finished saving pip cache
5:49:54 PM: Started saving emacs cask dependencies
5:49:54 PM: Finished saving emacs cask dependencies
5:49:54 PM: Started saving maven dependencies
5:49:55 PM: Finished saving maven dependencies
5:49:55 PM: Started saving boot dependencies
5:49:55 PM: Finished saving boot dependencies
5:49:55 PM: Started saving rust rustup cache
5:49:55 PM: Finished saving rust rustup cache
5:49:55 PM: Started saving go dependencies
5:49:55 PM: Finished saving go dependencies
5:49:57 PM: Build failed due to a user error: Build script returned non-zero exit code: 2
5:49:57 PM: Creating deploy upload records
5:49:57 PM: Failing build: Failed to build site
5:49:57 PM: Failed during stage 'building site': Build script returned non-zero exit code: 2
5:49:57 PM: Finished processing build request in 11.437927875s
这里面好像是说缺少模板文件,可是我是按照教程都上传到github仓库中了,不知道大家有什么解决方法,不胜感激。