From 62c7ac4729ec750fe80a25b8a47492cc694961fe Mon Sep 17 00:00:00 2001 From: Patrick Marsceill Date: Tue, 23 Oct 2018 13:09:23 -0400 Subject: [PATCH] Add done after creating content --- assets/js/search-data.json | 12 ++++++++++++ lib/tasks/search.rake | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 assets/js/search-data.json diff --git a/assets/js/search-data.json b/assets/js/search-data.json new file mode 100644 index 0000000..50a4b9f --- /dev/null +++ b/assets/js/search-data.json @@ -0,0 +1,12 @@ +--- +--- +{ + {% for page in site.html_pages %}"{{ forloop.index0 }}": { + "id": "{{ forloop.index0 }}", + "title": "{{ page.title | xml_escape }}", + "content": "{{ page.content | markdownify | strip_html | xml_escape | remove: 'Table of contents' | strip_newlines | replace: '\', ' ' }}", + "url": "{{ page.url | absolute_url | xml_escape }}", + "relUrl": "{{ page.url | xml_escape }}" + }{% if forloop.last %}{% else %}, + {% endif %}{% endfor %} +} diff --git a/lib/tasks/search.rake b/lib/tasks/search.rake index 0e433b2..fbaf94f 100644 --- a/lib/tasks/search.rake +++ b/lib/tasks/search.rake @@ -4,7 +4,7 @@ namespace :search do puts 'Creating search data json file...' touch 'assets/js/search-data.json' content = %Q[{{ page.content | markdownify | strip_html | xml_escape | remove: 'Table of contents' | strip_newlines | replace: '\\', ' ' }}] - + puts 'Done.' puts 'Generating content...' File.open('assets/js/search-data.json', 'w') do |f|