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
I've been writing a few posts lately, and some posts have needed to be split into two, and hence the initial value of EXPORT_FILE_NAME has needed to be changed. So I might have, at the beginning of a post, something like:
When I export all of the org file (which contains all of my posts) to Hugo, I'll have a post corresponding to that file name. But suppose later I change the export file name:
:EXPORT_FILE_NAME: a_new_and_better_name
Now, when I export to Hugo, I have two blog posts with the same title (which hasn't changed), each corresponding to one of the exported file names.
How do I either (a) prevent this from happening, or (b) remove the old post? It's not enough to remove it from the public directory, as there may still be a link to it in index.xml.
(This may be more of a Hugo question than an ox-hugo question. But since all my interaction with Hugo is through ox-hugo, I thought I should ask here first.) Many thanks!
The text was updated successfully, but these errors were encountered:
There's no way. If you are modifying the EXPORT_FILE_NAME, the exported Markdown file name will change.
, or (b) remove the old post?
Yes, each time you modify the EXPORT_FILE_NAME, also remember to delete the old Markdown file from the content/ directory.
It's not enough to remove it from the public directory, as there may still be a link to it in index.xml.
I don't understand this. When you delete the old Markdown file from content/, Hugo will regenerate the whole public/ directory. So there shouldn't be any references to the old deleted file in index.xml.
Don't manually tweak the files in public/ because that whole directory gets regenerated by Hugo.
If you are managing the ox-hugo exports using git
If you change the EXPORT_FILE_NAME, you will notice that there are now 2 Markdown files (old and new) when you do git status. You can review that and delete the old file before you rerun Hugo.
This issue is also a duplicate of #34. If you follow the thread, someone chose to just delete the entire content/ directory and report all the Org files using ox-hugo each time. I don't recommend that though if you are changing only one file name at a time. It's much easier to be aware of the change and manually delete the old file.
ox-hugo remains to be conservative in nature such that it won't auto-delete anything; it will only export and create new files or modify existing files in content/ based on the changes in the Org files.
This may be more of a Hugo question than an ox-hugo question
If deleting the old Markdown file from content/ solves the problem, then this is not a Hugo issue.
It would be a Hugo issue if the index.xml had references to the old file even after deleting it from the content/ directory. Again, don't modify the files inside public/!
I've been writing a few posts lately, and some posts have needed to be split into two, and hence the initial value of
EXPORT_FILE_NAME
has needed to be changed. So I might have, at the beginning of a post, something like:When I export all of the org file (which contains all of my posts) to Hugo, I'll have a post corresponding to that file name. But suppose later I change the export file name:
Now, when I export to Hugo, I have two blog posts with the same title (which hasn't changed), each corresponding to one of the exported file names.
How do I either (a) prevent this from happening, or (b) remove the old post? It's not enough to remove it from the public directory, as there may still be a link to it in
index.xml
.(This may be more of a Hugo question than an ox-hugo question. But since all my interaction with Hugo is through ox-hugo, I thought I should ask here first.) Many thanks!
The text was updated successfully, but these errors were encountered: