Skip to content

Commit 5ada6f9

Browse files
committed
Account for develop/master branches in docs regex (#1984)
1 parent 5f022ac commit 5ada6f9

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

libraries/mixins.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ def get_context_data(self, **kwargs):
4242
current_version_kwargs.update(
4343
{
4444
"content_path": re.sub(
45-
r"([_0-9]+)/(\S+)",
45+
r"([_0-9]+|master|develop)/(\S+)",
4646
rf"{LATEST_RELEASE_URL_PATH_STR}/\2",
4747
current_version_kwargs.get("content_path"),
4848
)

versions/models.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -326,5 +326,8 @@ def docs_path_to_boost_name(content_path):
326326
Convert a documentation content path to the Boost version name.
327327
e.g. "1_79_0/doc/html/accumulators.html" to "boost-1.79.0"
328328
"""
329-
result = re.sub(r"^([_0-9]+)(/\S+)", r"boost-\1", content_path)
329+
if content_path.startswith("develop") or content_path.startswith("master"):
330+
result = content_path.split("/")[0]
331+
else:
332+
result = re.sub(r"^([_0-9]+)(/\S+)", r"boost-\1", content_path)
330333
return result.replace("_", ".")

0 commit comments

Comments
 (0)