Skip to content

Commit

Permalink
fix: hardcode the url for ROCm docs
Browse files Browse the repository at this point in the history
  • Loading branch information
samjwu committed Jun 26, 2023
1 parent ebe7b60 commit e9456f3
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/rocm_docs/projects.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@

import json
import os
import re
import sys
from dataclasses import dataclass
from pathlib import Path
Expand Down Expand Up @@ -307,20 +306,19 @@ def _update_banner_config(

latest_version = "5.5.1"
latest_version_string = f"docs-{latest_version}"
latest_url = re.sub(r"([^\/]+$)", latest_version_string, url)
announcement_info = ""

if branch == latest_version_string:
announcement_info = "This is the latest version of ROCm documentation."
elif branch.startswith("docs-"):
# turn off Python black for this line to prevent conflict with other Python linters
# fmt: off
announcement_info = f"This is an old version of ROCm documentation. Read the <a href='{latest_url}'>latest ROCm release documentation</a> to stay informed of all our developments."
announcement_info = "This is an old version of ROCm documentation. Read the <a href='https://rocm.docs.amd.com/en/latest/'>latest ROCm release documentation</a> to stay informed of all our developments."
# fmt: on

elif branch == development_branch:
# fmt: off
announcement_info = f"This page contains proposed changes for a future release of ROCm. Read the <a href='{latest_url}'>latest Linux release of ROCm documentation</a> for your production environments."
announcement_info = "This page contains proposed changes for a future release of ROCm. Read the <a href='https://rocm.docs.amd.com/en/latest/'>latest Linux release of ROCm documentation</a> for your production environments."
# fmt: on

app.add_config_value(
Expand Down

0 comments on commit e9456f3

Please sign in to comment.