Fix pathing issues with gh-pages

This commit is contained in:
Patrick Marsceill
2018-10-23 12:51:11 -04:00
parent d60338910b
commit 25cd289df5
5 changed files with 27 additions and 19 deletions

View File

@@ -2,10 +2,12 @@ namespace :search do
desc 'Generate the files needed for search functionality'
task :init do
puts 'Creating search data json file...'
touch 'search-data.json'
touch 'assets/js/search-data.json'
content = %Q[{{ page.content | markdownify | strip_html | xml_escape | remove: 'Table of contents' | strip_newlines | replace: '\\', ' ' }}]
File.open('search-data.json', 'w') do |f|
puts 'Generating content...'
File.open('assets/js/search-data.json', 'w') do |f|
f.puts '---
---
{
@@ -18,5 +20,6 @@ namespace :search do
{% endif %}{% endfor %}
}'
end
puts 'Done.'
end
end