Skip to content
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

Fix issue where page bundle images fail to load #238

Merged
merged 1 commit into from
Apr 19, 2021

Conversation

mikepianka
Copy link
Contributor

First of all, I just want to say thanks for the awesome theme.

I noticed an issue where images in page bundles fail to load if the site is not deployed to the root. For example, if you deploy the site to www.example.com/projects/info.

To reproduce the issue, in the say-hello-to-doks blog post embed the say-hello-to-doks.png and run a build.

image

Checking out the resulting index.html, the first entry in data-srcset has an absolute URL but the rest are relative URL's. The relative links will fail to load once deployed since the default config is using canonical URL's with a baseURL.

image

This seems because RelPermalink is used in the img shortcode. Switch to Permalink and rebuild to fix the issue.

image

image

@OCram85
Copy link
Contributor

OCram85 commented Apr 19, 2021

@mikepianka: Does this issue occur only on netlify deployments or on local builds, too?

@mikepianka
Copy link
Contributor Author

Just deploys. Things seem to run fine in the local dev server with or without the change. I'm new to Hugo but I believe baseURL / canonify get ignored when running locally which might explain that. Also, it's not specifically a Netlify deploy issue because I'm not deploying there.

@h-enk
Copy link
Member

h-enk commented Apr 19, 2021

Thanks again! It's a production build issue (independent of hosting).

Tested /verified with local production build using the following ./config/production/config.toml settings:

baseurl = "http://192.168.1.10:8080/projects/info/"
canonifyURLs = true
publishDir = "/projects/info/"

@h-enk h-enk merged commit 38e1428 into thuliteio:master Apr 19, 2021
@h-enk h-enk self-requested a review April 19, 2021 12:09
@h-enk h-enk added this to the v0.3.0 milestone Apr 19, 2021
adhadse pushed a commit to adhadse/doks that referenced this pull request Sep 17, 2022
Fix issue where page bundle images fail to load
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants