Closed ostaadt closed 2 years ago
confirmed as having the same issue; haven't tried the fix yet
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. https://github.com/gohugoio/hugo/issues/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...