Remove current page from part of navbar caching
We don't show the currently active page in the nav, so this isn't necessary. This also allows the cache to be shared between pages.
This commit is contained in:
parent
4702afd5dd
commit
51be747103
2 changed files with 3 additions and 5 deletions
|
@ -23,8 +23,8 @@
|
|||
<body class="{% block body_class %}{% endblock %}">
|
||||
{% wagtailuserbar %}
|
||||
|
||||
{% cache 3600 "navbar" page %}
|
||||
{% navbar page %}
|
||||
{% cache 3600 "navbar" %}
|
||||
{% navbar %}
|
||||
{% endcache %}
|
||||
|
||||
{% block main %}
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
from django.template import Library
|
||||
from wagtail.models import Page
|
||||
|
||||
from website.home.models import HomePage
|
||||
|
||||
|
@ -7,10 +6,9 @@ register = Library()
|
|||
|
||||
|
||||
@register.inclusion_tag("common/navbar.html")
|
||||
def navbar(current_page: Page) -> dict:
|
||||
def navbar() -> dict:
|
||||
homepage = HomePage.objects.live().get()
|
||||
return {
|
||||
"current_page": current_page,
|
||||
"homepage": homepage,
|
||||
"nav_pages": homepage.get_children()
|
||||
.live()
|
||||
|
|
Loading…
Reference in a new issue