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

Images are not rendering #87

Closed
bizb0630 opened this issue Dec 30, 2022 · 14 comments
Closed

Images are not rendering #87

bizb0630 opened this issue Dec 30, 2022 · 14 comments
Labels
bug Something isn't working

Comments

@bizb0630
Copy link

bizb0630 commented Dec 30, 2022

I'm trying to upload "public" folder into my host's "public_html" folder (cpanel). Website works fine, but images are not displaying.

I tried to change "const rootURL = window.location.protocol + "//" + window.location.host;" as here to "const rootURL = '{{ strings.TrimSuffix "/" .Site.BaseURL }}/';". However, after that my website stoppped rendering even buttons. How can I fix it?

@bizb0630 bizb0630 added the bug Something isn't working label Dec 30, 2022
@onweru
Copy link
Owner

onweru commented Dec 30, 2022

@nixon0630, what is the url of your website?

@bizb0630
Copy link
Author

Here is it:
http://olympiadmath.uz/
Now it cannot display the theme itself, but in local server it looks pretty good:

Screenshot from 2022-12-30 16-25-09

@onweru
Copy link
Owner

onweru commented Dec 30, 2022

@nixon0630,

I suspect this has to do with your baseURL value in the config. Looking at your website, the baseURL is set to http://olympiadmath.uz/olympiadmath.uz/

Are you sure, than in your site is hosted inside a subdir olympiadmath.uz ?

@bizb0630
Copy link
Author

How can I change it to the olympiadmath.uz?

@onweru
Copy link
Owner

onweru commented Dec 30, 2022

@nixon0630,

I suspect this has to do with your baseURL value in the config. Looking at your website, the baseURL is set to http://olympiadmath.uz/olympiadmath.uz/

Are you sure, than in your site is hosted inside a subdir olympiadmath.uz ?

Oh shoot! I think you're just using olympiadmath.uz as the baseURL. It should be https://olympiadmath.uz/

SCR-20221230-k6g

@onweru
Copy link
Owner

onweru commented Dec 30, 2022

Like so:

SCR-20221230-k8l

Otherwise olympiadmath.uz will be treated as a relative link to a subfolder.

@bizb0630
Copy link
Author

Sure, it shows images now
But it doesn't display theme

@bizb0630
Copy link
Author

Pleashe help

like it reversed now (earlier cannot load images, but there; now an load images but not theme)

@bizb0630
Copy link
Author

Unofrtuntely, some images here are still invisible, but theme works fine.

@onweru
Copy link
Owner

onweru commented Dec 30, 2022

The https version works fine. Make sure you set a 301 redirect for all http to https

SCR-20221230-kbg

@bizb0630
Copy link
Author

Maybe I should replicate diy image (.svg) with another format?

@onweru
Copy link
Owner

onweru commented Dec 30, 2022

Maybe I should replicate diy image (.svg) with another format?

Not necessarily. Just ensure you have the image as named inside static/images directory.
SCR-20221230-ke9

I will mark this issue as resolved now. If you have other issues, please open a discussion.

@onweru onweru closed this as completed Dec 30, 2022
@bizb0630
Copy link
Author

@onweru, some images are not displaying still, but some do. For example, here this image is visible, but somehow this is not. On localhost it works fine still.

@onweru
Copy link
Owner

onweru commented Dec 30, 2022

@nixon0630, this is not a bug. Ensure you are following the following tips to avoid the inconsistencies:

All image filenames

1/ should be in hyphenated (no spaces in the name)
2/ should be in lowercase
3/ inside static/images dir
4/ avoid uppercase file-extensions e.g .JPG, .PNG. Use .jpg, .png instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants