Skip to content

Commit d74d0d0

Browse files
lupyanathibaudcolas
authored andcommitted
implement wagtailpagecache example
- added wagtail cache example to the full blog post view
1 parent fe57d73 commit d74d0d0

File tree

1 file changed

+24
-23
lines changed

1 file changed

+24
-23
lines changed
Lines changed: 24 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,37 @@
11
{% extends "base.html" %}
2-
{% load navigation_tags wagtailimages_tags %}
2+
{% load navigation_tags wagtailimages_tags wagtail_cache %}
33

44
{% block content %}
55

66
{% include "base/include/header-blog.html" %}
7+
{% wagtailpagecache 500 page %}
8+
<div class="container">
9+
<div class="row">
10+
<div class="col-md-8">
11+
<div class="blog__meta">
12+
{% if page.authors %}
13+
<div class="blog__avatars">
14+
{% for author in page.authors %}
15+
<div class="blog__author">{% picture author.image format-{avif,webp,jpeg} fill-50x50-c100 class="blog__avatar" %}
16+
{{ author.first_name }} {{ author.last_name }}</div>
17+
{% endfor %}
18+
</div>
19+
{% endif %}
20+
</div>
21+
22+
{{ page.body }}
723

8-
<div class="container">
9-
<div class="row">
10-
<div class="col-md-8">
11-
<div class="blog__meta">
12-
{% if page.authors %}
13-
<div class="blog__avatars">
14-
{% for author in page.authors %}
15-
<div class="blog__author">{% picture author.image format-{avif,webp,jpeg} fill-50x50-c100 class="blog__avatar" %}
16-
{{ author.first_name }} {{ author.last_name }}</div>
24+
{% if page.get_tags %}
25+
<p class="blog__tag-introduction">Find more blog posts with similar tags</p>
26+
<div class="blog-tags blog-tags--condensed">
27+
<span class="u-sr-only">Filter blog posts by tag</span>
28+
{% for tag in page.get_tags %}
29+
<a href="{{ tag.url }}" class="blog-tags__pill">{{ tag }}</a>
1730
{% endfor %}
1831
</div>
1932
{% endif %}
2033
</div>
21-
22-
{{ page.body }}
23-
24-
{% if page.get_tags %}
25-
<p class="blog__tag-introduction">Find more blog posts with similar tags</p>
26-
<div class="blog-tags blog-tags--condensed">
27-
<span class="u-sr-only">Filter blog posts by tag</span>
28-
{% for tag in page.get_tags %}
29-
<a href="{{ tag.url }}" class="blog-tags__pill">{{ tag }}</a>
30-
{% endfor %}
31-
</div>
32-
{% endif %}
3334
</div>
3435
</div>
35-
</div>
36+
{% endwagtailpagecache %}
3637
{% endblock content %}

0 commit comments

Comments
 (0)