Mercurial > libervia-website
view pages/documentation/page_meta.py @ 8:dc880664a8ec
modernisation of the theme using Bulma
author | Goffi <goffi@goffi.org> |
---|---|
date | Fri, 16 Apr 2021 18:51:12 +0200 |
parents | 9ce41ef66dfa |
children | f47d6ba74a26 |
line wrap: on
line source
#!/usr/bin/env python2.7 # -*- coding: utf-8 -*- from sat.core.log import getLogger from sat.core.i18n import _ log = getLogger(__name__) name = "documentation" template = "doc/doc.html" allowed_docs = None def parse_url(self, request): """URL is /[DOC_NAME]""" global allowed_docs template_data = request.template_data if allowed_docs is None: allowed_docs = sorted(self.getConfig("sub_docs_dict", {}).keys()) try: allowed_docs.remove('sat') except KeyError: log.error("sat doc not available") else: allowed_docs.insert(0, "sat") try: doc_name = self.nextPath(request) except IndexError: doc_name = 'sat' else: if doc_name not in allowed_docs: log.warning(_("unknown doc name: {doc_name}").format(doc_name=doc_name)) doc_name = 'sat' template_data['doc_name'] = doc_name template_data['all_docs'] = allowed_docs