mephisto - section with multiple pages on homepage (static intro page)

Stamped: 2008-06-21 00:00:00 -0400 | Show comments

mephisto picture

The way mephisto works, you can't have a static intro page (one article per page, a 'paged' section), and a blog in a subdirectory (ie. /journal). These options are found under the 'sections' tab.

The reason it breaks is because of the way mephisto uses permanent links. It won't prefix permanent links with the URL associated with their section.

There are a number of ways to fix this:

  • sneaky template manuvering (the solution I took described below)
  • changing the way permanent links are constructed in the mephisto code-base (seemingly the proper way) and submitting a patch to include it in future revisions
  • just moving the whole mephisto installation to a subdirectory. This has it's problems because you wouldn't have access to the articles at all to slap on your introduction page. I use them to represent the 'portfolio' on this website.

The first method is the quickest; using the templates to achieve this is fairly simple and straightforward. In your 'layout.liquid', which is the default template, you can add the following:

{% if @section != nil %}
{% include 'home' %}
{% else %}
{% include 'journal'%}
{% endif %}

There also exists a 'home.liquid' and 'journal.liquid' template with however you want them to be designed. And that's it!

tags: mephisto
recent entries
Rails — A faster way for next and previous links on a post, article, or any model
The awkward things Siri says
Node.js — Getting oAuth Up and Running Using Express.js and Mongoose
Node.js — Getting oAuth Up and Running Using Express.js, Railway.js and Mongoose
Migrating from Rails 3.1 RC4 to RC5 using Heroku's Cedar Stack (also compass, unicorn, and sendgrid)
Random Freeze Fix for GTX 460 in 10.6 (osx86)
Wasted on Steam - an analytic tool for the Steam platform
Rails 3.1 — SQL logging to STDOUT during testing (with rspec, test::unit, or cucumber)
Rails 3.1 — Using ERB/HAML/etc within a Coffeescript JS file
Rails 3.1 — 'load_missing_contant': Expected ... to define ... (LoadError)
View the entire archive of articles