Skip to content

OpenVINO™ is an open source toolkit for optimizing and deploying AI inference

[DOCS] Port Changes for sitemap generating to master (#27724)

Andrzej Kopytkof11d8a524df5
diff --git a/docs/openvino_custom_sphinx_sitemap/openvino_custom_sphinx_sitemap/__init__.py b/docs/openvino_custom_sphinx_sitemap/openvino_custom_sphinx_sitemap/__init__.py
index dcce229308d..6bdd3288f80 100644
--- a/docs/openvino_custom_sphinx_sitemap/openvino_custom_sphinx_sitemap/__init__.py
+++ b/docs/openvino_custom_sphinx_sitemap/openvino_custom_sphinx_sitemap/__init__.py
@@ -140,9 +140,21 @@ def extract_hierarchy(link):
segments = path.split('/')[1:]
if segments and segments[-1].endswith('.html'):
segments = segments[:-1]
-
+
+ if segments and '.' in segments[0]:
+ year, *rest = segments[0].split('.')
+ if year.isdigit() and len(year) == 4:
+ segments[0] = year
+
+ segments = [format_segment(segment) for segment in segments]
+
hierarchy = []
for i in range(1, len(segments) + 1):
hierarchy.append('|'.join(segments[:i]))
-
- return ';'.join(hierarchy)
\ No newline at end of file
+
+ return ';'.join(hierarchy)
+
+def format_segment(segment):
+ if segment == 'c_cpp_api': segment = 'c_c++_api'
+
+ return ' '.join(word.capitalize() for word in segment.replace('-', ' ').replace('_', ' ').split())
\ No newline at end of file