website: fix guide urls related to blogs (#2431)

This commit is contained in:
M Sarmad Qadeer
2023-05-18 15:03:35 +05:00
committed by GitHub
parent a32fd5e665
commit 3a50da1b53
+3
View File
@@ -212,6 +212,9 @@ module.exports = function (ty) {
if (parsed.scheme || parsed.host || !parsed.path.endsWith(".md")) {
return link
}
if (parsed.path.startsWith("../../blog")) {
parsed.path = parsed.path.replace("../../blog", "/blog")
}
parsed.path = parsed.path.replace(/\.md$/, ".html")
return uri.serialize(parsed)
}