From f83e675a8e07eb6e0bd9be182bf610cd3be66fa2 Mon Sep 17 00:00:00 2001 From: Thomas Massmann Date: Thu, 1 Jul 2021 18:12:28 +0200 Subject: [PATCH] feat(plugin): implement getLocalURL --- templates/plugins/plone.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/templates/plugins/plone.js b/templates/plugins/plone.js index 117eed6..8d08993 100644 --- a/templates/plugins/plone.js +++ b/templates/plugins/plone.js @@ -208,6 +208,10 @@ class PloneAPI extends Hookable { async getSiteInfo() { return await this.client.query('@siteinfo') } + + getLocalURL(url) { + return url.replace(this.baseURL, '') || '/'; + } } export default async function (ctx, inject) {