Configuring nanoc so it will output files in the same directory without renaming them?

StackOverflow https://stackoverflow.com/questions/20791159

  •  21-09-2022
  •  | 
  •  

Pregunta

When I "compile" with nanoc everything ends up in the output directory, but each page ends up in its own directory, (with the exception of the root index.html file). Is there any way to configure nanoc so that it outputs all the files to the same directory renaming them to their original file names?

I haven't found anything in the documentation about this.

¿Fue útil?

Solución

You can accomplish this with a routing rule like the following:

route '*' do
  item.identifier.chop + '.' + item[:extension]
end

If your goal is to have an area under content/ that gets copied verbatim to the output, a better approach would be to set up a static data source that will read these files without dropping their extension and also allow you to keep them in a folder separate from the other, non-static items. The nanoc troubleshooting page has instructions on setting this up ("Solution #2").

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top