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 js loading and 404 page #24

Merged
merged 2 commits into from
Apr 22, 2023
Merged

Fix js loading and 404 page #24

merged 2 commits into from
Apr 22, 2023

Conversation

kusyka911
Copy link
Contributor

@kusyka911 kusyka911 commented Apr 20, 2023

What problem does this PR solve?

Updated design of 404 page

before:

before

after:

after

Fix issues with loading scripts

This issue exists when using hugo development server and remote device for testing. See screenshot bellow.
Website is loaded from remote IP like 10.0.0.194 but it's trying to load scripts from localhost. Same issue with link in postCard component.
scripts

Is this PR adding a new feature?

No

Is this PR related to any issue or discussion?

No

PR Checklist

  • I have verified that the code works as described/as intended.
  • This change adds a social icon which has a permissive license to use it.
  • This change does not include any external library/resources.
  • This change does not include any unrelated scripts (e.g. bash and python scripts).
  • I have enabled maintainer edits for this PR.

@netlify
Copy link

netlify bot commented Apr 20, 2023

Deploy Preview for hugo-blog-awesome ready!

Name Link
🔨 Latest commit 767d726
🔍 Latest deploy log https://app.netlify.com/sites/hugo-blog-awesome/deploys/644149874c46140008d4354c
😎 Deploy Preview https://deploy-preview-24--hugo-blog-awesome.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@kusyka911 kusyka911 changed the title Fixing minor issues Fix js loading and 404 page Apr 20, 2023
@hugo-sid
Copy link
Owner

hugo-sid commented Apr 20, 2023

Hi @kusyka911.

Thanks for providing all the details and for creating this PR.

I really appreciate your contribution to this theme.

I liked your fix regarding the 404 page.

I also liked what you have done with the links - using relative URLs instead of absolute ones.

I'm just trying to do a little investigation with the script loading issue.

If you take a look at the demo site, you can observe that there are no such errors. The developer tools console is clean.

image

I have not been able to reproduce the issue with loading scripts. Can you please tell what was the baseURL for your website loaded from remote IP address (10.0.0.194) ?

@kusyka911
Copy link
Contributor Author

kusyka911 commented Apr 20, 2023

@hugo-sid issue with script loading appear ONLY when you using hugo built-in web-server with hugo server command. This web server force baseURL to http:https://localhost:1313/ when using Permalink. Try to run hugo website on your computer with hugo server -D --bind 0.0.0.0 (to allow connections from all available IP, remember about firewall, you may need to allow connection on port 1313) and test it with you phone or another computer. On the phone you will see that theme switcher not working. Or you can just use another laptop or desktop to check this as you can see on my screenshots.

For debugging with phone you may use this

I think this is also a problem of hugo and they should not set baseURL by default even in case of using development server. But it may be fixed on theme level using relative links while this will not break anything else.

Copy link
Owner

@hugo-sid hugo-sid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @kusyka911 for this PR.

You have made a significant contribution to this theme.

Looking forward to more contributions from you.

Have a good day. Happy blogging 🙂

@hugo-sid hugo-sid merged commit 2e78155 into hugo-sid:main Apr 22, 2023
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.

None yet

2 participants