Post subfolder index pages

已查看 78 次
跳至第一个未读帖子

Yaşar Arabacı

未读,
2013年10月3日 12:25:422013/10/3
收件人 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

未读,
2013年10月3日 12:30:452013/10/3
收件人 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

未读,
2013年10月3日 12:32:372013/10/3
收件人 nikola-...@googlegroups.com

Yaşar Arabacı

未读,
2013年10月3日 12:42:582013/10/3
收件人 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

未读,
2013年10月3日 12:44:352013/10/3
收件人 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ı

未读,
2013年10月3日 13:03:522013/10/3
收件人 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ı

未读,
2013年10月6日 11:40:062013/10/6
收件人 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/
回复全部
回复作者
转发
0 个新帖子