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
Exporting fails in case of multiple entries with same title #660
Comments
|
Thanks for bisecting this. This is an unexpected regression because I introduced the use of Line 4576 in 85d1121
Thanks to your minimal reproducible example, I can easily see that error now. It wasn't caught by the test suite or my personal use because I never had subtrees with the same heading and at the same level. Unfortunately, I don't have a "fix" for this because the E.g. if the headline hierarchy is: the path is This method was more robust compared to tracking the starting point of a post subtree in an Org file. I switched to this method because the earlier starting-point-tracking method failed if an earlier post subtree in the same file contained links to other subtrees. Is it possible to organize your posts with identical headings in different subtrees so that their "full path" is unique? Taking your minimal example, this fixes the error: |
|
I'm not closing this issue yet. I'm considering a low priority enhancement request/note for myself:
|
|
Thank you very much for your reply! I understand your reasoning and agree. To be honest, I cannot think of any good reason for having multiple blog posts with the same title at the same level. Although, it may be relevant for multi-lingual blogs where two translations are (for whatever reason) identical. In my case, there are three quite old posts for which I'll either follow your proposed multiple subtree approach or rename them. Thank you very much for your effort and for maintaining the package. |
|
I don't have any experience with multi-lingual web sites. But probably something like this works: Another issue with post headings with the exact same strings is that intra-post links like Now that I think about it, there's probably very little value in supporting post headings with exact same text. Even if I could write a workaround to the default behavior of Solution: Don't have identical text for post titles. If you really really need to do that, then may be put them in separate .org files. @mmk2410 Would that solution be acceptable? |
I have the same feeling. And the problem with internal links is another good point that I didn't even think about before.
Yes, it certainly would. I already changed the title of the conflicting posts in my blog yesterday. |
|
I appreciate the reply. I'll then close this issue. |
Actual Behavior
Given an org file (like the one below) where two or more posts have the same headline (but different
EXPORT_FILE_NAME) the exporting process fails with "Heading not unique on level 1: My Blog Post".I jumped a bit through the Git history and could narrow the introduction of this regression down to commit f9c9aaf (the ones before work, starting with this the error occurs). Sadly I have nearly no knowledge of Emacs Lisp, ox-hugo and/or org (and its API) to further narrow down the faulty code.
Maybe this is also an user error, but I could not find any information about such an breaking change in the changelog for 0.12.1.
Expected Behavior
The exporting process runs without any errors, as done before f9c9aaf.
How to Reproduce the Issue
The issue may be reproduced by saving the following example and exporting either just one subtree or all subtrees of the buffer.
Example Org File
My personal website provides a "real world" example of this issue with a build in a pristine Emacs environment: https://gitlab.com/mmk2410/mmk2410.org, especially https://gitlab.com/mmk2410/mmk2410.org/-/pipelines.
Generated Markdown File or Error
No markdown files are produced, but the following error is printed out:
Ox-Hugo Debug Information
Debug Info
Debug information for
ox-hugoEmacs Version
Org Version
Hugo Version
Org
load-pathshadowsWarning: Possible mixed installation of Org
Study the output of
M-x list-load-path-shadows.ox-hugodefcustomsThe text was updated successfully, but these errors were encountered: