Folder Structure (Also automation)

Okay so I have my blog up and running and I am oh so thrilled!

But there are two things that have cropped up that I have tried to suss the answer out on but after many fruitless hours, ive come up blank.

So my blog theme sets my post structure up like so:

Each post is in its own folder, and each post in the individual folders named index.md. I haven’t seen this before, but im still new so unsure of all the reasons why xyzzy is done exactly as it is. But is that going to be problematic down the line? I am used to posts all being in a post folder and individually titled and that’s all ive ever known.

That in a weird way brings me to my next query: IS there a way to automate the posting process a bit? I found someone who used Shortcuts on macOS to automate the posting process but their posts are all in the posts folder and there was no need to create a folder inside the posts folder for the new post. Additionally shortcuts wouldn’t run for me properly so it’s a no go. Is there an easier way to automate this that can be suggested?

There won’t be issues down the line depending on your theme and the modules/plugins you use.

Your type of folder structure is called “Leaf Bundle”, the method where all files reside within posts is called “Branch Bundle”.

A branch bundle is more straightforward because everything is in one place. It’s also more chaotic the more content you have. On the other side with a leaf bundle you can move everything that belongs to one post into that folder and it will be easily accessible there.

Read more about that here.

Long story short: decide for one, or the other, or even a mix :wink:

You could rename your structure like this and have a branch bundle:

post
- basel-adra-speech.md (former basel-adra-speech/index.md)
- being-disabled.md (former being-disabled/index.md)
- etc
- ...

Edit to add:

About the automation: I assume that it is as easy as posts/$$$TITLE$$$.md to create posts/$$$TITLE$$$/index.md in some rule with whatever tool you are using. That should not block you from deciding for one or the other. The easiest kind of automation is done via archetypes where you easily call hugo new en/posts/MYTITLE and end up with the proper structure if your archetype setup looks like this:

archetype
- posts
  - index.md (template for content files)
  - anything else that you want to have in every new leaf bundle
1 Like

Thank you for that! That makes a lot more sense.

So I have another query you may be able to assist with.

This is the shortcut I am trying to make based on ( How to Optimize Your Hugo Blogging Workflow on Mac ) I get two things. One: Where the run shell has an input drop down where you select Provided Input. I select it and it goes back to blank as if I hadn’t. So I proceeded to run it as is, and got command hugo isn’t found.

I realize this question may be a bit beyond anyone here’s purview so if that’s the case if you could point me to where I can get some additional assistance with this id be very grateful!

Your shell script is flawed, as cd run this way will not change the directory for the next command. And you should always put $1 in double quotes to protect it from the shell i command line processing.

But all this has nothing to do with Hugo, you might get more helpful answers in places dedicated to shortcuts and macOS.