Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions ckanext/pages/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
from ckanext.pages import blueprint

from ckan.lib.plugins import DefaultTranslation
from ckan.lib.helpers import _local_url


log = logging.getLogger(__name__)
Expand All @@ -24,7 +25,6 @@ def build_pages_nav_main(*args):
about_menu = tk.asbool(tk.config.get('ckanext.pages.about_menu', True))
group_menu = tk.asbool(tk.config.get('ckanext.pages.group_menu', True))
org_menu = tk.asbool(tk.config.get('ckanext.pages.organization_menu', True))
root_path = tk.config.get('ckan.root_path', '/')

new_args = []
for arg in args:
Expand All @@ -51,7 +51,8 @@ def build_pages_nav_main(*args):
type_ = 'blog' if page['page_type'] == 'blog' else 'pages'
name = quote(page['name'])
title = html_escape(page['title'])
link = tk.h.literal(u'<a href="{}/{}/{}">{}</a>'.format(root_path, type_, name, title))
local_url = _local_url("/{}/{}".format(type_, name))
link = tk.h.literal(u'<a href="{}">{}</a>'.format(local_url, title))
if page['name'] == page_name:
li = tk.literal('<li class="active">') + link + tk.literal('</li>')
else:
Expand Down