wangchucheng / hugo-eureka

Eureka is a feature-rich and highly customizable Hugo theme.
https://www.wangchucheng.com/en/docs/hugo-eureka/
Apache License 2.0
920 stars 192 forks source link

Can not access assets when a path is set in baseURL #186

Closed wangchucheng closed 2 years ago

wangchucheng commented 2 years ago

Gitlab refuse to make the pipeline. (it works only if I set baseURL to "/", but without theme). Same error with good url : https://hugo1111.gitlab.io/eureka11/ (I migrate git for testing) :

hugo v0.97.0-c07f3626e7c8160943591f4d209977efa02c3dca+extended linux/amd64 BuildDate=2022-04-14T08:45:07Z VendorInfo=gohugoio Error: Error building site: POSTCSS: failed to transform "css/eureka.css" (text/css): resource "css/eureka11/css/eureka.css_99793e29f614609ef5e75d384789a0c9" not found in file cache

Originally posted by @Flashpok in https://github.com/wangchucheng/hugo-eureka/discussions/185#discussioncomment-2576215

wangchucheng commented 2 years ago

@Flashpok It seems that it is an issue caused by Hugo, an issue has been opened here: https://github.com/gohugoio/hugo/issues/9787. You may encounter this issue with any theme which uses resource cache, especially PostCSS ones.

A temporary workaround would be copy folders and files here into your project's resources/_gen/assets/css/<base-path>/. Then Hugo can find the asset cache in resources/_gen/assets/css/<base-path>/css/.... If baseURL is set to example.com/test/, then base-path here is test.

Flashpok commented 2 years ago

thank you @wangchucheng for your help ! Another workaround is to create this URL "eureka-site.github.io" instead "github.io/eurekasite" (group or user subdomain).

wangchucheng commented 2 years ago

This issue has been fixed by gohugoio/hugo#9942 so it will work well after this PR has been released.