You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
academic import --bibtex publications.bib is creating a malformed path for markown_path in parse_bibtex_entry, which is defined in academic/import_bibtex.py.
markdown_path starts with content/..., but the subprocess call to hugo new {markdown_path} --kind publication } already prepends the path with content automatically.
BibTeX entries are parsed correctly, and cite.bibis created in the correct directory (e.g., content/publication/some-publication-id/cite.bib). The markdown entry, however, is created in content/content/publication/some-publication-id/index.md. Subsequently, parse_bibtex_entry throws an error, because it cannot find index.md in content/publication/some-publication-id.
I don't know if this a bug in hugo new --publication or a change in archetypes behavior in the latest hugo
I was able to fix the problem in academic by changing markdown_path from
Hugo v.0.89 is a new release with major changes. There are often bugs in the very latest major Hugo versions. Consider reporting Hugo bugs in the Hugo repo so that the relevant team are aware of them and can help address them...Or better yet, help contribute a Hugo fix since it's also an open source initiative that's driven by the community ;)
In this case, it appears the Hugo 0.89.0 CLI bugs were fixed in Hugo 0.89.4 (e.g. gohugoio/hugo#9177).
With Hugo 0.89.4, the command you referred to, hugo new content/publication/test/index.md --kind publication, works fine.
Also, if anyone wants to help submit a PR for #85 (removing the dependency on hugo new), that would be appreciated by a large number of users in the community who don't want to install Hugo locally or rely on Hugo to generate publications!
academic import --bibtex publications.bib
is creating a malformed path formarkown_path
inparse_bibtex_entry
, which is defined inacademic/import_bibtex.py
.markdown_path
starts withcontent/...
, but the subprocess call tohugo new {markdown_path} --kind publication }
already prepends the path withcontent
automatically.BibTeX entries are parsed correctly, and
cite.bib
is created in the correct directory (e.g.,content/publication/some-publication-id/cite.bib
). The markdown entry, however, is created incontent/content/publication/some-publication-id/index.md
. Subsequently,parse_bibtex_entry
throws an error, because it cannot findindex.md
incontent/publication/some-publication-id
.I don't know if this a bug in
hugo new --publication
or a change in archetypes behavior in the latesthugo
I was able to fix the problem in
academic
by changingmarkdown_path
frommarkdown_path = os.path.join(bundle_path, "index.md")
to
markdown_path = f"{pub_dir}/{slugify(entry['ID'])}/index.md"
This fix works for hugo v.0.89.0, but it might break older versions...
The text was updated successfully, but these errors were encountered: