Andrew Little Andrew Little - 1 month ago 13
Jade Question

Why does Jade think the link coming from my array should route the user to /admin/thisurl vs the actual link?

In my jade file, I am iterating through an array that is connected to my mongo db. On a separate submission form, the user is able to submit a url which I eventually want to append to the

<a>
element in my jade file. As you can see I am trying to do this with (href=post.link target="_blank). So I iterate through the array, and grab the link and then try to put in in the
<a>
element.

However, when I click on the link on localhost, the route is cannot GET /admin/thisurl. Why is it putting my internal routes when I just want the link to open in a new tab to the website?

.fullPostContainer
each post in posts
.media.fullPostPadding
a.removeTextDeco(href=post.link, target='_blank')
.media-left.media-middle
// <a href="#">
img.media-object(src='/facebook-logo.png', alt='facebook logo')

.media-body
div#mainTitlePost.media-heading.postTitleFont= post.title
div#mainShortDesc.descriptionFont= post.description
button#fireBtn.btn.btn-sm.btnColor(type='button')

Answer

if thisurl does not start with http://domain.tld then thisurl is appended to current page url.

that means thisurl is considered relative url.