-
-
Notifications
You must be signed in to change notification settings - Fork 95
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
Direct links to image lead to routing error #105
Comments
I thought this was already fixed before 🤔 Just for reference, in case it helps with any regressions: #17 |
I have also encountered with this problem and here are my thoughts. The easiest work around is just open the image in another tab by using elm-pages/src/Pages/Internal/Platform.elm Lines 494 to 510 in 007c9c8
But I think the Elm way is creating a page dedicated to display images, so we can keep the app state and navigate pages without loosing user experiences. |
In the new version, opening images on the dev server works as expected. |
Thank you for trying it out on the latest version, I was just wondering about this 🙏 |
I've tried adding links to image's source, so that people can open them full screen if they want to. Unfortunately, when the image is clicked, it reports
Page not found. Valid routes: , blog, blog/draft, blog/hello
If I open the link in a new tab, it loads fine, because the error is with elm-pages interception of a link click. I'm not sure exactly what is wrong, but there is definitely the assumptions that such links point to pages, and not directly to images like in this case.
Reproduction
src/Page/Article.elm
with the following.npm run start
(ornpm run serve
), go to http://localhost:3000/blog/hello and click on the image of the book. It should show the error.The text was updated successfully, but these errors were encountered: