为什么Jade认为来自我数组的链接应该将用户路由到/admin/thisurl而不是实际链接

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

本文关键字:链接 admin 路由 thisurl 用户 Jade 自我 数组 为什么      更新时间:2023-09-26

在我的jade文件中,我正在迭代连接到我的mongo db的数组。在一个单独的提交表单上,用户可以提交一个url,我最终希望将该url附加到jade文件中的<a>元素。正如你所看到的,我正试图用(href=post)做到这一点。链接目标= "平等)。所以我遍历数组,获取链接,然后尝试将其放入<a>元素。

但是,当我点击本地主机上的链接时,路由不能GET/admin/thisurl。为什么它把我的内部路线,当我只是想在一个新的标签页打开的链接到网站?

.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')

如果thisurl不以http://domain.tld开头,则thisurl将追加到当前页面url。

意味着thisurl被认为是相对url