Scroll to top

14/01/2023


2023/01/14#p1

0 comments: click to leave a comment

It was a lot easier than expected to change hyblog to a date-based folder structure for posts and comments.

To get all post and comment files, to build the next/previous links, I was using:

glob($target_dir.'*.md')

Moving to a yyyy/dd date structure meant that I just needed to change this to:

glob($target_dir.'*/*/*.md')

Because the view is organised by a date check I then just needed to change the file paths to save/update the files. Everything else takes care of itself.

This could get quite heavy if there were years worth of posts but it could be done in the background with a cron job. At the moment, with only a few days, it's still very quick.

Three of four goals set for this weekend achieved already!

No comments yet
Leave a reply



You can also:

Click here to reply using email Reply by email Send a webmention Send a Webmention



Close