From c893ddd8c5cb3e50ec6c4e4e89358d6803052448 Mon Sep 17 00:00:00 2001 From: "Luiz \"darknessxk\" Felipe" Date: Mon, 3 May 2021 10:31:13 -0300 Subject: [PATCH] Default assets --- docs/assets/js/zzzz-search-data.json | 72 ++++++++++++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 docs/assets/js/zzzz-search-data.json diff --git a/docs/assets/js/zzzz-search-data.json b/docs/assets/js/zzzz-search-data.json new file mode 100644 index 0000000..848d3fb --- /dev/null +++ b/docs/assets/js/zzzz-search-data.json @@ -0,0 +1,72 @@ +--- +permalink: /assets/js/search-data.json +--- +{ +{%- assign i = 0 -%} +{%- assign pages_array = | split: -%} +{%- assign pages_array = pages_array | push: site.html_pages -%} +{%- if site.just_the_docs.collections -%} + {%- for collection_entry in site.just_the_docs.collections -%} + {%- assign collection_key = collection_entry[0] -%} + {%- assign collection_value = collection_entry[1] -%} + {%- assign collection = site[collection_key] -%} + {%- if collection_value.search_exclude != true -%} + {%- assign pages_array = pages_array | push: collection -%} + {%- endif -%} + {%- endfor -%} +{%- endif -%} +{%- for pages in pages_array -%} + {%- for page in pages -%} + {%- if page.title and page.search_exclude != true -%} + {%- assign page_content = page.content -%} + {%- assign heading_level = site.search.heading_level | default: 2 -%} + {%- for j in (2..heading_level) -%} + {%- assign tag = '' -%} + {%- assign title = titleAndContent[0] | replace_first: '>', '

' | split: '

' -%} + {%- assign title = title[1] | strip_html -%} + {%- assign content = titleAndContent[1] -%} + {%- assign url = page.url -%} + {%- if title == page.title and parts[0] == '' -%} + {%- assign title_found = true -%} + {%- else -%} + {%- assign id = titleAndContent[0] -%} + {%- assign id = id | split: 'id="' -%} + {%- if id.size == 2 -%} + {%- assign id = id[1] -%} + {%- assign id = id | split: '"' -%} + {%- assign id = id[0] -%} + {%- capture url -%}{{ url | append: '#' | append: id }}{%- endcapture -%} + {%- endif -%} + {%- endif -%} + {%- unless i == 0 -%},{%- endunless -%} + "{{ i }}": { + "doc": {{ page.title | jsonify }}, + "title": {{ title | jsonify }}, + "content": {{ content | replace: '