typo permalinks in Mephisto 0.7

Update: This was definitely not the best solution. As Rick Olsen points out below, it’s possible to change the permalink style to /articles/:year/:month/:day in the settings. If you want to use Mephisto style URLs, but have Mephisto redirect Typo style permalinks, you add one line at the bottom of your environment.rb file:

Mephisto::Routing.redirect 'articles/*' => '$1'

It turns out that Mephisto 0.7 adds a highly sophisticated (and pretty damn confusing) dispatching system. This means that simply adding a route that matches Typo permalinks isn’t enough anymore. I wound up having to edit the lib/mephisto/dispatch.rb file, like so:

  def self.recognize_permalink(site, path)
    path.shift if path[0] == "articles" 
    full_path = path.join('/')

The center line is the only new one. Hopefully that helps.


About this entry