mirror of
https://github.com/Icinga/icinga-docs-tools.git
synced 2025-07-22 21:34:26 +02:00
Update regex to match anchor links
This commit is contained in:
parent
487815e6f0
commit
b5495d40db
@ -85,7 +85,7 @@ main_pages = build_page_index(full_docs_dir, 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))\)/, "(#{config['project']['docs_dir']}/\\1)")
|
index_new_content = index_content.gsub(/\(((?!http)\S+(\.md|\.png)(\S+)?)\)/, "(#{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")
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
---
|
---
|
||||||
site_name: 'Icinga Web 2'
|
site_name: 'Icinga Web 2'
|
||||||
source_dir: 'www/source'
|
source_dir: 'www/docs/source'
|
||||||
site_dir: 'www/html'
|
site_dir: 'www/docs/html'
|
||||||
project:
|
project:
|
||||||
git: 'https://github.com/Icinga/icingaweb2.git'
|
git: 'https://github.com/Icinga/icingaweb2.git'
|
||||||
ref: 'master'
|
ref: 'master'
|
||||||
|
Loading…
x
Reference in New Issue
Block a user