nitiwiki: add a dhref helper function
[nit.git] / contrib / nitiwiki / src / wiki_html.nit
index 8042af6..1288d3c 100644 (file)
@@ -189,7 +189,7 @@ redef class WikiArticle
        fun load_template(template_file: String): TemplateString do
                var tpl = wiki.load_template(template_file)
                if tpl.has_macro("ROOT_URL") then
-                       var root_dir = href.dirname.relpath("")
+                       var root_dir = dhref.relpath("")
                        # Avoid issues if the macro is just followed by a `/` (as with url prefix)
                        if root_dir == "" then root_dir = "."
                        tpl.replace("ROOT_URL", root_dir)