Return a new entry with all page paths under ``locale/`` prefixed with `` /`` (no ``versions/`` wrapper, since the slug becomes the URL segment). Adds ``tag: "Latest"`` to the default entry.
(entry: dict, locale: str)
| 100 | |
| 101 | |
| 102 | def _prefix_version_entry(entry: dict, locale: str) -> dict: |
| 103 | """Return a new entry with all page paths under ``locale/`` prefixed with |
| 104 | ``<version_slug>/`` (no ``versions/`` wrapper, since the slug becomes the |
| 105 | URL segment). Adds ``tag: "Latest"`` to the default entry. |
| 106 | """ |
| 107 | version_slug = entry["version"] |
| 108 | new_entry = _walk_pages(entry, _make_prefixer(locale, version_slug)) |
| 109 | |
| 110 | if new_entry.get("default") and "tag" not in new_entry: |
| 111 | new_entry["tag"] = LATEST_TAG |
| 112 | |
| 113 | return new_entry |
| 114 | |
| 115 | |
| 116 | def _build_edge_entry(latest_entry: dict, locale: str) -> dict: |
no test coverage detected