Closed rcastley closed 9 months ago
FYI, reverting back to v0.0.0-20231116235917
fixes the issue.
This seems like a permission issue on your side. The upcoming release 5.24.0 will first copy and then may overwrite the color variant files during the build step. This does not cause issues in the build actions of this repo.
I may have a workaround for this, but first try to find out why your build action is not allowed to overwrite files.
@rcastley I am in the final steps of preparation for a new release, but would have a better feeling if I know what's going on here. Do you have any news? Your Github actions look rather unconventional as they are not using the usual predefined hugo actions but seem to be self written. Anything I might should know here?
I am really sorry but due to unforeseen family circumstances I am unable to test ATM ... thank you so much for your reply/response ... my rollback to an earlier version is working for now ... I will be back on this once we are through this period. Thank you for your time and your understanding.
The GitHub Actions we use are here - https://github.com/splunk/observability-workshop/tree/main/.github ... I am happy to change this to something more standard to adopt your changes. Thank you again!
I (and many others) use this https://github.com/peaceiris/actions-hugo but I am not sure if this covers your use case. You can take a look into the .github
directory of this theme to see, how I use it in companion with GitHub pages.
A complete list of external GitHub actions used for this themes is in the docs credits: https://mcshelby.github.io/hugo-theme-relearn/more/credits/index.html#tooling-dependencies
Thank you 👍🏻
Seems that my Discourse topic was to niche. I've searched a bit further. Maybe it helps to run hugo with the --noChmod
option during build. If this does not help, you can maybe fiddle around with file permissions as described here: https://discourse.gohugo.io/t/file-mode-in-static-folder/27891
I've pushed a change which hopefully helps you. From the hugo.toml
:
# Filename suffix for variant files
# Default: not set
# The theme modifies the variant stylesheets during build and tries to store
# them with the same file name. In certain installations it was observed, that
# Hugo could not overwrite these files due to permission issues. If you
# experience this, you can set this option to eg. ".gen". This will be used
# as a suffix for these generated files, causing them be newly created instead
# of overwriting existing ones.
themeVariantModifier = ""
Good evening ... the noChmod
did the trick, thank you so much 🥇
hugo --minify --destination "site/v${TAG_NAME}" --baseURL "${BASE_URL}observability-workshop/v$TAG_NAME" --noChmod
Successful deployment using:
github.com/McShelby/hugo-theme-relearn v0.0.0-20231203143443-7c97f7b6109f/go.mod h1:mKQQdxZNIlLvAj8X3tMq+RzntIJSr9z7XdzuMomt0IM=
Thank you again, really much appreciated!
Great to hear. Thanks for the feedback!
@McShelby Good Evening, just to let you know that even using the documented Hugo GitHub Action requires --noChmod
to be added
https://gohugo.io/hosting-and-deployment/hosting-on-github/#procedure
Just incase other uses are facing any issues.
For anyone hitting this issue using CloudCannon the --noChmod
fix will correct it.
The error for reference
ERROR Failed to publish Resource: open /usr/local/__site/src/public/css/theme-relearn-light.css: permission denied
ERROR Failed to publish Resource: open /usr/local/__site/src/public/css/theme-relearn-dark.css: permission denied
The fix:
No chmod --noChmod
I'm getting the same problem but just running
hugo serve
Watching for changes in /Users/jack/src/docs/{archetypes,assets,content,data,i18n,layouts,static,themes}
Watching for config changes in /Users/jack/src/docs/hugo.toml, /Users/jack/src/docs/themes/hugo-theme-relearn/hugo.toml, /Users/jack/src/docs/go.mod
Start building sites …
hugo v0.123.3-a75a659f6fc0cb3a52b2b2ba666a81f79a459376+extended darwin/amd64 BuildDate=2024-02-23T17:09:20Z VendorInfo=brew
ERROR Failed to publish Resource: open /Users/jack/src/docs/public/css/theme-relearn-light.css: permission denied
ERROR Failed to publish Resource: open /Users/jack/src/docs/public/css/theme-relearn-dark.css: permission denied
Built in 1287 ms
Error: error building site: logged 2 error(s)
Permissions on those files are
-r--r--r-- 1 jack staff 3350 Feb 25 10:11 /Users/jack/src/docs/public/css/theme-relearn-dark.css
-r--r--r-- 1 jack staff 3246 Feb 25 10:11 /Users/jack/src/docs/public/css/theme-relearn-light.css
Permissions on the original in /Users/jack/src/docs/ are
🦄 ❯ ls themes/hugo-theme-relearn/static/css -l
total 364
-rw-r--r-- 1 jack staff 1756 Feb 24 14:15 auto-complete.css
-rw-r--r-- 1 jack staff 4653 Feb 24 14:15 chroma-learn.css
-rw-r--r-- 1 jack staff 4480 Feb 24 14:15 chroma-neon.css
-rw-r--r-- 1 jack staff 4534 Feb 24 14:15 chroma-relearn-dark.css
-rw-r--r-- 1 jack staff 4693 Feb 24 14:15 chroma-relearn-light.css
-rw-r--r-- 1 jack staff 59305 Feb 24 14:15 fontawesome-all.min.css
-rw-r--r-- 1 jack staff 1167 Feb 24 14:15 fonts.css
-rw-r--r-- 1 jack staff 26359 Feb 24 14:15 ie.css
-rw-r--r-- 1 jack staff 4671 Feb 24 14:15 nucleus.css
-rw-r--r-- 1 jack staff 2171 Feb 24 14:15 perfect-scrollbar.min.css
-rw-r--r-- 1 jack staff 28 Feb 24 14:15 print.css
-rw-r--r-- 1 jack staff 65276 Feb 24 14:15 swagger-dark.css
-rw-r--r-- 1 jack staff 0 Feb 24 14:15 swagger-light.css
-rw-r--r-- 1 jack staff 8839 Feb 24 14:15 swagger.css
-rw-r--r-- 1 jack staff 922 Feb 24 14:15 tags.css
-rw-r--r-- 1 jack staff 2875 Feb 24 14:15 theme-blue.css
-rw-r--r-- 1 jack staff 2873 Feb 24 14:15 theme-green.css
-rw-r--r-- 1 jack staff 3062 Feb 24 14:15 theme-learn.css
-rw-r--r-- 1 jack staff 11845 Feb 24 14:15 theme-neon.css
-rw-r--r-- 1 jack staff 2866 Feb 24 14:15 theme-red.css
-rw-r--r-- 1 jack staff 3582 Feb 24 14:15 theme-relearn-bright.css
-rw-r--r-- 1 jack staff 3350 Feb 24 14:15 theme-relearn-dark.css
-rw-r--r-- 1 jack staff 3246 Feb 24 14:15 theme-relearn-light.css
-rw-r--r-- 1 jack staff 136 Feb 24 14:15 theme-relearn.css
-rw-r--r-- 1 jack staff 4224 Feb 24 14:15 theme-zen-dark.css
-rw-r--r-- 1 jack staff 4257 Feb 24 14:15 theme-zen-light.css
-rw-r--r-- 1 jack staff 49497 Feb 24 14:15 theme.css
-rw-r--r-- 1 jack staff 9284 Feb 24 14:15 variant-internal.css
-rw-r--r-- 1 jack staff 13450 Feb 24 14:15 variant.css
In this topic are two ways outlined to solve your issue: --noChmod
and themeVariantModifier
.
In this topic are two ways outlined to solve your issue:
--noChmod
andthemeVariantModifier
.
Hello, I have attempted myself with doing adding theme as a Hugo Module:
[User@Machine:~/Folder]$ cat hugo.toml
baseURL = 'https://site'
languageCode = 'en-us'
title = ''
theme = "hugo-theme-relearn"
[outputs]
home = ['html', 'rss', 'search', 'searchpage']
[module]
[[module.imports]]
path = 'github.com/McShelby/hugo-theme-relearn'
[params]
description = ''
disableNextPrev = true
[[params.themeVariant]]
auto = ['zen-light', 'zen-dark']
identifier = 'zen-auto'
name = 'Zen Light/Dark'
[User@Machine:~/Folder]$ hugo --noChmod
Start building sites …
hugo v0.120.3+extended linux/amd64 BuildDate=unknown VendorInfo=nixpkgs
ERROR Failed to publish Resource: open /public/css/theme-relearn-light.css: permission denied
ERROR Failed to publish Resource: open /public/css/theme-relearn-dark.css: permission denied
Total in 228 ms
Error: error building site: logged 2 error(s)
Anything else you can recommend I try?
Just realizing this issue is closed, should I open a new one?
Yes please.
Hi,
When I try to deploy using GitHub actions I am hit a permissions issue with the CSS files:
I am using v0.119 for deployment and using
hugo get mod -u
to update the theme.Thank you!