rynorris / blog

My personal blog
MIT License
0 stars 0 forks source link

One-page site #12

Closed rynorris closed 9 years ago

rynorris commented 9 years ago

At the moment the main page and permalink pages are the same page. This whole site could be one page, improving browsing speed and reducing server load.

This would require two things:

  1. Make the about page just a special case of the main page. (it's basically just a permalink page to an article which doesn't show up in the main list.)
  2. When clicking through from home/about/permalinks, don't reload the whole page. Just throw away the state in the article list (or even keep it cached if we're clever) and load the correct set of articles. Adjust the URL in the URL bar accordingly so that the page can be linked as expected

Given the existing infrastructure, these should be minor changes to the javascript only.

rynorris commented 9 years ago

Would need to be careful to keep browser history working. See window.history.pushState and window.history.onpopstate. These only work in html5. So if I want to keep support for older browsers I'd need to check and do normal page loads if not supported.

rynorris commented 9 years ago

Now fully fixed by cce22cec8dfec8462db3a0f8e6eb2d93c0a8303e.

When supported, the page will never reload whilst browsing the site! History fully supported and works as expected.