neurobin/mdx_include

File not found

latsami opened this issue · 4 comments

Hello,
your extension is super useful!
I'm trying to use it within Pelican, as said in the Pelican documentation https://docs.getpelican.com/en/stable/content.html

But I keep having a "File not found error".
Both files are at the same level.

I tried:

{! showcase.md !}
\{! showcase.md !}

and I changed the syntax to double curly brackets instead of one as I'm also using the attr_list:

{{! showcase.md !}}

Now I'm out of tricks...
Any clue?

what is the full error message (python exception)? what file path does it try instead of showcase.md?

ERROR: E: Could not find file: showcase.md
|___
| Traceback (most recent call last):
| File "/home/svilayphiou/venvs/aesthetic-programming-2/lib/python3.8/site-packages/mdx_include/mdx_include.py", line 75, in get_local_content_list
| with open(filename, 'r', encoding=encoding) as f:
| File "/home/svilayphiou/venvs/aesthetic-programming-2/lib/python3.8/codecs.py", line 905, in open
| file = builtins.open(filename, mode, buffering)
| FileNotFoundError: [Errno 2] Aucun fichier ou dossier de ce type: 'showcase.md'

And I did check the spelling, tried different files from the same folder...

Please check the base path setting, showcase.md must exist directly in the base directory and also, is there any recursive include?

It was indeed the base_path which was wrong. I thought the path was relative to the file, but it is at the Pelican root folder.
Thanks for your help!