mirror of
https://github.com/Icinga/icinga-docs-tools.git
synced 2025-07-27 15:54:01 +02:00
Consider URLs to markdown files on URL rewrite
This commit is contained in:
parent
2c4d4994ac
commit
1496e3f5b4
@ -243,7 +243,7 @@ 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)(\w)?)/, "(#{project_config['project']['docs_dir']}/\\1")
|
index_new_content = index_content.gsub(/\(((?!http)\S+(\.md|\.png)(\w)?)/, "(#{project_config['project']['docs_dir']}/\\1")
|
||||||
# Fix image URLs
|
# Fix image URLs
|
||||||
index_new_content = index_new_content.gsub(/(\[\!\[.*\])\(((?!http)\S+.png)\)/, "\\1(#{project_config['project']['docs_dir']}/\\2)")
|
index_new_content = index_new_content.gsub(/(\[\!\[.*\])\(((?!http)\S+(\.md|\.png))\)/, "\\1(#{project_config['project']['docs_dir']}/\\2)")
|
||||||
|
|
||||||
File.open(index_file, "w") {|file| file.puts index_new_content }
|
File.open(index_file, "w") {|file| file.puts index_new_content }
|
||||||
mkdocs['nav'].push('' => "index.md")
|
mkdocs['nav'].push('' => "index.md")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user