Post subfolder index pages

80 views
Skip to first unread message

Yaşar Arabacı

unread,
Oct 3, 2013, 12:25:42 PM10/3/13
to nikola-...@googlegroups.com
Hi,

My posts page is organized like this:

    POSTS = (
        ("yazilar/*.md", "yazilar", "post.tmpl"),
    )
    PAGES = (
        ("sayfalar/*.md", "", "story.tmpl"),
    )

In my `yazilar` directory, I have a directory named `python` for my Python posts, and there is a folder in `Python`, that I use to collect 6 related posts in one directory. I am organizing my posts like this because I like the way urls are produced.

However, `domain.com/yazilar`, `domain.com/yazilar/` and other directory doesn't have generated index pages. Should I create them manually by creating a post with 'index' as a slug and listing relevant pages in it? Is there an option for nikola to create this page automatically for me?

Roberto Alsina

unread,
Oct 3, 2013, 12:30:45 PM10/3/13
to nikola-...@googlegroups.com
This is a known bug, although I can't find it in the Issue tracker, so
maybe it was just discussed here.

In the meantime, you can create your own pages with index as a slug,
which will probably produce a nicer page anyway.

Roberto Alsina

unread,
Oct 3, 2013, 12:32:37 PM10/3/13
to nikola-...@googlegroups.com

Yaşar Arabacı

unread,
Oct 3, 2013, 12:42:58 PM10/3/13
to nikola-...@googlegroups.com
In addition to STORY_INDEX is limited issue, is it possible to add a POST_INDEX optio also? If I am not mistaken, STORY_INDEX option won't create index pages for posts folders/subfolders.

Roberto Alsina

unread,
Oct 3, 2013, 12:44:35 PM10/3/13
to nikola-...@googlegroups.com
On 03/10/13 13:42, Yaşar Arabacı wrote:
> In addition to STORY_INDEX is limited issue, is it possible to add a
> POST_INDEX optio also? If I am not mistaken, STORY_INDEX option won't
> create index pages for posts folders/subfolders.

I don't quite know what that option would do, to be honest.

Yaşar Arabacı

unread,
Oct 3, 2013, 1:03:52 PM10/3/13
to nikola-...@googlegroups.com
Consider this directory structure;

/ (root folder of nikola site)
posts/
  python/
    first-python-post.md
second-python-post.md
  linux/
    what-good-is-linux.md
command-line-magic.md
arch-linux/
 is-it-even-worth-the-effort.md
 
What I want to have is posts/python/index.html,
posts/linux/index.html, posts/linux/arch-linux/index.html etc. so that
when visitor remove some part of the url, s/he won't see the naked
directory listing, but instead, s/he will see a page similiar to
individual tag pages, that list posts that reside in that directory.

Also, one might want to make homepage static, so that he will have
chronological index of posts in domain.com/posts/index.html, instead of

Yaşar Arabacı

unread,
Oct 6, 2013, 11:40:06 AM10/6/13
to nikola-...@googlegroups.com
I did it this way;

Before I run nikola build, I run this code:
https://gist.github.com/yasar11732/6855470. And I have set my POSTS
and PAGES like this;

POSTS = (
("yazilar/*.md", "", "post.tmpl"),
)
PAGES = (
("sayfalar/*.md", "", "story.tmpl"),
("about/*.md","","about.tmpl"),
("subindex/*.md","","story.tmpl")
)

That way, I can have index pages on deeper folders in posts
directories rendered by nikola.

2013/10/3 Yaşar Arabacı <yasar...@gmail.com>:
> --
> You received this message because you are subscribed to the Google Groups
> "nikola-discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to nikola-discus...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.



--
http://ysar.net/
Reply all
Reply to author
Forward
0 new messages