From b659a8bd02da55e730530c0c1f5f9d7445bf358b Mon Sep 17 00:00:00 2001 From: rachmadaniHaryono Date: Tue, 1 May 2018 17:55:44 +0800 Subject: [PATCH] new: dev: favicon for entry --- bukuserver/server.py | 2 ++ bukuserver/templates/bukuserver/base.html | 3 +++ 2 files changed, 5 insertions(+) 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}}