Re: [nanoc] 2 questions.

17 views
Skip to first unread message

justin

unread,
Apr 13, 2013, 8:17:41 PM4/13/13
to na...@googlegroups.com

On Sat, Apr 13, 2013 at 5:17 AM, Serg Apet <se...@djhd.com> wrote:

I think it was asked several times already and I saw the note in Rules.
However I do not understand why compile and route do not work route by extension ? Is it by design or a sad limitation ?

I'm trying to convert several joomla files to nanoc hoping to add little bit more automation.

I quickly get messed with Rules file. Is index.html something special name ? in content dir there are index.html and about.html
after compiling there are in output: about.html and .html
There is nothing special in Rules. Only '*'


There's something special, not just about index.html, but about index.* ...

On most webservers, the "index" file is a special one because it represents the parent directory. For example, if you visit


... you are likely looking at a file named


nanoc is the same way. So in your case, you have a file with the identifier `/about/` (e.g. about.html) and a file with the identifier `/` (e.g. index.html). If your routing rule just does `item.identifier.chop + '.' + item[:extension]` then the first one will route as `about.html` and the second one will route as `.html`.

for that file, just add a special case route before your '*' rule:

    route '/' do
      '/index.html'
    end

--j

Reply all
Reply to author
Forward
0 new messages