From e91aa2e5f6c588dd077ab403a32e42dcbfdd9d5c Mon Sep 17 00:00:00 2001 From: curbengh <43627182+curbengh@users.noreply.github.com> Date: Sun, 15 Sep 2019 18:38:08 +0100 Subject: [PATCH] fix(url_for): initialize relative_url function --- lib/plugins/helper/url_for.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/plugins/helper/url_for.js b/lib/plugins/helper/url_for.js index 868dd56b3c..ed1ec087fc 100644 --- a/lib/plugins/helper/url_for.js +++ b/lib/plugins/helper/url_for.js @@ -1,6 +1,7 @@ 'use strict'; const url = require('url'); +const relative_url = require('./relative_url'); function urlForHelper(path = '/', options) { if (path[0] === '#' || path.startsWith('//')) { @@ -22,7 +23,7 @@ function urlForHelper(path = '/', options) { // Resolve relative url if (options.relative) { - return this.relative_url(this.path, path); + return relative_url(this.path, path); } // Prepend root path