【发布时间】:2023-04-08 22:34:02
【问题描述】:
我有这样的文件 head.pug
head
h2
a(href="") This is title
我的目录是:
contact
+ index.pug
pug
+ head.pug
index.pug
在我的主页和联系人中,我使用index.pug,我可以像这样包含head.pug
include pug/head.pug
and
include ../pug/head.pug
它会打印 HTML
<head>
<h2><a href="">This is title</a></h2>
</head>
但在联系人目录中,它应该使用这样的链接打印
<head>
<h2><a href="../">This is title</a></h2>
</head>
我该怎么办?
【问题讨论】:
-
您是否尝试过在 include 周围加上单引号?包括“../pug/head.pug”?