From 48cd9ce3a72a51a31cab630b80da47ea1e2700c5 Mon Sep 17 00:00:00 2001 From: Wouter Born Date: Wed, 7 May 2025 15:34:30 +0200 Subject: [PATCH] Improve replacement logic so it also works with openHAB HTTPS links (#2488) Nowadays HTTPS links are more common which should also be replaced. Signed-off-by: Wouter Born --- .vuepress/process_file.rb | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.vuepress/process_file.rb b/.vuepress/process_file.rb index a85657341..69e362760 100644 --- a/.vuepress/process_file.rb +++ b/.vuepress/process_file.rb @@ -116,10 +116,12 @@ def process_file(indir, file, outdir, source) line = line.gsub(%r{]\((.*)/(.*)\)}, '](../thing.html?manufacturer=\1&file=\2)') if file == "zwave/doc/things.md" # Misc replaces (relative links, remove placeholder interpreted as custom tags) - line = line.gsub("http://docs.openhab.org/addons/uis/habpanel/readme.html", "/docs/configuration/habpanel.html") - line = line.gsub("http://docs.openhab.org/addons/uis/basic/readme.html", "/addons/ui/basic/") - line = line.gsub(%r{http://docs\.openhab\.org/addons/(.*)/(.*)/readme\.html}, '/addons/\1/\2/') - line = line.gsub("http://docs.openhab.org/", "/docs/") + line = line.gsub(%r{https?://docs\.openhab\.org/addons/uis/habpanel/readme\.html}, "/docs/configuration/habpanel.html") + line = line.gsub(%r{https?://docs\.openhab\.org/addons/uis/basic/readme\.html}, "/addons/ui/basic/") + line = line.gsub(%r{https?://docs\.openhab\.org/addons/(.*)/(.*)/readme\.html}, '/addons/\1/\2/') + line = line.gsub(%r{https?://docs\.openhab\.org/}, "/docs/") + line = line.gsub(%r{https?://openhab\.org/docs/}, "/docs/") + line = line.gsub(%r{https?://www\.openhab\.org/docs/}, "/docs/") line = line.gsub("/addons/io/", "/addons/integrations/") line = line.gsub("{{base}}/", "./docs/") line = line.gsub("(images/", "(./images/")