pirtleshell / hexo-include

A Hexo plugin for including raw content of any text file into a post
MIT License
18 stars 5 forks source link

[Nunjucks Error] unexpected token: . #3

Open bennycode opened 3 years ago

bennycode commented 3 years ago

I want to include a Markdown file from another Markdown file:

Your documentation says that all file paths are relative to the source directory, so I tried the following embed:

{% include error-ts/test.md %}

This causes the error below:

err: Template render error: (unknown path)
Error: template names must be a string: Na

That's why I tried a relative path:

{% include ./error-ts/test.md %}

This caused a new error:

err: Error [Nunjucks Error]: error-ts/index.md 
[Line 4, Column 12] unexpected token: .

Here is what my src/error-ts/test.md looks like:

console.log('Hello, World!');

How can I embed it?

bennycode commented 3 years ago

Because code blocks are not working with "hexo-include", I created my own plugin which supports it: