Fixed opening nav items in new tab/window

Signed-off-by: Collin J. Doering <collin.doering@rekahsoft.ca>
This commit is contained in:
Collin J. Doering 2015-01-22 01:07:48 -05:00
parent e2fd291e8f
commit b6d683014d
3 changed files with 7 additions and 5 deletions

View File

@ -71,7 +71,7 @@
if (page_href === '/') {
page_href = '/home.html';
} else if (blog_page_regexp.test(page_href)) {
if (page_href === "/blog.html") {
if (page_href === "/blog.html" || page_href === "/pages/blog.html") {
page_href = "/blog1.html";
}
@ -84,8 +84,10 @@
$('a.menuitem[rel="address:' + page_href + '"]').closest('ul').find('li.active').removeClass('active');
$('a.menuitem[rel="address:' + page_href + '"]').closest('li').addClass('active');
// set page_href of full url for ajax call
page_href = "pages" + page_href;
// set page_href of full url for ajax call when pages/ isn't specified
if (! /\/?pages\/.*/.test(page_href)) {
page_href = "pages" + page_href;
}
}
// Make the ajax request for the new page-content (whether it be a page or a post) *could change*

View File

@ -243,7 +243,7 @@ main = do
makeItem "loading"
>>= applyAsTemplate indexCtx
>>= loadAndApplyTemplate "templates/default.html" indexCtx
>>= relativizeUrls
-- >>= relativizeUrls
---------------------------------------------------------------------------------------------------------
-- NOJS Version -----------------------------------------------------------------------------------------

View File

@ -2,7 +2,7 @@
<ul class='container' id='nav-menu'>
$for(pages)$
<li>
<a class='menuitem' href='$url$' rel='address:$virtualpath$'>$title$</a>
<a class='menuitem' href='/#$url$' rel='address:$virtualpath$'>$title$</a>
</li>
$endfor$
<a class='rss-icon' href='atom.xml'></a>