Fix regex to replace links in index.html
This commit is contained in:
parent
3b9677084d
commit
a927539e93
|
@ -114,8 +114,8 @@ main_pages = build_page_index(full_docs_dir, project_config['project']['docs_dir
|
||||||
index_file = "#{clone_target}/index.md"
|
index_file = "#{clone_target}/index.md"
|
||||||
FileUtils.cp("#{clone_target}/#{main_pages[0].values[0]}", index_file)
|
FileUtils.cp("#{clone_target}/#{main_pages[0].values[0]}", index_file)
|
||||||
index_content = File.read(index_file)
|
index_content = File.read(index_file)
|
||||||
index_new_content = index_content.gsub(/\(((?!http)\S+(\.md|\.png)(\S+)?)\)/,
|
index_new_content = index_content.gsub(/\(((?!http)\S+(\.md|\.png)(\w)?)/,
|
||||||
"(#{project_config['project']['docs_dir']}/\\1)")
|
"(#{project_config['project']['docs_dir']}/\\1")
|
||||||
|
|
||||||
File.open(index_file, "w") {|file| file.puts index_new_content }
|
File.open(index_file, "w") {|file| file.puts index_new_content }
|
||||||
mkdocs['pages'].push('' => "index.md")
|
mkdocs['pages'].push('' => "index.md")
|
||||||
|
|
Loading…
Reference in New Issue