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 404 error when navigating away from blog page #2217

Merged

Conversation

ZhangChen199102
Copy link
Collaborator

Issue: #2184

Turbo always tries to cache the page after a link, but after navigate to a new page, it can't get the images of the blogs cause they use relative path, e.g.

![The interactive guided remediation vulnerability results screen](gr_main.png "The interactive guided remediation vulnerability results screen")

This PR disables the cache feature of Turbo Drive which is a quick solution, but this will reduce the performance when navigate back to the blog (content won't be stored and it will load a fresh page).

Another solution is improving the images path for each blog, for example use /static/blog/posts/announcing-guided-remediation-in-osv-scanner/gr_main.png instead of gr_main.png. But by going this way, we need to keep in mind to use absolute path when adding a new blog.

Please let me know your thought, or any other solution.

Copy link
Member

@michaelkedar michaelkedar left a comment

Choose a reason for hiding this comment

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

I think removing turbo's caching is fine.

Another solution is improving the images path for each blog, for example use /static/blog/posts/announcing-guided-remediation-in-osv-scanner/gr_main.png instead of gr_main.png. But by going this way, we need to keep in mind to use absolute path when adding a new blog.

I don't like having to specify the absolute path manually, but I wonder if there's a way to automatically convert these paths from relative to absolute in hugo?

@ZhangChen199102
Copy link
Collaborator Author

I think removing turbo's caching is fine.

Another solution is improving the images path for each blog, for example use /static/blog/posts/announcing-guided-remediation-in-osv-scanner/gr_main.png instead of gr_main.png. But by going this way, we need to keep in mind to use absolute path when adding a new blog.

I don't like having to specify the absolute path manually, but I wonder if there's a way to automatically convert these paths from relative to absolute in hugo?

I've went through Hugo's doc, and don't think they provide a method to automatically convert paths to absolute path.

@ZhangChen199102 ZhangChen199102 force-pushed the fix-404-when-navigating-away-from-blog-page branch from 4c5053b to ff3e8f0 Compare May 22, 2024 04:48
@michaelkedar michaelkedar merged commit c41a756 into google:master May 22, 2024
11 checks passed
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