Question Regarding Sorting Posts By Date With ox-hugo #654
Replies: 6 comments 4 replies
-
Yes, you need to set the post's date. You can do that by either using I would suggest that you follow all the steps in the ox-hugo Quick Start. Step # 10 in that guide:
is what will insert the date stamp in Org and that will export to the |
Beta Was this translation helpful? Give feedback.
-
To solve this problem, you need to first figure out what you need in the Markdown files (what front-matter variables, etc.) so that Hugo can sort your posts. Once you figure that out, just the ox-hugo docs should be sufficient enough to answer everything regarding how Org mode content converts to Markdown content + TOML front-matter. There shouldn't need a need to search online for this part. [ If something is missing in the ox-hugo docs, let me know how I can improve/add that. ] |
Beta Was this translation helpful? Give feedback.
-
Right, however, these dates were in the past, so using the 'DONE' idea wouldn't work necessarily in my scenario as I am currently migrating an existing Org based blog that was exported to HTML, but now to Hugo.
I'll try using the 'EXPORT_DATE' parameter value with this in mind, thanks a ton for this.
…On Mon, Jun 13, 2022, at 10:49 PM, Kaushal Modi wrote:
To solve this problem, you need to first figure out what you need in the Markdown files (what front-matter variables, etc.) so that Hugo can sort your posts.
Once you figure that out, just the ox-hugo docs should be sufficient enough to answer everything regarding how Org mode content converts to Markdown content + TOML front-matter. There shouldn't need a need to search online for this part. [ If something is missing in the ox-hugo docs, let me know how I can improve/add that. ]
—
Reply to this email directly, view it on GitHub <#654 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AVU3GXIBYJAXBXZ2KPB4XKLVO7XKVANCNFSM5YWCSFRA>.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
When I tried to do that aka I replaced all the ':CREATED:' tags with ":EXPORTED_DATE", I received this message that repeated a ton of times for each of the exported Markdown files in the '*Messages*' buffer in Emacs:
[ox-hugo] 165/ Exporting ‘April 27, 2018’ ..
[ox-hugo] Date will not be set in the front-matter: Not an Org time string: [04-27-2018]
The related example post at the end of the blog file was:
* April 27, 2018
:PROPERTIES:
:EXPORT_FILE_NAME: 04-27-2018
:EXPORT_DATE: [04-27-2018]
:END:
Blog contents
I'm wondering what I did wrong here, or if I have to correct this to the RPC date format?
Sincerely,
Sam
…On Tue, Jun 14, 2022, at 10:04 AM, Kaushal Modi wrote:
> Right, however, these dates were in the past
>
In that case, `EXPORT_DATE` property will work.
—
Reply to this email directly, view it on GitHub <#654 (reply in thread)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AVU3GXPO6IFKEYVZKD6KAULVPCGPPANCNFSM5YWCSFRA>.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
Just changed this over to this for all of my posts in the 'blog.org' file:
* May 12, 2022
:PROPERTIES:
:EXPORT_FILE_NAME: 2022-05-12
:EXPORT_DATE: [2022-05-12]
:END:
Worked like a charm, now the posts on the Hugo site display in the correct order from soonest post to furthest post in the past.
Total side note, what are some good themes you would recommend for a programming type blog?
I ask because I was trying to use the 'hyde-hyde' theme, which looks OK but the 'pre' tags could look better.
Thanks a ton by the way,
Sam
…On Tue, Jun 14, 2022, at 7:57 PM, Kaushal Modi wrote:
I think the date format needs to be YYYY-MM-DD, and the square brackets around them are optional.
You'll find a lot of examples in https://raw.githubusercontent.com/kaushalmodi/ox-hugo/main/test/site/content-org/all-posts.org.
—
Reply to this email directly, view it on GitHub <#654 (reply in thread)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AVU3GXKKGZIIM6AD42A652LVPEL5HANCNFSM5YWCSFRA>.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
Sweet, gotcha. Thanks for this, will tweak the 'hyde' one in that case.
…On Tue, Jun 14, 2022, at 8:37 PM, Kaushal Modi wrote:
> I was trying to use the 'hyde-hyde' theme, which looks OK but the 'pre' tags could look better.
>
If you find a theme that you like even remotely, just start using that. You can always tinker with the theme as you find time or swap the theme if you like something else better later on. That's the beauty of Hugo: focus on content writing in Org mode, and tweak the theme in Hugo if and when you get time 😀
—
Reply to this email directly, view it on GitHub <#654 (reply in thread)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AVU3GXJJZZX7O5Q5MZTY6H3VPEQV7ANCNFSM5YWCSFRA>.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
Hey there,
As you requested, I made a discussion post here.
I was able to export my posts just fine into individual markdown files with ease by using the 'PROPERTIES' tag accordingly for each post, ex:
I then exported each of the individual headings containing each blog post in the main 'blog.org' file into separate Markdown files by using 'ox-hugo' with the 'C-c C-e' keybinding to go to Export mode in Org mode, and hit 'H', and then 'A'.
However, the problem I am currently facing is that the posts are in such a random order now on the actual example Hugo site I deployed locally for testing purposes.
Is there a 'PROPERTIES' tag I am missing to add to each post, or is this something that needs to be configured in the '.toml' config file for the Hugo blog itself?
I am completely new to Hugo and have been piecing together a few random guides found here, as my ultimate goal is to make sure it works locally, and then to actually deploy my entire setup on my Debian 10 VPS hosted website running 'nginx':
#654 [ ] https://dbeley.ovh/en/post/2018/08/14/create-a-blog-with-hugo-emacs-and-ox-hugo/
Thanks,
Sam
Beta Was this translation helpful? Give feedback.
All reactions