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

[Enhancement] Consistent URLs when Landing Page is disabled #1732

Closed
nicokaiser opened this issue Jan 25, 2023 · 5 comments · Fixed by #2035
Closed

[Enhancement] Consistent URLs when Landing Page is disabled #1732

nicokaiser opened this issue Jan 25, 2023 · 5 comments · Fixed by #2035

Comments

@nicokaiser
Copy link
Contributor

When the Landing Page is enabled, the Gallery and all its URLs are https://example.com/gallery#xyzzy and https://example.com/gallery#xyzzy/aabbcc.
When the Landing Page is disabled, the URLs are https://example.com/#xyzzy and https://example.com/#xyzzy/aabbcc, but this is only due to the IndexController also delivering the Gallery in this case. The gallery# URLs still seem to be the canonical URLs.

Also, redirects are going to the gallery# versions. https://example.com/r/xyzzy -> https://example.com/gallery#xyzzy
When enabling the Landing Page at a later time, previous URLs like https://example.com/#xyzzy do not work anymore.

Wouldn't it be more consistent to have all URLs generated by the frontend include the gallery prefix? There are two options:

  1. Currently IndexController renders the frontend when Landing Page is disabled. This could be replaced by a redirect('gallery'). This would be the "cleanest" way to achieve this, however when using this option, there is not real "homepage" anymore (because / redirects to /gallery). (The return type of the method also needs to be adjusted)

return $this->frontend();

- 			return $this->frontend();
+ 			return redirect('gallery');

or 2. Change lychee.goto so it includes the prefix:

https://github.com/LycheeOrg/Lychee-front/blob/5ade25d897bc04df9cab15bda0dc0fb6c5e0b16a/scripts/main/lychee.js#L756

- 	url = "#" + (url !== null ? url : "");
+ 	url = "gallery#" + (url !== null ? url : "");

I'm not sure if the latter has implications on other URLs generated using lychee.goto, however I guess (!) this method is only used to generate album or photo URLs.

@ildyria
Copy link
Member

ildyria commented Jan 25, 2023

Will be fixed with the Livewire front-end I am working on.
This will be made consistent.

@nicokaiser
Copy link
Contributor Author

Great to hear! Anything I can help with on the Livewire task?

@ildyria
Copy link
Member

ildyria commented Jan 25, 2023

I am currently doing the header modal forms and will be working on the sidebar editing soon after, though I am considering adding a drop down-setting effect on the Album page to give a view of all modifiable settings in one go.

I have not yet worked on the sharing page, nor have I implemented the landing page or the frame page.
If you want to give me a bit of help I would suggest to have a look at those two (landing, frame) and how to integrate them in the index page.
They should be fairly easy to implement and would give you some insight of how the new front-end work (which is very different to the JS one).

The following page should give you some insight of how it works and the architecture behind it.
https://lycheeorg.github.io/docs/livewire.html

@nicokaiser
Copy link
Contributor Author

One addition: the URLs in the RSS feeds are all wrong on 4.7.0, if the landing page is enabled (@ildyria you can see this in your own RSS feed). Maybe this should be hot-fixed even before the new Livewire frontend is ready (which might take some weeks to months, right?)

nicokaiser added a commit to nicokaiser/Lychee that referenced this issue Jan 26, 2023
URLs in RSS feeds are "https://example.com/#xyzzy/aabbcc". This works in
default installations, however the canonical URL to albums (and photos)
starts with "/gallery", so these URLs should be
"https://example.com/gallery#xyzzy/aabbcc".

When using the landing page, URLs even _need_ to include "gallery",
otherweise all of the RSS URLs only show the landing page.
@nicokaiser
Copy link
Contributor Author

ildyria pushed a commit that referenced this issue Jan 30, 2023
URLs in RSS feeds are "https://example.com/#xyzzy/aabbcc". This works in
default installations, however the canonical URL to albums (and photos)
starts with "/gallery", so these URLs should be
"https://example.com/gallery#xyzzy/aabbcc".

When using the landing page, URLs even _need_ to include "gallery",
otherweise all of the RSS URLs only show the landing page.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants