skel prefix naming / Page id changing

William Morgan wmorgan-hobix-is-the-way at masanjin.net
Wed Aug 3 23:53:31 EDT 2005


Hi Frederick,

Excerpts from Frederick Ros's mail of  2 Aug 2005 (EDT):
> So I ask myself what is the best solution:
> 
>   1) Change the way the skel method is computed (for example change - to
>      _ in file name) and add aliases to skel_index in my plugin

I think this is the best (most extensible) solution.

How do you structure your dual-language posts? I presume you have
'content-en' and 'content-fr' fields within each entry.  So I would add
skel_index_fr and skel_index_en methods that looked like this:

def skel_index_fr( path_storage )
  skel_index( path_storage ) do |page, entries|
    yield :page => page, :entries => entries.map do |e|
      f = e.dup
      f.content = e.content_fr
      f.summary = e.summary_fr
      f
    end
  end
end

(maybe the dup'ing is unnecessary)

Then you don't need anything else for RSS or for the main page. But you
will have to change the name to an underscore, as you mention---or
modify build_pages to replace hyphens with underscores as well. (I think
that'd be ok.)

It's late at night and this is completely untested code, so I might be
completely off base. Let me know.

-- 
William <wmorgan-hobix-is-the-way at masanjin.net>


More information about the Hobix-is-the-way mailing list