Skip to content

nunjucks syntax does not work if site is built outside of site root folder #678

Description

@nicholaschuayunzhi

Tell us about your environment

  • MarkBind Version:
    v1.17.2

What did you do? Please include the actual source code causing the issue.

 |-- a
 |   |-- b.md
 |
 |-- index.md
 |--  site.json         

index.md

{% from "a/b.md" import variable %}

What did you expect to happen?

if command is run within a folder
C:/a> markbind build

Variable in b.md will be imported into index.md.

What actually happened? Please include the actual, raw output.

error: Template render error: (unknown path)
  Template render error: (unknown path)
  Error: template not found: a/b.md

nunjucks looks for file wrt to the cwd which will be C:/a/. It should find it wrt to site config directory, ie root folder of site. Alternatively it should be wrt to the current file.

Considerations: fix must work for sub sites.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions