Rather than open source the entire website, there's a number of companies that open source very specific components of their much larger website. By focusing in on a very specific use case, it's easier to 1) comprehend, as a newcomer, and 2) contribute back to. You're also forced to write the library internally differently since you know it'll be open source and will need to stand on its own (so no hackish, dirty implementations on your own site!) In many cases, this "forced abstraction" makes for much better code for yourself.
I really like the latter approach. It's what GitHub does with Grit or Resque, or Shopify does with active_merchant, or Intridea does with OmniAuth. But note that releasing specific components doesn't prevent you from releasing your whole site as open source, either... you can certainly do both (which may be the best of both worlds!)