Use the database for docs rendering#2615
Conversation
pauloxnet
left a comment
There was a problem hiding this comment.
Thanks for working on this PR.
If you think is still a draft please mark it as draft PR in the Github interface.
| {% for p in doc.breadcrumbs %} | ||
| <ul><li><a href="{% url 'document-detail' lang=lang version=version url=p.path host 'docs' %}">{{ p.title|safe }}</a> | ||
| {% endfor %} | ||
| <ul><li>{% block current-page-title %}{{ doc.title|safe }}{% endblock current-page-title %}</li></ul> | ||
| {% for p in doc.parents %}</li></ul>{% endfor %} | ||
| {% for p in doc.breadcrumbs %}</li></ul>{% endfor %} |
There was a problem hiding this comment.
Are this changes related to the PR?
There was a problem hiding this comment.
Yes. The document.metadata parents field doesn't correspond to the original JSON file's parents field, so apparently we have to adapt this part of the template to use the breadcrumbs property instead.
See e.g.
>>> import json
>>> doc
<Document: en/dev/releases/1.10.1>
>>> doc.metadata["parents"]
'releases'
>>> with doc.full_path.open() as doc_file:
... json.load(doc_file)["parents"]
[{'link': '../', 'title': 'Release notes'}]
>>> doc.metadata["breadcrumbs"]
[{'path': 'releases', 'title': 'Release notes'}]
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2615 +/- ##
=======================================
Coverage ? 86.21%
=======================================
Files ? 185
Lines ? 6760
Branches ? 384
=======================================
Hits ? 5828
Misses ? 852
Partials ? 80 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
c003b47 to
172d7e0
Compare
|
The PR seems good to me. When you are ready for a complete review, update a bit the PR description, squash commit and squash also the 2 migrations in one, and add test to cover the changes. |
f82e102 to
ad13571
Compare
This is steps 1-2 of #1630, i.e. database-backed load for documentation and its environment (globalcontext).