separate navigation configuration

This commit is contained in:
Dita Aji Pratama 2025-06-04 12:09:08 +07:00
parent f94259564a
commit dfa0c52247
3 changed files with 26 additions and 27 deletions

View File

@ -1,28 +1,3 @@
title = "CostaPy"
menu = {
"public": {
"navbar": [
{
"name":"Home",
"target":"_self",
"href":"/",
"roles":["guest"]
},
{
"name":"About",
"target":"_self",
"href":"/about",
"roles":["guest"]
},
{
"name":"Docs",
"target":"_blank",
"href":"https://costapy.ditaajipratama.net",
"roles":["guest"]
}
]
}
}
copyright = "Copyright (C) 2022 Dita Aji Pratama"

24
config/navigation.py Normal file
View File

@ -0,0 +1,24 @@
menu = {
"public": {
"navbar": [
{
"name":"Home",
"target":"_self",
"href":"/",
"roles":["guest"]
},
{
"name":"About",
"target":"_self",
"href":"/about",
"roles":["guest"]
},
{
"name":"Docs",
"target":"_blank",
"href":"https://costapy.ditaajipratama.net",
"roles":["guest"]
}
]
}
}

View File

@ -1,5 +1,5 @@
from mako.template import Template
from config import globalvar
from config import globalvar, navigation
class main:
@ -11,7 +11,7 @@ class main:
title = globalvar.title,
header = "Welcome to CostaPy",
navbar = Template(params["mako"]["website"]['navbar']).render(
menu = globalvar.menu['public']['navbar'],
menu = navigation.menu['public']['navbar'],
user_roles = ["guest"],
active_page = "Home"
),