Skip to content

Including Liquid code into the .pug file #228

Description

@logiamo

I am trying to get Liquid code running in my .pug file, as I am using gulp.js with jekyll. My goal is to set up a Jekyll loop using Liquid inside the .pug file. This is the following code:

 - {% for posts in site.posts %}
    a(href="" style="background-image: url(https://placekitten.com/100/200)").article-thumb
    .article-meta
        .name Article Name 
        .date Dec 10, 1982
- {% endfor %}

Can someone tell me what is wrong and why it does give me following error:

[14:57:04] Error in plugin "gulp-pug"
Message:
    Error parsing body of the with expression
Details:
    component: src
    babylonError: SyntaxError: Unexpected token (10:1)
    fileName: \_pugfiles\section-articles.pug
    domainEmitter: [object Object]
    domainThrown: false

Wherin line 10 is the following code: .date Dec 10, 1982

Thank you very much!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions