Navigation links

17 views
Skip to first unread message

j.su...@wanadoo.fr

unread,
Nov 9, 2020, 3:33:28 AM11/9/20
to nikola-discuss
Hi all,

I'm doing a site and I'm trying to understand how navigation links works between pages and output. I just try to link agenda pages with, for the index :

.. title: AGENDA
.. slug: agenda_index

to my menu :

NAVIGATION_LINKS = {
    DEFAULT_LANG: (
        ("/index.html", "ACCUEIL"),
        ((
            ('/index', 'Index'),
            ('/now', 'A présent'),
            ('/older', 'Archives')),
        'AGENDA'),
        ("/categories/", "Étiquettes"),
    ),
}

How do I declare the hierarchy in my pages ? In my folders ? 
Is it the title, or the slug of page that has to be declared in my conf.py ? 
What's the order I have to follow ? first create directly the folder "agenda" ? 

I'm a great neophyte, but I really do my best, reading over and over the handbook, but I'm really bad for this...

Thanks !!

Chris Warrick

unread,
Nov 10, 2020, 12:31:52 PM11/10/20
to Nikola—Discuss
If you want /agenda/ and /agenda/now/ in output:

1. mkdir pages/agenda
2. Put the agenda index in pages/agenda/index.rst, use `index` for the slug
3. Also create pages/agenda/now.rst, use `now` for the slug
4. Make sure that your PAGES config will lead to agenda being placed
in the site root (and not in a pages/ subdirectory)

NAVIGATION_LINKS hierarchies are independent of any paths, so you need
to specify '/agenda/' and '/agenda/now/' as the destinations.

--
Chris Warrick <https://chriswarrick.com/>
PGP: 5EAAEA16
Reply all
Reply to author
Forward
0 new messages