diff --git a/templates/docs-page.html b/templates/docs-page.html index a56ac01..7cd2db5 100644 --- a/templates/docs-page.html +++ b/templates/docs-page.html @@ -12,7 +12,7 @@ {% set has_frontmatter = true %} {% set page_contents = docs::extract_markdown(content= docs_file_contents) %} {% if frontmatter_data.title %} - {% set frontmatter_title = frontmatter_data.title %} + {% set frontmatter_title = docs::remove_valkey_title(title= frontmatter_data.title) %} {% endif %} {% else %} {% set page_contents = docs_file_contents %} @@ -21,7 +21,7 @@ {% block subhead_content %} {% if has_frontmatter and frontmatter_title %} -

Documentation: {{ frontmatter_title }}

+

Documentation: {{ docs::remove_valkey_title(title= frontmatter_title) }}

{% endif %} {% endblock subhead_content %} diff --git a/templates/docs.html b/templates/docs.html index 7c73230..10176c3 100644 --- a/templates/docs.html +++ b/templates/docs.html @@ -33,8 +33,9 @@

Alphabetical Index

{% set frontmatter_data = load_data(literal= frontmatter, format="yaml") %} {% set description = frontmatter_data.description | escape | safe %} {% set description_no_line_breaks = description | regex_replace(pattern=`[\u0000-\u001F]`, rep=` `) %} + {% set title= docs::remove_valkey_title(title= frontmatter_data.title) %} - {% set_global list = list | concat(with= ['{ "title" : "' ~ frontmatter_data.title ~ '", "path" : "' ~ page.path ~ '", "description" : "' ~ description_no_line_breaks ~ '" }']) %} + {% set_global list = list | concat(with= ['{ "title" : "' ~ title ~ '", "path" : "' ~ page.path ~ '", "description" : "' ~ description_no_line_breaks ~ '" }']) %} {% endif %} diff --git a/templates/macros/docs.html b/templates/macros/docs.html index f597381..4cee8df 100644 --- a/templates/macros/docs.html +++ b/templates/macros/docs.html @@ -7,6 +7,21 @@ {%- if markdown_content -%}{{ markdown_content }}{% endif %} {% endmacro load_doc %} +{%- macro remove_valkey_title(title) -%} +{%- if title is starting_with("Valkey") -%} +{%- set noValkey = title | replace(from="Valkey ", to="") -%} +{%- for letter in noValkey -%} + {%- if loop.index == 1 -%} + {{ letter | upper }} + {%- else -%} + {{ letter }} + {%- endif -%} +{%- endfor -%} +{%- else -%} +{{ title }} +{%- endif -%} +{%- endmacro remove_valkey_title -%} + {%- macro extract_frontmatter(content) %} {%- set markdown_split = content | split(pat="---") -%} {%- set markdown_part_count = markdown_split | length() -%}