Handle not found links better, configurable URLs #17
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
🇺🇸 🇬🇧
Currently, I don't know what language to use for the org. I saw RISTEK often speaks English, but as an Indonesian-based organization, it just feels wrong. It doesn't stop me to contribute, though
Usually, when the links are not found, it would redirect us into a bland 404 page. This PR would make it so it would redirect to the index, and add a nice toast afterwards.
Also changed on this PR:
It should work, but I since I don't know much about React/Next.JS, it might not work as expected on prod? I tried my best and I know it would work theoritically, but please check it!
Some other changes from me will be made in later PRs, such as docs and Wrangler stuff, but I think that could be done later.
🇮🇩
Untuk sekarang, saya kurang tahu bahasa apa yang kugunakan di dalam organisasi. Saya lihat RISTEK lebih sering pakai bahasa Inggris, tapi sebagai suatu organisasi Indonesia, kelihatannya agak sedikit aneh. Tetap saja, ini tidak akan menghentikanku untuk berkontribusi.
Biasanya, kalau linknya tidak ditemukan, ia akan mengalihkan kita kepada sebuah halaman 404. PR ini akan membuat ia mengalihkan kita ke pada halaman index, dan memunculkan sebuah toast setelahnya.
Harusnya sih bisa, tapi karena saya tidak begitu paham tentang React/Next.JS, ini mungkin tidak akan bekerja semestinya di prod? Saya sudah mencobanya sebisaku dan saya tahu ini harusnya bekerja di atas kertas, tapi mohon diperiksa!
Beberapa perubahan lainnya di PR ini:
Akan ada perubahan lain dari saya pada PR-PR berikutnya, seperti docs dan terkait Wrangler, tapi saya rasa itu bisa nanti.