germanysbestkeptsecret / Wookmark-jQuery

A jQuery plugin to create a dynamic, multi-column layout.
MIT License
2.63k stars 759 forks source link

pushstate & seo #138

Closed dgsiegel closed 10 years ago

dgsiegel commented 10 years ago

i would like to add pushstate support to the filter example. while adding that (and also hashtags) is no problem, i struggle with best practices regarding seo. as a wookmark gallery only consists of a single html page, you'll do something like this in your apache configuration (similar examples for nginx or lighttpd can be found on the net)

    RewriteEngine On
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_URI} !index
    RewriteRule (.*) index.html [L]

so basically our page changes its state depending on the current filter. on the server however you're just delivering a single index.html and rewrite rules to only respond with that file, as js is taking over. now of course google is going crazy and won't show you any content in the search results, even if it would be delivered in the initial content. any ideas?

Sebobo commented 10 years ago

Why not prepare the output on the server side and start with an active filter if set?

dgsiegel commented 10 years ago

well, but then where is the advantage of using wookmark at all?

Sebobo commented 10 years ago

The grid layout and the user can still change the filter, even if one was active at the start.

dgsiegel commented 10 years ago

so just to summarize, you propose to

then, depending on which filter gets selected, wookmark jumps in and additionally sets the correct url using pushstate?

Sebobo commented 10 years ago

Yes, the url change has to be made when setting the filter in wookmark, because I don't know whether and when I would add this feature.

Wookmark already uses the .inactive class for hidden items, if you use this, then this should work well.

dgsiegel commented 10 years ago

thanks!