(PDOC-120) Update gh_pages task to allow publishing of _index.html

Previously, due to Jekyll's default rule of not allowing files beginning
with an '_' to be published, the gh_pages rake task led to broken links.
This commit adds a step to the task which adds a _config.yml file to the
`doc` directory of the gh-pages branch which explicitly allows the file
to be published.
This commit is contained in:
Will Hopper 2016-10-13 11:07:09 -07:00
parent 03d89c55b5
commit 6e3c973868
1 changed files with 10 additions and 0 deletions

View File

@ -24,6 +24,15 @@ namespace :strings do
end
end
desc 'Add Jekyll _config.yml file to allow publishing of _index.html.'
task :configure do
unless File.exist?(File.join('doc', '_config.yml'))
Dir.chdir('doc') do
File.open('_config.yml', 'w+') {|f| f.write("include: _index.html") }
end
end
end
desc 'Push new docs to GitHub.'
task :push do
Dir.chdir('doc') do
@ -37,6 +46,7 @@ namespace :strings do
task :update => [
:checkout,
:'strings:generate',
:configure,
:push,
]
end