Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nested hash-style error #111

Open
morteza-jamali opened this issue Oct 27, 2019 · 0 comments
Open

Nested hash-style error #111

morteza-jamali opened this issue Oct 27, 2019 · 0 comments

Comments

@morteza-jamali
Copy link

morteza-jamali commented Oct 27, 2019

When using HAML and Twig together , HAML like the following fails :

- set styles = loadStyles(["bootstrap" , "main" , "other_css" , "fontawesome"])
!!! 5
%html(lang="fa")
  %head
    %meta(charset="UTF-8")
    %meta(name="description" content="Free Web tutorials")
    %meta(name="keywords" content="HTML,CSS,XML,JavaScript")
    %meta(name="author" content="My name")
    %meta(name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no")
    %title
      Page Title
    - for style in styles
      = style
  %body
    -# Navbar section start
    %header.sticky-top
      %nav.navbar.navbar-expand-lg.navbar-light.bg-white.shadow-sm.border-bottom
        .container
          %a.navbar-brand(href="#{getHomeURL()}")
            %img(src="#{getImageUrl('logo.png')}" alt="#{getBlogInfo('name')}")
          %button.navbar-toggler(type="button" ){:data => {:toggle => "collapse" , :target => "#navbarSupportedContent"} ,
                                                 :aria => {:controls => "navbarSupportedContent" , :expanded => "false" , :lable => "Toggle navigation"}}
            %span.navbar-toggler-icon

The resulting exception is :
Fatal error: Uncaught Twig\Error\SyntaxError: A hash key must be a quoted string, a number, a name, or an expression enclosed in parentheses (unexpected token "punctuation" of value ":" in "main.haml" at line 21. in path\vendor\twig\twig\src\ExpressionParser.php on line 386

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant