Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FR] Option to export as index.md, even when EXPORT_FILE_NAME set to something else. #734

Open
rwilson4 opened this issue Jan 13, 2024 · 0 comments

Comments

@rwilson4
Copy link

Hi folks,
First off, thanks so much for creating ox-hugo. I've been using it with my blog recently, and loving it.

In my blogging flow, all posts get created as bundles, e.g. in content/post/<blog_title>/index.md. I can achieve this with ox-hugo by setting the EXPORT_HUGO_BUNDLE property to <blog_title> and EXPORT_FILE_NAME to index.

But I often want to export my post in multiple formats, not just Hugo. I often also export as a LaTeX doc. For that my EXPORT_FILE_NAME needs to be export/<blog_title>. Then when I export as pdf, it get saved as export/<blog_title>.pdf. But then when I export via ox-hugo, it gets saved as content/post/<blog_title>/<blog_title>.md, which isn't what I want. Hugo (or at least, the academic theme I use), doesn't seem to recognize anything other than index.md, so the file seemingly has to be index.md.

I have a kludgey work-around: I know enough elisp to have manually edited org-hugo-export-to-md to ignore EXPORT_FILE_NAME and just hard-code to index.md. I replaced the line:
(outfile (org-export-output-file-name ".md" subtreep pub-dir)))

with:
(outfile (concat (file-name-as-directory pub-dir) "index.md")))

And that seems to do it for me. But obviously not everyone wants to do that. So my request/suggestion is to enable the user to always export as index.md (perhaps only when EXPORT_HUGO_BUNDLE is specified), ignoring EXPORT_FILE_NAME.

Thanks again folks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant