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 image paths so they work with path prefix #540

Merged
merged 6 commits into from
Apr 9, 2024

Conversation

planger
Copy link
Contributor

@planger planger commented Apr 4, 2024

Referencing images with a URL starting with / will always default to the root. This however won't work if we host the page in a folder, as we do in the preview. As we use plain HTML tags in the markdown, probably the easiest fix is to use relative image links instead. The same applies to markdown links starting with /. They don't seem to take URL prefixes into account.

This change turns all root paths into relative paths.

@planger planger temporarily deployed to pull-request-preview April 4, 2024 07:22 — with GitHub Actions Inactive
Copy link

github-actions bot commented Apr 4, 2024

PR Preview Action v1.4.7
Preview removed because the pull request was closed.
2024-04-09 08:31 UTC

@planger planger temporarily deployed to pull-request-preview April 4, 2024 11:20 — with GitHub Actions Inactive
Referencing images with a URL starting with `/` will always default to the root. This however won't work if we host the page in a folder. As we use plain HTML tags in the markdown, probably the easiest fix is to use relative image links instead.

This change turns all root paths for images into relative paths.
@planger
Copy link
Contributor Author

planger commented Apr 4, 2024

@xai Can you please take a look at this PR and let me know what you think? If you find a better solution for fixing the links and images so they work in the previews, please let me know. Thank you!

@xai
Copy link
Contributor

xai commented Apr 4, 2024

@xai Can you please take a look at this PR and let me know what you think? If you find a better solution for fixing the links and images so they work in the previews, please let me know. Thank you!

Looks good to me, I am not aware of a better approach than relative links for the markdown pages.

However, it looks like we still have several pages that use hard-coded absolute links to the theia-ide.org domain, see git grep '](https://theia-ide.org/'. They won't be broken in the preview but link to the production site targets instead of ages from the preview. Should we change them also into relative links?

@planger
Copy link
Contributor Author

planger commented Apr 4, 2024

Thanks @xai! Good idea! I've replaced them in a68be8f. Can you please verify whether all links still work?
I noticed there are a few broken links before this change, but I left them for now. We should fix them in a separate PR though.

@planger planger temporarily deployed to pull-request-preview April 4, 2024 12:31 — with GitHub Actions Inactive
Copy link
Contributor

@xai xai left a comment

Choose a reason for hiding this comment

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

Looks pretty good, just very few broken links left.

src/docs/authoring_extensions.md Outdated Show resolved Hide resolved
src/docs/blueprint_documentation.md Outdated Show resolved Hide resolved
src/docs/enhanced_tab_bar_preview.md Outdated Show resolved Hide resolved
src/docs/json_rpc.md Outdated Show resolved Hide resolved
src/docs/json_rpc.md Outdated Show resolved Hide resolved
src/docs/user_getting_started.md Outdated Show resolved Hide resolved
planger and others added 2 commits April 4, 2024 14:58
Co-authored-by: Olaf Lessenich <olessenich@eclipsesource.com>
@planger planger temporarily deployed to pull-request-preview April 4, 2024 13:01 — with GitHub Actions Inactive
Copy link
Contributor

@xai xai left a comment

Choose a reason for hiding this comment

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

Caught another two, sorry.

src/docs/getting_started.md Outdated Show resolved Hide resolved
src/docs/getting_started.md Outdated Show resolved Hide resolved
@planger
Copy link
Contributor Author

planger commented Apr 4, 2024

Thank you, I think I addressed the additional ones you found. Can you please do one more check? It clearly seems four eyes are better, even though I'm using a link checker :-)

Copy link
Contributor

@xai xai left a comment

Choose a reason for hiding this comment

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

LGTM! All broken links have been fixed.

@xai
Copy link
Contributor

xai commented Apr 4, 2024

Thank you, I think I addressed the additional ones you found. Can you please do one more check? It clearly seems four eyes are better, even though I'm using a link checker :-)

Two people using two link checkers works better indeed 😂

@planger planger marked this pull request as ready for review April 4, 2024 13:21
Copy link
Contributor

@JonasHelming JonasHelming left a comment

Choose a reason for hiding this comment

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

LGTM!

@planger planger merged commit 56593ad into eclipse-theia:master Apr 9, 2024
8 checks passed
@planger planger deleted the fix-image-paths branch April 9, 2024 08:31
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