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 dcce229308da24..6bdd3288f8069c 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