themefisher / airspace-hugo

Airspace Hugo theme for multipurpose use, like Portfolio, Blog, Business.
https://gethugothemes.com/products/airspace/?utm_source=airspace_github&utm_medium=referral&utm_campaign=github_theme_about
MIT License
354 stars 509 forks source link

Creating public html files and hosting at Github Pages #173

Closed phil-pappas closed 3 years ago

phil-pappas commented 3 years ago

Hi Salim.

I created public_html folder-files with the hugo -D command and placed the generated files in a github repo. However, when I try to enable github pages of that repo, the site appears with a 404 error image

Do you know what I am doing wrong? Have you ever come across with a similar situation?

phil-pappas commented 3 years ago

Now it is opening with a broken css image

phil-pappas commented 3 years ago

I fixed it but another problem raised. I had to put canonifyURLs = true but now the images are not loading in the backgrounds

phil-pappas commented 3 years ago

For example see the follow: image

Most of the images that are generated like this: <section class="slider overly" style="background-image: url('images/image.jpg');"> are not working. While images that are represented with a link are displayed correctly. For example: <img src="https://{baseURL}/images/image.jpg" class="img-responsive" alt="Img">

It seems like CSS gets broken (?) Locally it works just fine but its not the case when I push it to github.

Edit: I changed manually the index.html file line of: style="background-image: url('images/image.jpg'); to style="background-image: url('https://{baseURL}/images/image.jpg'); and it worked. However I can't do that for every image. It feels that I miss something

phil-pappas commented 3 years ago

It appears that GitHub autogenerated URL was the problem. https://phil-pappas.github.io/repo/ cause problems. you need to have a URL without extra slashes in the end. e.g. https://phil-pappas.github.io/

salim-b commented 3 years ago

It appears that GitHub autogenerated URL was the problem. https://phil-pappas.github.io/repo/ cause problems. you need to have a URL without extra slashes in the end. e.g. https://phil-pappas.github.io/

Yeah, that's what I suspected in https://github.com/themefisher/airspace-hugo/issues/157#issuecomment-838001703 ...