Don't replace http(s) links in index.md

This commit is contained in:
Blerim Sheqa 2017-10-20 13:15:20 +02:00
parent 8f80bb92c1
commit 7bf811f84d
1 changed files with 1 additions and 1 deletions

View File

@ -85,7 +85,7 @@ main_pages = build_page_index(full_docs_dir, config['project']['docs_dir'])
index_file = "#{clone_target}/index.md"
FileUtils.cp("#{clone_target}/#{main_pages[0].values[0]}", index_file)
index_content = File.read(index_file)
index_new_content = index_content.gsub(/\((.*\.md.*)\)/, "(#{config['project']['docs_dir']}/\\1)")
index_new_content = index_content.gsub(/\(((?!http).*\.md.*)\)/, "(#{config['project']['docs_dir']}/\\1)")
File.open(index_file, "w") {|file| file.puts index_new_content }
mkdocs['pages'].push('' => "index.md")