node.js jade - 如何在jade中设置内容类型

Mat*_*ttM 5 node.js pug

我有一个视图,其中返回的MIME类型不同.如何在head部分设置内容类型?

这是我想要做的

!!!
html
  head
    title #{site.title} - #{site.version}
    link(rel='stylesheet', href='/stylesheets/style.css')
    script(type='text/javascript', src='/javascripts/jquery-1.5.1.min.js')
    content-type #{mimetype}
  body!= body
Run Code Online (Sandbox Code Playgroud)

jco*_*and 15

您可以像这样指定内容类型元标记:

meta(http-equiv="content-type", content="#{contentType}; charset=UTF-8")
Run Code Online (Sandbox Code Playgroud)

请记住,内容类型的标记是 <META ...