A simple way to generate the main menu in an generic way is the
extension/modification of this construct, which I've found within a
pudge template:
<li class="page_item"
py:for="doc in generator.documents"
py:if="doc['basename'] != 'doc-license'"
py:strip="">
<a href="${doc['basename']}.html">${doc['title']}</a>
</li>
-
Configurable Main Menu.
Requirements:
- should not alter existent setups
- should not alter existent code-base (pudge / kid)
- should avoid overload of existent setup.cfg
Possible Solution:
add additional file which contains the menu definition (sequence,
external links)
-
I am not familar with pudge/kid/python.
Thus I need some help of people with know the python constructs to
implement the solution.
-
example for external configuration file (possibly yaml?):
home = index.html
doc = doc-index.html
blog = http://external_blog_url.com
credits = credits.html
-
<?python
# create destination collection menu_entries
# load external definition-file into the collection menu
# possibly extract some data from generator.documents
# make all this fine accessible via "entry.attribute"
>
-
If I have the above python constructs / code, I can process the rest:
<li class="page_item"
py:for="entry in menu_entries"
py:strip="">
<a href="${entry.link}">${entry.title}</a>
</li>
-
The config file could be added into the doc folder.
This solution does not alter the core-code of pudge.
It could be migrated later into the pudge code.
.
--
http://lazaridis.com
_______________________________________________
Pudge mailing list
[email protected]
http://lesscode.org/mailman/listinfo/pudge