SchumacherFM / wordpress-to-hugo-exporter

Hugo is static site generator written in golang. Wordpress is a tool for remote access to your server ;-) ❗️Contributions welcome!
https://gohugo.io
GNU General Public License v3.0
692 stars 95 forks source link

Configure Export Path Format #65

Closed Doocey closed 4 years ago

Doocey commented 6 years ago

Hi there,

Great job on this plugin, it works very well for most cases, and I have used it successfully in previous builds.

However, I am hoping you may be able to shed some light on the way the exported .md files for posts are processed. I have a normal WordPress permalink structure of /year/month/day and as per usual, the markdown frontmatter includes that, as desired.

The individual .md files are prefixed with the following format: Y-m-d- (as noted in the attached screenshot PHP date() function)

current-format

My question is whether I can the export format so that posts are placed in subdirectories like so:

desired-format

So ultimately, upon creation of the the .md files for posts, they are placed in a nested folder format of year/month/day/file-name.md. I have tried doing so by editing the plugin, editing date format to YY"/"mm"/"dd and running an export locally, but it baulks at exporting the posts.

I am trying to pull these .md files in using GatsbyJS, and while I can rename & place the individual files into the subfolder structure, I have over 300 entries which I'd prefer to avoid editing by hand!

I thought my new format is along the right track, but I shall see whether you have an advisable play in this situation before moving on.

Thank you!

SchumacherFM commented 4 years ago

closing due to age. reopen if desired.