Nikola can do that quite easily. What you want to do can be achieved
by the built-in PAGE_INDEX feature. Try setting it to True in conf.py
and see how it looks. As mentioned before, you can change list.tmpl if
you want it to look differently.

Your shortcode didn’t work, because you placed it in a template.
Shortcodes are used in content (posts/pages).

On Thu, 27 Apr 2023 at 07:02, Mitch Berkson <[email protected]> wrote:
>
> I guess I'm not clear whether it is possible to do what I want within Nikola. 
> Maybe I'm thinking about this the wrong way.
>
> I am only interested in pages and not posts or other things. I want to have 
> directories which contain pages (.md files with metadata). For each directory 
> there will be a page which displays links to all the pages in that directory. 
> When I add a page, the directory page is updated when I build the web site. 
> Am I trying to do something which is not well-suited to the Nikola way of 
> doing things?
>
> On Thursday, April 27, 2023 at 12:45:33 AM UTC-4 Mitch Berkson wrote:
>>
>> When I include the shortcode {{% post-list stop=5 %}}{{% /post-list %}} in 
>> my template, there is a jinja2 error which says that % was unexpected. Is 
>> that the right way to use the shortcode?
>>
>> On Wednesday, April 26, 2023 at 2:03:18 PM UTC-4 [email protected] wrote:
>>>
>>> On Wed, 26 Apr 2023 at 19:33, Mitch Berkson <[email protected]> wrote:
>>> >
>>> > Thanks. That sounds better. Unfortunately, I'm lost looking for more 
>>> > information about incorporating page folder indexes into a template or 
>>> > how I would use listings.
>>>
>>> Nikola has a different approach, it has standardized types of things
>>> and auto-generates it based on other input, with templates whose names
>>> are defined by Nikola. Tags and categories generate an index of tags
>>> and categories and separate index pages per tag/category (with the
>>> output directory structure configurable). Archives are generated for
>>> every year/month/day (with the lowest level of granularity
>>> configurable).
>>>
>>> If you enable the PAGE_INDEX setting, index.html files will be
>>> automatically generated for all pages directories and subdirectories.
>>> It will use the list.tmpl template with the pagekind template variable
>>> containing "page_index" (it's a list).
>>>
>>> Listings are for displaying source code. If you put files in the
>>> listings/ directory, they will be turned into formatted HTML, with
>>> indexes added.
>>>
>>> If you want more granular control, and if your use-case does not fit
>>> the Nikola standard use-cases, you can use the post-list directive in
>>> a page: https://getnikola.com/handbook.html#post-list - It has
>>> filtering options and it lets you customize the template, so it is
>>> probably as flexible as you need (although I recommend exploring the
>>> standard index pages first).
>>>
>>> --
>>> Chris Warrick <https://chriswarrick.com/>
>>> PGP: 5EAAEA16
>
> --
> 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 [email protected].
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/nikola-discuss/72b89949-54a8-4c98-a2ad-05960db475c4n%40googlegroups.com.



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

-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/nikola-discuss/CAMw%2Bj7JWRRa0CSFEFD6NFpxr3O5o%2B91khd4y2qMZLJwx4Cb1BQ%40mail.gmail.com.

Reply via email to