GetRD / academic-file-converter

📚 Import Bibtex publications and Jupyter Notebook blog posts into your Markdown website or book. 将Bibtex转换为Markdown网站
https://docs.hugoblox.com/reference/content-types/#automatically-import-publications-from-bibtex
MIT License
363 stars 102 forks source link

Error: No such file or directory: 'content/publication/.../index.md' #107

Closed g8a9 closed 2 years ago

g8a9 commented 2 years ago

Hi there, I've been following the simple guide to import a new *.bib but I get this error:

Error: could not determine content directory for "content/publication/attanasio-e-mimic-2021/index.md" Traceback (most recent call last): File "/Users/giuseppe/miniconda3/bin/academic", line 8, in sys.exit(main()) File "/Users/giuseppe/miniconda3/lib/python3.8/site-packages/academic/cli.py", line 27, in main parse_args(sys.argv[1:]) # Strip command name, leave just args. File "/Users/giuseppe/miniconda3/lib/python3.8/site-packages/academic/cli.py", line 85, in parse_args import_bibtex( File "/Users/giuseppe/miniconda3/lib/python3.8/site-packages/academic/import_bibtex.py", line 39, in import_bibtex parse_bibtex_entry( File "/Users/giuseppe/miniconda3/lib/python3.8/site-packages/academic/import_bibtex.py", line 85, in parse_bibtex_entry page.load(Path("index.md")) File "/Users/giuseppe/miniconda3/lib/python3.8/site-packages/academic/editFM.py", line 27, in load with self.path.open("r", encoding="utf-8") as f: File "/Users/giuseppe/miniconda3/lib/python3.8/pathlib.py", line 1218, in open return io.open(self, mode, buffering, encoding, errors, newline, File "/Users/giuseppe/miniconda3/lib/python3.8/pathlib.py", line 1074, in _opener return self._accessor.open(self, flags, mode) FileNotFoundError: [Errno 2] No such file or directory: 'content/publication/attanasio-e-mimic-2021/index.md'

I am running the academic import --bibtex *.bib cmd from the root of my website. Also, the folder content/publication/attanasio-e-mimic-2021/ gets correctly created and the cite.bib with the content of my *.bib inserted in it. In fact, a new call of the same cmd returns a

04:45:35PM WARNING: Skipping creation of content/publication/attanasio-e-mimic-2021 as it already exists. To overwrite, add the --overwrite argument.

Am I missing something?

I am on macOS 12 and hugo 0.89.3.

Thank you in advance!

gcushen commented 2 years ago

The CLI uses Hugo to create the index.md file, so there may have been an issue with the underlying Hugo Extended 0.89+ on your system if that file wasn't found.

Have you tried the earlier CLI version which doesn't use Hugo to generate the file? See https://github.com/wowchemy/hugo-academic-cli#installation

github-actions[bot] commented 2 years ago

This issue is stale because it has not had any recent activity. The resources of the project maintainers are limited, and so we are asking for your help.

If this is a bug and you can still reproduce this error on the main branch, consider contributing a Pull Request with a fix.

If this is a feature request, and you feel that it is still relevant and valuable, consider contributing a Pull Request for review.

This issue will automatically close soon if no further activity occurs. Thank you for your contributions.

Deusu commented 2 years ago

I had the same problem. Solved by installing the earlier CLI version with pip3 install academic==0.5.1.

github-actions[bot] commented 2 years ago

This issue is stale because it has not had any recent activity. The resources of the project maintainers are limited, and so we are asking for your help.

If this is a bug and you can still reproduce this error on the main branch, consider contributing a Pull Request with a fix.

If this is a feature request, and you feel that it is still relevant and valuable, consider contributing a Pull Request for review.

This issue will automatically close soon if no further activity occurs. Thank you for your contributions.