[Edited, and links have a dot to avoid restriction]
Hi!, i have some problems related to GCS.
The problem is that were i upload content to the bucket, the content itself doesn’t present to the user properly, actually it appears a 404 error code at website.
This happen in special with some type of files like CSS, images, JS, and everything different of “index.html”.
unless you expect other people to try deploying on GGS too, you didn’t explain the issue at all beside “it doesn’t work”. So you get a bunch of html files and images, js files and css stylesheets can not be reached ? What happens when you enter their URL ?
Then the files are not where the browser is looking for them. Fix the paths.
And: your chances to get help are better, I think, if you provide more information than „it doesn’t work“. Sentences like „site works at local network“ might make sense to you. They don’t for me, for example.
It’s not very clear if your repo is the source of your website or the source of a theme you’re going to develop. If you want to use the Hugo Hero Theme I recommend to initialize your configuration otherwise. The content in /content, the theme in /themes/hugo-hero-theme and the config.toml at the root. The configuration you are using is for themes demos. You can look at this example: GitHub - theNewDynamic/andrewkrivak.com (randomly selected).
I checked the documentation and some forums looking for some example or help and nothing works.
An important point to say it’s that if i test the site at localhost, localnet, gitlab pages (on-prem, SaaS, etc), the site works fine and the resources are showed correctly (error code 200), so the problem looks like that are at GCS side. Another important thing to say it’s that the site needs to be deployed completely at GCS, not passing through firebase, this is to avoid add complexity to IAM policies and use the same policies as GCS bucket, the main use, right now isn’t very important.
Another thing to say it’s that the “deployment” were tested in different ways:
Just a last advice: if your static website works everywhere except on GCS, so it’s perhaps not a Hugo problem. Check your baseURL config, and look at my last advice.
Even, i tried to change the theme, just in case that the theme be the problem, and nothing, the behaviour it’s always the same.
So here comes the main question:
How should i configure hugo, config.toml, theme.toml or layouts (or GCP also), to make the site available and the resources show / display / serve properly and the content load as another platforms mentioned before.
It’s related of how GCS works, sorry I don’t know how it works… (But same advice: change the baseURL in your config.toml for the address at which GCS serves your website.)
If your website is full functional on GitLab Pages or elsewhere so you have to find a solution on GCS support. You can’t choose a custom domain on GCS? BTW I don’t understand why you have ht.tps://storage.googleapis.com/<bucket name> and not https://storage.googleapis.com/<bucket name>
Ok, i discover something interesting, here are some notes:
I tested another completely different site (not with hugo). I look for a simple HTML site with dependencies on the same folder and another with dependencies on another folder; for example:
1.- folder/index.html, folder/style.css → This resources are displayed correctly to end-user
2.- folder/index.html, folder/js/script.js → This resources aren’t displayed correctly to end-user and trigger 404 errors:
So the problem itself isn’t hugo (of course, i never blamed hugo for this issue, just a little guide to fix this problem) but GCS and i’ll try to find a way to fix this.
Now, another question, to which project should i raise this issue, if someone knows (meanwhile i look for that info), i’ll be very grateful.
And … i don’t know if the documentation related to “GCS” should be updated, because isn’t so much as “hugo deploy” and “magic!”.