-
Notifications
You must be signed in to change notification settings - Fork 887
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding Content (images in different locale subdirs) #1108
Comments
Hmm, let me take a look at the code/URL that's pulling that image - it seems like it should be possible to single source it, but the ways of Hugo are sometimes mysterious.... |
So it is indeed Hugo weirdness, the cover block is looking for the image as a page resource which means it has to be in the same "bundle" (directory with an index file at the root) as the page. Going to poke around some more and see if there's a nice way of having common resources across different language dirs other than just sticking them all in the /static/ directory. |
Though also, hmm ....https://gohugo.io/content-management/multilingual/#page-bundles, so it should just work. Let me look at the rules more closely. Our example site has a Norwegian version that has no specific background cover image of its own and it serves up just fine: https://example.docsy.dev/no/ |
Did you actually remove the image from the |
Also I hadn't realized there was an actual image in the |
Remove superfluous background image - Hugo should just pull the cover image from the default language `en` directory. See google/docsy#1108
Remove superfluous background image - Hugo should just pull the cover image from the default language `en` directory. See google/docsy#1108
I'm still pre-coffee, but after re-cloning the example site into a new directory:
(edit
Am I missing something obvious? |
I wonder are you running into #805, could be some kind of caching issue? What version of Hugo are you using? |
Let me get some coffee and see if there's something weird with my environment. Brand new git clone, though, so it seems odd. Edit: On a mac currently running 12.4, about to update to 12.5. Fingers crossed. |
That is odd. It's building fine straight from the repo with Netlify, think we're Hugo v0.100.1 there (should update). |
Aaaaand two hours later my iMac is up on 12.5, hugo was persuaded to re-download modules, and everything is working normally. (In my professional life, "oh well, that fixed it" would never suffice, I'd insist on figuring out the root cause to ensure it doesn't happen again. Since this is a personal project, however, I've zero interest in exploring further. 😁) Anyway, I'm happy to report that #181 (simply removing the redundant image in other locales) worked fine. I'm not sure why I didn't think to try that originally instead of removing entire locale subdirectories (possibly related to my tiredness from beating my head against the wall trying to figure out why that image wasn't changing). Thanks for your help! |
No problem, happy to help. |
This section caused me some confusion while playing with docsy again for the first time in ages:
I replaced the default background image in the example site, but only did it in the
en
subdirectory (I forgot there was another locale). Unfortunately (I think becausefa
sorts afteren
), this meant that changing the background image had no effect whatsoever. I was pulling my hair out refreshing caches, restarting the server with and without FastRebuild, etc. trying to figure out where the old image was coming from. I finally realized the old image was getting pulled from thefa
content directory on each rebuild.I'm unsure if this is a documentation issue, a sample-site issue, or an issue with docsy or hugo itself, but at the very least it would be nice if the documentation mentioned that images and other assets in page bundles need to be the same across locale subdirectories. It seems to me the background images should be DRYed up somehow in the sample site. I'm not sure that locale-specific images make sense and only the markdown and html should vary between locales. Having the same image in multiple locale subdirectories feels wrong.
The text was updated successfully, but these errors were encountered: