diff --git a/bookmarks/templates/bookmarks/archive.html b/bookmarks/templates/bookmarks/archive.html
index bd8d1c1..407089b 100644
--- a/bookmarks/templates/bookmarks/archive.html
+++ b/bookmarks/templates/bookmarks/archive.html
@@ -5,42 +5,42 @@
{% block content %}
- {% include 'bookmarks/bulk_edit/state.html' %}
+ {% include 'bookmarks/bulk_edit/state.html' %}
-
+
- {# Bookmark list #}
-
-
+ {# Bookmark list #}
+
+ {% if empty %}
+ {% include 'bookmarks/empty_bookmarks.html' %}
+ {% else %}
+ {% bookmark_list bookmarks return_url link_target %}
+ {% endif %}
+
+
- {# Tag list #}
-
-
- {% tag_cloud tags selected_tags %}
-
-
+ {# Tag list #}
+
+
+ {% tag_cloud tags selected_tags %}
+
+
-
-
-
+
+
+
{% endblock %}
diff --git a/bookmarks/templates/bookmarks/bookmark_list.html b/bookmarks/templates/bookmarks/bookmark_list.html
index 68aded0..5cbae67 100644
--- a/bookmarks/templates/bookmarks/bookmark_list.html
+++ b/bookmarks/templates/bookmarks/bookmark_list.html
@@ -1,91 +1,98 @@
{% load shared %}
{% load pagination %}
-
-You can now close this window.
+
+ You can now close this window.
{% endblock %}
diff --git a/bookmarks/templates/bookmarks/edit.html b/bookmarks/templates/bookmarks/edit.html
index bb61f81..bedb77a 100644
--- a/bookmarks/templates/bookmarks/edit.html
+++ b/bookmarks/templates/bookmarks/edit.html
@@ -2,14 +2,15 @@
{% load bookmarks %}
{% block content %}
-
- {% csrf_token %}
- {{ form.website_title }}
- {{ form.website_description }}
- {{ form.auto_close|attr:"type:hidden" }}
-
-
-
-
-
diff --git a/bookmarks/templates/bookmarks/index.html b/bookmarks/templates/bookmarks/index.html
index 248f2e7..3f69df1 100644
--- a/bookmarks/templates/bookmarks/index.html
+++ b/bookmarks/templates/bookmarks/index.html
@@ -5,42 +5,42 @@
{% block content %}
- {% include 'bookmarks/bulk_edit/state.html' %}
+ {% include 'bookmarks/bulk_edit/state.html' %}
-
+
- {# Bookmark list #}
-
-
+ {# Bookmark list #}
+
+ {% if empty %}
+ {% include 'bookmarks/empty_bookmarks.html' %}
+ {% else %}
+ {% bookmark_list bookmarks return_url link_target %}
+ {% endif %}
+
+
- {# Tag list #}
-
-
- {% tag_cloud tags selected_tags %}
-
-
+ {# Tag list #}
+
+
+ {% tag_cloud tags selected_tags %}
+
+
-
-
-
+
+
+
{% endblock %}
diff --git a/bookmarks/templates/bookmarks/layout.html b/bookmarks/templates/bookmarks/layout.html
index f2be882..90fbb78 100644
--- a/bookmarks/templates/bookmarks/layout.html
+++ b/bookmarks/templates/bookmarks/layout.html
@@ -5,61 +5,61 @@
{# Use data attributes as storage for access in static scripts #}
-
-
-
-
-
-
-
-
linkding
- {# Include SASS styles, files are resolved from bookmarks/styles #}
- {# Include specific theme variant based on user profile setting #}
- {% if request.user.profile.theme == 'light' %}
-
- {% elif request.user.profile.theme == 'dark' %}
-
- {% else %}
- {# Use auto theme as fallback #}
-
-
- {% endif %}
+
+
+
+
+
+
+
+
linkding
+ {# Include SASS styles, files are resolved from bookmarks/styles #}
+ {# Include specific theme variant based on user profile setting #}
+ {% if request.user.profile.theme == 'light' %}
+
+ {% elif request.user.profile.theme == 'dark' %}
+
+ {% else %}
+ {# Use auto theme as fallback #}
+
+
+ {% endif %}
- {% block content %}
- {% endblock %}
+ {% block content %}
+ {% endblock %}
diff --git a/bookmarks/templates/bookmarks/nav_menu.html b/bookmarks/templates/bookmarks/nav_menu.html
index b7dfe85..88d895d 100644
--- a/bookmarks/templates/bookmarks/nav_menu.html
+++ b/bookmarks/templates/bookmarks/nav_menu.html
@@ -1,93 +1,101 @@
+{% load shared %}
+{% htmlmin %}
{# Basic menu list #}
{# Menu drop-down for smaller devices #}
+{% endhtmlmin %}
diff --git a/bookmarks/templates/bookmarks/new.html b/bookmarks/templates/bookmarks/new.html
index 62d0144..1166e1b 100644
--- a/bookmarks/templates/bookmarks/new.html
+++ b/bookmarks/templates/bookmarks/new.html
@@ -2,14 +2,14 @@
{% load bookmarks %}
{% block content %}
-
-
-
+
+
+
{% endblock %}
diff --git a/bookmarks/templates/bookmarks/pagination.html b/bookmarks/templates/bookmarks/pagination.html
index c7b94f1..59f853e 100644
--- a/bookmarks/templates/bookmarks/pagination.html
+++ b/bookmarks/templates/bookmarks/pagination.html
@@ -1,35 +1,35 @@
{% load shared %}
\ No newline at end of file
diff --git a/bookmarks/templates/bookmarks/search.html b/bookmarks/templates/bookmarks/search.html
index a4b35a2..1d49def 100644
--- a/bookmarks/templates/bookmarks/search.html
+++ b/bookmarks/templates/bookmarks/search.html
@@ -1,43 +1,43 @@
{# Replace search input with auto-complete component #}
\ No newline at end of file
diff --git a/bookmarks/templates/bookmarks/shared.html b/bookmarks/templates/bookmarks/shared.html
index 3fa0d4c..ebcffd4 100644
--- a/bookmarks/templates/bookmarks/shared.html
+++ b/bookmarks/templates/bookmarks/shared.html
@@ -5,44 +5,44 @@
{% block content %}
-
+
- {# Bookmark list #}
-
-
+ {# Bookmark list #}
+
+
-
- {% csrf_token %}
+
+ {% csrf_token %}
- {% if empty %}
- {% include 'bookmarks/empty_bookmarks.html' %}
- {% else %}
- {% bookmark_list bookmarks return_url link_target %}
- {% endif %}
-
-
+ {% if empty %}
+ {% include 'bookmarks/empty_bookmarks.html' %}
+ {% else %}
+ {% bookmark_list bookmarks return_url link_target %}
+ {% endif %}
+
+
- {# Filters #}
-
-
-
- {% user_select filters users %}
-
-
-
- {% tag_cloud tags selected_tags %}
-
-
+ {# Filters #}
+
+
+
+ {% user_select filters users %}
+
+
+
+ {% tag_cloud tags selected_tags %}
+
+
-
-
+
+
{% endblock %}
diff --git a/bookmarks/templates/bookmarks/tag_cloud.html b/bookmarks/templates/bookmarks/tag_cloud.html
index 579d2b5..921f0a9 100644
--- a/bookmarks/templates/bookmarks/tag_cloud.html
+++ b/bookmarks/templates/bookmarks/tag_cloud.html
@@ -1,35 +1,37 @@
{% load shared %}
-
-
+{% endhtmlmin %}
diff --git a/bookmarks/templatetags/shared.py b/bookmarks/templatetags/shared.py
index 9e136db..e8b3857 100644
--- a/bookmarks/templatetags/shared.py
+++ b/bookmarks/templatetags/shared.py
@@ -1,3 +1,5 @@
+import re
+
from django import template
from bookmarks import utils
@@ -48,6 +50,7 @@ def remove_from_query_param(context, **kwargs):
return query.urlencode()
+
@register.simple_tag(takes_context=True)
def replace_query_param(context, **kwargs):
query = context.request.GET.copy()
@@ -87,3 +90,22 @@ def humanize_relative_date(value):
if value in (None, ''):
return ''
return utils.humanize_relative_date(value)
+
+
+@register.tag
+def htmlmin(parser, token):
+ nodelist = parser.parse(('endhtmlmin',))
+ parser.delete_first_token()
+ return HtmlMinNode(nodelist)
+
+
+class HtmlMinNode(template.Node):
+ def __init__(self, nodelist):
+ self.nodelist = nodelist
+
+ def render(self, context):
+ output = self.nodelist.render(context)
+
+ output = re.sub(r'\s+', ' ', output)
+
+ return output