From 4f3099293a6b4d6ba39586d46acaf8331ca79c6c Mon Sep 17 00:00:00 2001 From: kylehakala Date: Fri, 28 Feb 2025 14:34:26 -0600 Subject: [PATCH] Move glossary from HTML to markdown, add first-letter separators for TOC (#37644) --- source/_docs/glossary.html | 31 ------------------------------- source/_docs/glossary.markdown | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 33 insertions(+), 31 deletions(-) delete mode 100644 source/_docs/glossary.html create mode 100644 source/_docs/glossary.markdown diff --git a/source/_docs/glossary.html b/source/_docs/glossary.html deleted file mode 100644 index 112024e72b0..00000000000 --- a/source/_docs/glossary.html +++ /dev/null @@ -1,31 +0,0 @@ ---- -title: "Glossary" -description: "Home Assistant's Glossary." ---- - -{% assign entries = site.data.glossary | sort: 'term' %} - -The glossary covers terms which are used around Home Assistant. - -
- -{% for entry in entries %} - -
-
- - {{ entry.term }} -
-
- - {{ entry.definition | markdownify | newline_to_br }} - {%- if entry.link -%} - Read more about: {{ entry.term }} - {%- endif -%} - -
-
- -{% endfor %} - -
diff --git a/source/_docs/glossary.markdown b/source/_docs/glossary.markdown new file mode 100644 index 00000000000..cdd270c7081 --- /dev/null +++ b/source/_docs/glossary.markdown @@ -0,0 +1,33 @@ +--- +title: "Glossary" +description: "Home Assistant's Glossary." +--- + +The glossary covers terms which are used around Home Assistant. + +{% assign entries = site.data.glossary | sort: 'term' %} +{% assign current_letter = '' %} + +{% for entry in entries %} + +{% assign first_letter = entry.term | slice: 0 %} +{% if first_letter != current_letter %} +{% assign current_letter = first_letter | upcase %} + +## {{ current_letter }} + +--- + +{% endif %} + +### {{ entry.term }} + +{{ entry.definition | markdownify }} + +{%- if entry.link -%} + +{{ "[Read more about " | append: "_" | append: entry.term | append: "_](" | append: entry.link | append: ")" | markdownify }} + +{%- endif -%} + +{% endfor %}