简体   繁体   English

无法正确获取Jade语法

[英]Cant get Jade syntax correct

I have this jade layout files but everytime I try to render it I get "unexpected text ;" 我有这个玉器布局文件,但是每次尝试渲染它时,都会出现“意外文本”; on backgound: url(...). 在backgound上:url(...)。 I am not sure how to fix. 我不确定如何解决。 I have looked at other example and they do it like this. 我看了另一个例子,他们这样做。

doctype html
 html
head
style
  body {
    background: url('!{imageURI}');
    background-size:75%;
    background-repeat: no-repeat;
  }
body
h1 Tweets
h1 #{tweet.text}
h1  @#{tweet.user.screen_name}

You have two errors in your pug template: 您的哈巴狗模板中有两个错误:

  1. Leading space before html HTML前的空格
  2. Missing dot after style . style之后缺少点。

The correct template can looks so: 正确的模板如下所示:

doctype html
html
head
body
style.
  body {
    background: url('!{imageURI}');
    background-size: 75%;
    background-repeat: no-repeat;
  }
h1 Tweets
h1 #{tweet.text}
h1 @#{tweet.user.screen_name}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM