Skip to content

Commit

Permalink
Merge pull request #616 from samjwu/blog-flavor
Browse files Browse the repository at this point in the history
feat: Add ROCm blogs flavor
  • Loading branch information
saadrahim authored Jan 26, 2024
2 parents 6624bd5 + 23de47a commit 6b22fae
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 7 deletions.
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
]

html_theme = "rocm_docs_theme"
html_theme_options = {"flavor": "rocm-docs-home"}
html_theme_options = {"flavor": "rocm-blogs"}

extensions = ["rocm_docs", "rocm_docs.doxygen"]
external_toc_path = "./sphinx/_toc.yml"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{% macro license_link() -%}{%- endmacro -%}
17 changes: 17 additions & 0 deletions src/rocm_docs/rocm_docs_theme/flavors/rocm-blogs/header.jinja
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{% macro top_level_header(branch, latest_version, release_candidate_version) -%}
<a class="klavika-font hover-opacity" href="{{ projects['rocm'] }}">ROCm&#8482; Software</a>
{%- endmacro -%}

{%
set repo_url = theme_repository_url|replace("-internal", "")
%}
{%
set nav_secondary_items = {
"GitHub": repo_url,
"Community": "https://github.com/RadeonOpenCompute/ROCm/discussions",
"AMD Lab Notes": "https://gpuopen.com/learn/amd-lab-notes/amd-lab-notes-readme/",
"Infinity Hub": "https://www.amd.com/en/technologies/infinity-hub",
"Support": repo_url + "/issues/new/choose",
"Feedback": "mailto:rocm-feedback@amd.com"
}
%}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{%
set main_doc_link = ("ROCm Documentation Home", projects['rocm'])
%}
6 changes: 3 additions & 3 deletions src/rocm_docs/rocm_docs_theme/flavors/rocm/footer.jinja
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{%
set license_link = ("ROCm Licenses and Disclaimers", projects['rocm'] ~ "/about/licensing.html")
%}
{% macro license_link() -%}
<li><a href="{{ projects['rocm'] ~ "/about/licensing.html" }}">ROCm Licenses and Disclaimers</a></li>
{%- endmacro -%}
3 changes: 1 addition & 2 deletions src/rocm_docs/rocm_docs_theme/sections/footer.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@
<div class="col-12 text-center">
<ul>
<li><a href="https://www.amd.com/en/corporate/copyright" target="_blank">Terms and Conditions</a></li>
{% set text, target = license_link %}
<li><a href="{{target}}">{{text}}</a></li>
{{ license_link() }}
<li><a href="https://www.amd.com/en/corporate/privacy" target="_blank">Privacy</a></li>
<li><a href="https://www.amd.com/en/corporate/trademarks" target="_blank">Trademarks</a></li>
<li><a href="https://www.amd.com/system/files/documents/statement-human-trafficking-forced-labor.pdf" target="_blank">Statement on Forced Labor</a></li>
Expand Down
2 changes: 1 addition & 1 deletion src/rocm_docs/theme.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def _update_theme_options(app: Sphinx) -> None:
theme_opts = get_theme_options_dict(app)
_update_repo_opts(app.srcdir, theme_opts)

supported_flavors = ["rocm", "local", "rocm-docs-home"]
supported_flavors = ["rocm", "local", "rocm-docs-home", "rocm-blogs"]
flavor = theme_opts.get("flavor", "rocm")
if flavor not in supported_flavors:
logger.error(
Expand Down

0 comments on commit 6b22fae

Please sign in to comment.