Skip to content

Commit 1da4b77

Browse files
committed
Cache the version list instead
1 parent 7fd60f4 commit 1da4b77

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

readthedocs/templates/core/project_list_featured.html

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,10 @@
1414
<a href="#">&#x25BC;</a>
1515
</span>
1616
<ul>
17-
{% with project.get_stable_version as version %}
18-
{% if version %}
19-
<li><a href="{{ version.get_absolute_url }}">{{ version.slug }}</a></li>
20-
{% else %}
21-
<li>No stable version</li>
22-
{% endif %}
23-
{% endwith %}
17+
<li><input type="search" placeholder="{% trans "Search" %}&hellip;" /></li>
18+
{% for version in project.ordered_active_versions reversed %}
19+
<li><a href="{{ version.get_absolute_url }}">{{ version.slug }}</a></li>
20+
{% endfor %}
2421
</ul>
2522
</span>
2623
{% else %}

readthedocs/templates/homepage.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@ <h3>Multiple versions</h3>
116116
</section>
117117

118118
{% if featured_list %}
119+
{% cache 600 homepage featured_list %}
119120
<!-- BEGIN projects list -->
120121
<section>
121122
<h3>{% trans "Featured Projects" %}</h3>
@@ -128,6 +129,7 @@ <h3>{% trans "Featured Projects" %}</h3>
128129
</div>
129130
</section>
130131
<!-- END projects list -->
132+
{% endcache %}
131133
{% endif %}
132134

133135
<!-- Funding and Contributing -->

0 commit comments

Comments
 (0)