diff --git a/lib/tasks/search.rake b/lib/tasks/search.rake index 8e6305a..73c0d5b 100644 --- a/lib/tasks/search.rake +++ b/lib/tasks/search.rake @@ -12,8 +12,17 @@ namespace :search do permalink: /assets/js/search-data.json --- { - {%- assign i = 0 -%} - {% for page in site.html_pages %} +{% assign i = 0 -%} +{%- assign pages_array = \'\' | split: \'\' -%} +{%- assign pages_array = pages_array | push: site.html_pages -%} +{%- if site.doc_collections -%} + {%- for doc_collection in site.doc_collections -%} + {%- assign collection = site[doc_collection.collection] -%} + {%- assign pages_array = pages_array | push: collection -%} + {%- 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 -%} @@ -24,7 +33,7 @@ permalink: /assets/js/search-data.json {%- endfor -%} {%- assign parts = page_content | split: \'