Add done after creating content

This commit is contained in:
Patrick Marsceill 2018-10-23 13:09:23 -04:00
parent 0611696c2d
commit 62c7ac4729
No known key found for this signature in database
GPG Key ID: 286B93882D828F40
2 changed files with 13 additions and 1 deletions

View File

@ -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 %}
}

View File

@ -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|