hugo --baseURL
编译错误
#195
-
用github给的模板发布pages,之前用没问题,最近编译报错,我在本地编译了一次,应该是--baseURL导致的。 # Sample workflow for building and deploying a Hugo site to GitHub Pages
name: Deploy Hugo site to Pages
on:
# Runs on pushes targeting the default branch
push:
branches: ["master"]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write
# Allow one concurrent deployment
concurrency:
group: "pages"
cancel-in-progress: true
# Default to bash
defaults:
run:
shell: bash
jobs:
# Build job
build:
runs-on: ubuntu-20.04
env:
HUGO_VERSION: 0.101.0
steps:
- name: Install Hugo CLI
run: |
wget -O ${{ runner.temp }}/hugo.deb https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_Linux-64bit.deb \
&& sudo dpkg -i ${{ runner.temp }}/hugo.deb
- name: Checkout
uses: actions/checkout@v3
with:
submodules: recursive
- name: Setup Pages
id: pages
uses: actions/configure-pages@v1
- name: Build with Hugo
run: |
hugo \
--minify \
--baseURL ${{ steps.pages.outputs.base_url }}
- name: Upload artifact
uses: actions/upload-pages-artifact@v1
with:
path: ./public
# Deployment job
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-20.04
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v1 本地的编译报错 ❯ hugo --minify --baseURL xueweiwujxw.github.io/xww_blog
Start building sites …
hugo v0.101.0-466fa43c16709b4483689930a4f9ac8add5c9f66+extended linux/amd64 BuildDate=2022-06-16T07:09:16Z VendorInfo=gohugoio
WARN 2022/09/12 15:00:07 FixIt v0.2.16-RC
您正在使用开发版的 FixIt,请考虑使用稳定版。
见 https://github.com/hugo-fixit/FixIt/releases
ERROR 2022/09/12 15:00:07 render of "page" failed: "/home/wlanxww/Projects/personal/xww_blog/themes/FixIt/layouts/_default/baseof.html:36:8": execute of template failed: template: _default/single.html:36:8: executing "_default/single.html" at <partial "assets.html" .>: error calling partial: "/home/wlanxww/Projects/personal/xww_blog/themes/FixIt/layouts/partials/assets.html:279:6": execute of template failed: template: partials/assets.html:279:6: executing "partials/assets.html" at <partial "plugin/script.html" .>: error calling partial: "/home/wlanxww/Projects/personal/xww_blog/themes/FixIt/layouts/partials/plugin/script.html:15:36": execute of template failed: template: partials/plugin/script.html:15:36: executing "partials/plugin/script.html" at <minify>: wrong type for value; expected resources.ResourceTransformer; got resource.Resource
ERROR 2022/09/12 15:00:07 render of "taxonomy" failed: "/home/wlanxww/Projects/personal/xww_blog/themes/FixIt/layouts/_default/baseof.html:36:8": execute of template failed: template: taxonomy/terms.html:36:8: executing "taxonomy/terms.html" at <partial "assets.html" .>: error calling partial: "/home/wlanxww/Projects/personal/xww_blog/themes/FixIt/layouts/partials/assets.html:279:6": execute of template failed: template: partials/assets.html:279:6: executing "partials/assets.html" at <partial "plugin/script.html" .>: error calling partial: "/home/wlanxww/Projects/personal/xww_blog/themes/FixIt/layouts/partials/plugin/script.html:15:36": execute of template failed: template: partials/plugin/script.html:15:36: executing "partials/plugin/script.html" at <minify>: wrong type for value; expected resources.ResourceTransformer; got resource.Resource
ERROR 2022/09/12 15:00:07 render of "page" failed: "/home/wlanxww/Projects/personal/xww_blog/themes/FixIt/layouts/_default/baseof.html:36:8": execute of template failed: template: posts/single.html:36:8: executing "posts/single.html" at <partial "assets.html" .>: error calling partial: "/home/wlanxww/Projects/personal/xww_blog/themes/FixIt/layouts/partials/assets.html:279:6": execute of template failed: template: partials/assets.html:279:6: executing "partials/assets.html" at <partial "plugin/script.html" .>: error calling partial: "/home/wlanxww/Projects/personal/xww_blog/themes/FixIt/layouts/partials/plugin/script.html:15:36": execute of template failed: template: partials/plugin/script.html:15:36: executing "partials/plugin/script.html" at <minify>: wrong type for value; expected resources.ResourceTransformer; got resource.Resource
ERROR 2022/09/12 15:00:07 render of "page" failed: "/home/wlanxww/Projects/personal/xww_blog/themes/FixIt/layouts/_default/baseof.html:36:8": execute of template failed: template: friends/single.html:36:8: executing "friends/single.html" at <partial "assets.html" .>: error calling partial: "/home/wlanxww/Projects/personal/xww_blog/themes/FixIt/layouts/partials/assets.html:279:6": execute of template failed: template: partials/assets.html:279:6: executing "partials/assets.html" at <partial "plugin/script.html" .>: error calling partial: "/home/wlanxww/Projects/personal/xww_blog/themes/FixIt/layouts/partials/plugin/script.html:15:36": execute of template failed: template: partials/plugin/script.html:15:36: executing "partials/plugin/script.html" at <minify>: wrong type for value; expected resources.ResourceTransformer; got resource.Resource
Error: Error building site: failed to render pages: render of "taxonomy" failed: "/home/wlanxww/Projects/personal/xww_blog/themes/FixIt/layouts/_default/baseof.html:36:8": execute of template failed: template: taxonomy/terms.html:36:8: executing "taxonomy/terms.html" at <partial "assets.html" .>: error calling partial: "/home/wlanxww/Projects/personal/xww_blog/themes/FixIt/layouts/partials/assets.html:279:6": execute of template failed: template: partials/assets.html:279:6: executing "partials/assets.html" at <partial "plugin/script.html" .>: error calling partial: "/home/wlanxww/Projects/personal/xww_blog/themes/FixIt/layouts/partials/plugin/script.html:15:36": execute of template failed: template: partials/plugin/script.html:15:36: executing "partials/plugin/script.html" at <minify>: wrong type for value; expected resources.ResourceTransformer; got resource.Resource
Total in 121 ms |
Beta Was this translation helpful? Give feedback.
Answered by
Lruihao
Sep 12, 2022
Replies: 2 comments 2 replies
-
|
Beta Was this translation helpful? Give feedback.
2 replies
Answer selected by
Lruihao
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
经确认为 #189 造成的 bug,已在 #196 修复。