migrating from soho, need nested/recursive folder/story generation

35 views
Skip to first unread message

brad clements

unread,
Jan 1, 2013, 9:37:10 PM1/1/13
to nikola-...@googlegroups.com
Hi,

I would like to migrate from Soho to Nikola. Soho is based on ZPT and is just a static site generator. Generally, the contents of a 'src' directory are recursively copied to the output directory, and 'dirty' files are compiled as needed.

e.g.
src/index.rst -> output/index.htm
src/somefolder/something.rst -> output/somefolder/something.htm

I see now with plugin support I can add ZPT based templates (if I think that's easier than learning mako/jinja)

But how do I handle recursive folder support?  Searching through this forum I found a post on 'custom home page', which looked as if I'd need an entry in the conf.py file for every subdirectory.

Is that the only way to do it?

Also is there any way for a template engine to access meta data from every page (even non-dirty pages) during the render process?

For example I might want to automatically generate nav tabs (I realize  might have to rebuild everything anyway to get them to come out correctly)

(Is this what an index does for blog pages?)

It seems like Nikola is mostly a blogging tool with some support for static pages, but I think I need a static site generator with support for blogging. Slightly different emphasis..

Thanks

Roberto Alsina

unread,
Jan 1, 2013, 9:49:36 PM1/1/13
to nikola-...@googlegroups.com
On 01/01/13 23:37, brad clements wrote:
> Hi,
>
> I would like to migrate from Soho to Nikola. Soho is based on ZPT and
> is just a static site generator. Generally, the contents of a 'src'
> directory are recursively copied to the output directory, and 'dirty'
> files are compiled as needed.
>
> e.g.
> src/index.rst -> output/index.htm
> src/somefolder/something.rst -> output/somefolder/something.htm
>
> I see now with plugin support I can add ZPT based templates (if I
> think that's easier than learning mako/jinja)
>
> But how do I handle recursive folder support? Searching through this
> forum I found a post on 'custom home page', which looked as if I'd
> need an entry in the conf.py file for every subdirectory. Is that the
> only way to do it?

That's something that may work now. In fact, we could do that
automatically, since the conf.py is python, so we could traverse the
folders and add the entries.

OTOH, recursive folders sounds like a nice-to-have, so... why not try to
have it?
It should not be terribly difficult to do.

> Also is there any way for a template engine to access meta data from
> every page (even non-dirty pages) during the render process?

Sure. The plugins have access to the site object (as self.site) and that
contains the whole timeline (self.site.timeline)

>
> For example I might want to automatically generate nav tabs (I
> realize might have to rebuild everything anyway to get them to come
> out correctly)

Right. You can do that, although it may involve lots of occasional
regeneration.

>
> (Is this what an index does for blog pages?)
>
> It seems like Nikola is mostly a blogging tool with some support for
> static pages, but I think I need a static site generator with support
> for blogging. Slightly different emphasis..
>

I am very willing to make Nikola a blogging tool with great static page
support too :-)

> Thanks
>

Roberto Alsina

unread,
Jan 2, 2013, 8:33:24 AM1/2/13
to nikola-...@googlegroups.com

On Tuesday, January 1, 2013 11:37:10 PM UTC-3, brad clements wrote:
Hi,

I would like to migrate from Soho to Nikola. Soho is based on ZPT and is just a static site generator. Generally, the contents of a 'src' directory are recursively copied to the output directory, and 'dirty' files are compiled as needed.

e.g.
src/index.rst -> output/index.htm
src/somefolder/something.rst -> output/somefolder/something.htm


Done :-)

I cleaned up some crufty code in the process of implementing this, hopefully breaking nothing. 

brad clements

unread,
Jan 2, 2013, 8:57:31 AM1/2/13
to nikola-...@googlegroups.com
Great, thanks!

I'll give it a try
Reply all
Reply to author
Forward
0 new messages