【问题标题】:Pug : unexpected_block Error哈巴狗:意外的块错误
【发布时间】:2018-09-25 03:48:36
【问题描述】:

大家好

我遇到了这个错误

PUG:UNEXPECTED_BLOCK

帕格版本:5.6.0

使用 Gulp 进行编译

template.pug

//- Vars
- var siteName = "LandingPage" ;

block Vars

doctype html
html(lang="en")
    include head.pug
    body
        include header
        block content
        include footer
        include modals
        include scripts

index.pug

extends template/template

//- Vars
block vars
    - var pageTitle=" Home "; 
    - var pageDes="HTML App Landing Page Template";

//- Content
block content
    main
        include sections/content_section

有什么帮助吗?

注意:我试过了

  • 删除 block vars 在 template.pug 但仍然给我同样的错误
  • 删除所有 cmets 均根据此 Answer 形成,但相同

【问题讨论】:

    标签: html gulp pug


    【解决方案1】:

    我解决了这个问题。 块名称的问题。

    template.pug 中,它被命名为带有 **capitalize ** ( Vars ) 的块 vars

    block Vars
    

    并且在 index.puglowercase ( vars )

    命名
    block vars
    

    我修复了块名称,它可以正常工作。

    希望对你有所帮助

    谢谢

    【讨论】:

      猜你喜欢
      • 2018-01-02
      • 2017-07-13
      • 1970-01-01
      • 2018-10-20
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多