phseiff / phseiff.github.io

The source code repo for my personal website
https://phseiff.com
Other
10 stars 2 forks source link

Switch from hashes in the url to pushState() to improve google indexing. #13

Closed phseiff closed 4 years ago

phseiff commented 4 years ago

Currently, my essays use different hashes in the URL for different essays. It would be far more elegant to instead use something like /in/essay-name via pushState (called whenever scroll_to() discovers an essay to open or close_essay() is called) - typing links with "#" in the browser would still be supported, and just call set_location() which calls pushState automatically (just like it currently does), and the subpages would be correctly indexed. Every pushState() would also change the content of the meta-description tag based on a dict statically build based on the RSS feed, so different pages would have different meta descriptions. I would, however, have to host my website on my own using flask in a docker container, so every call to phseiff.com/in/essay_name could be automatically redirected to phseiff.com/#essay-name (make sure this also works without javascript!).

phseiff commented 4 years ago

Done - I only need to fix the redirection from page to page now.

phseiff commented 4 years ago

Finally, it works... Exactly like it was intended in my description.

phseiff commented 4 years ago

I still need to ensure that links on mastodon are tooted as "/e/"- instead of "/#"-links.

phseiff commented 4 years ago

Done.