Roma-JS / roma-js-on-astro

https://romajs.org/ website powered by https://astro.build/
https://romajs.org/
MIT License
8 stars 7 forks source link

Incorrect link[rel="alternate"] href for upcoming events and previous events pages #90

Open FaberVitale opened 1 week ago

FaberVitale commented 1 week ago

Describe the bug

Repro steps

  1. Visit one of these pages:
  2. Open the console and paste:
    console.log(document.querySelector('link[rel="alternate"]').href)
  3. navigate the link you see in console

Expected

The page should be the equivalent in the other language it => en and viceversa

Current

The link is incorrect and points to a 404.

example

https://romajs.org/it/upcoming-events/

System Info

not relevant

Severity

major

FaberVitale commented 1 week ago

It seems that the whole link rel="alternate" automatic generation is a bit naive (my bad 😅) and should be refactored entirely.

See generateLinkRelAlternateProps: https://github.com/Roma-JS/roma-js-on-astro/blob/46d7dcc6d0d9e0f1716435022bbe3383fd148dcf/src/i18n/config.ts#L39