diff --git a/bukuserver/server.py b/bukuserver/server.py index 110ca70..09fec3c 100644 --- a/bukuserver/server.py +++ b/bukuserver/server.py @@ -530,6 +530,8 @@ def create_app(config_filename=None): """Shell context definition.""" return {'app': app, 'bukudb': bukudb} + app.jinja_env.filters['netloc'] = lambda x: urlparse(x).netloc # pylint: disable=no-member + Bootstrap(app) # routing app.add_url_rule('/api/tags', 'get_tags', get_tags, methods=['GET']) diff --git a/bukuserver/templates/bukuserver/base.html b/bukuserver/templates/bukuserver/base.html index 5d470cb..52f7689 100644 --- a/bukuserver/templates/bukuserver/base.html +++ b/bukuserver/templates/bukuserver/base.html @@ -60,6 +60,9 @@ {% for item in bookmarks %}

+ {% if item.url|netloc %} + + {% endif %} {{item.title}}