Indexes for pages in sub-directories

96 views
Skip to first unread message

Don Fick

unread,
Sep 29, 2013, 3:16:53 PM9/29/13
to nikola-...@googlegroups.com
I'm using Nikola 6.0.4 to convert an existing hierarchy of web pages into a Nikola site.  Nikola is not generating indexes for pages found in subdirectories below the standard top level directories. This makes it impossible to browse to items that are not posts.

The source files look like this:

posts/
foo1/
bar1.html
bar2.html
foo2/
bara.html
barb.html
pages/
recipes/
pizza.html
hamburger.html
documents/
vehicles/
car.html
truck.html


conf.py looks like this:

POSTS = (
    ("posts/*.html", "posts", "post.tmpl"),
)
PAGES = (
    ("pages/*.html", "pages", "story.tmpl"),
    ("documents/*.html", "documents", "story.tmpl"),
)

Nikola generates index pages for pages/index.html and documents/index.html but there are no entries in the page.

Ideally there would be index pages in each subdirectory, such as pages/recipes/index.html, and also higher level indexes which either list the next level of directories or simply all the files in lower directories similar to the posts index pages.

There is a thread that discusses this (https://groups.google.com/d/topic/nikola-discuss/TYxR4RIWoj0/discussion) and a reference to it in the changelog for 5.2 (*Recursive post/story folders).

Has this been implemented or can someone point me to the task that relates to building indexes?

Thanks,
Don Fick

Roberto Alsina

unread,
Sep 29, 2013, 4:57:48 PM9/29/13
to nikola-...@googlegroups.com
There is a option that's supposed to do this (STORY_INDEX) for pages[1] There is no support for doing this for posts at all.

OTOH STORY_INDEX seems somewhat broken for this case at least.

The code to handle it is in nikola/plugins/task/index


[1] I clearly missed a bunch of option names on the v6 cleanup...

Thomas Janotta

unread,
Oct 27, 2018, 5:20:27 AM10/27/18
to nikola-discuss
Hi Roberto, this is an old post,
but I want to use subdirectories like 'design', 'photos', 'music', each with an own navigation. (/design/shop, /design/links, /music/shop, /music/links etc.)

How should I assign 'NAVIGATION' for this, how should the pages (slug?) be named to achieve this?

maybe i have to create 3 independent 'nikola instances' right in the subfolders?
Thanks.

Chris Warrick

unread,
Oct 27, 2018, 7:07:40 AM10/27/18
to Nikola—Discuss
On Sat, 27 Oct 2018 at 11:20, 'Thomas Janotta' via nikola-discuss
<nikola-...@googlegroups.com> wrote:
>
> Hi Roberto, this is an old post,
> but I want to use subdirectories like 'design', 'photos', 'music', each with an own navigation. (/design/shop, /design/links, /music/shop, /music/links etc.)
>
> How should I assign 'NAVIGATION' for this, how should the pages (slug?) be named to achieve this?
>
> maybe i have to create 3 independent 'nikola instances' right in the subfolders?
> Thanks.

3 independent instances are unnecessary. You will probably need a
custom navigation setup that doesn't use NAVIGATION_LINKS as is (3
templates + 3 menu variables in global context?)

--
Chris Warrick <https://chriswarrick.com/>
PGP: 5EAAEA16

Thomas Janotta

unread,
Oct 27, 2018, 7:28:12 AM10/27/18
to nikola-discuss
Hi Chris,
yes, I also thought about kind of three navigation_link Variables, Have to see how to do this (3 menu variables in global context)
Reply all
Reply to author
Forward
0 new messages