@navbar.initializer
def init_navbar(nav):
    # yield items from database here
    def yield_items():
        for i in range(2):
            external_url = i % '//example.com/x/%d'
            yield nav.Item('X:%d' % i, endpoint='x-serial', url=external_url)
    # extend your bar
    nav['top'].extend(yield_items(), after_endpoint='article')
dataset/ETHPy150Open tonyseek/flask-navigation/examples/simple.py/init_navbar/swapped operands of `%`