Update back button in PostDetails.astro to redirect to home page when there's no route history.
If a blog post url is pasted in the browser and there's no route history, prior to this commit, back button did not work as expected. Now, if there's somewhere to go back, the back button will go back to the previous route.
If not, the back button will redirect to home page.
Description
Update back button in PostDetails.astro to redirect to home page when there's no route history. If a blog post url is pasted in the browser and there's no route history, prior to this commit, back button did not work as expected. Now, if there's somewhere to go back, the back button will go back to the previous route. If not, the back button will redirect to home page.
Before
https://github.com/satnaing/astro-paper/assets/53733092/a4bfa96d-4d4b-4c39-b827-ce8072a0e1f5
After
https://github.com/satnaing/astro-paper/assets/53733092/098f6c0b-7e9b-4bd1-b032-92444063d9df
Tested Browsers