# HG changeset patch # User Goffi # Date 1601305924 -7200 # Node ID 2da573bf3f8bc603f526ca04e36cd965e4927843 # Parent 3c5054a22e7a0e3762f287cfd6a65315722b7c1a server: new `menu_extra_json` configuration option: this option can be used tp extend the defaut menu without having to redefine it. diff -r 3c5054a22e7a -r 2da573bf3f8b libervia/server/server.py --- a/libervia/server/server.py Thu Sep 17 22:50:27 2020 +0200 +++ b/libervia/server/server.py Mon Sep 28 17:12:04 2020 +0200 @@ -836,8 +836,12 @@ self._moveFirstLevelToDict(self.options, "url_redirections_dict", sites_names) self._moveFirstLevelToDict(self.options, "menu_json", sites_names) - if not '' in self.options["menu_json"]: - self.options["menu_json"][''] = C.DEFAULT_MENU + self._moveFirstLevelToDict(self.options, "menu_extra_json", sites_names) + menu = self.options["menu_json"] + if not '' in menu: + menu[''] = C.DEFAULT_MENU + for site, value in self.options["menu_extra_json"].items(): + menu[site].extend(value) # we create virtual hosts and import Libervia pages into them self.vhost_root = vhost.NameVirtualHost() diff -r 3c5054a22e7a -r 2da573bf3f8b twisted/plugins/libervia_server.py --- a/twisted/plugins/libervia_server.py Thu Sep 17 22:50:27 2020 +0200 +++ b/twisted/plugins/libervia_server.py Mon Sep 28 17:12:04 2020 +0200 @@ -138,6 +138,7 @@ ["vhosts_dict", None, {}, None], ["url_redirections_dict", None, {}, None], ["menu_json", None, {'': C.DEFAULT_MENU}, None], + ["menu_extra_json", None, {}, None], ["tickets_trackers_json", None, None, None], ["mr_handlers_json", None, None, None], ]