Little trick to mass/bulk create md-files (MacOS)

Couldn’t find an answer to this so I just let it fly. This is how you bulk or mass create .md-files with the new command. Ideal if you need to move from another platform to Hugo or if you have an Excel or Google sheet with posts that need to be created

  1. Get your archetypes in order
  2. Get your Excel or Google sheet in order, every row in a column containing a new command, e.g:

hugo new post/firstpost.md
hugo new post/secondpost.md

I initially did this by creating a three columns in a google sheet: column one containing hugo new post/, column two containing filename (which is made into slug-format through Excel), column three containing .md. Then I proceeded to copy paste all three columns into an online textfixer service that removed the tab breaks between columns giving us a nice one column list.

  1. Open terminal and move to your hugo site directory
  2. Copy the entire column and paste it in terminal
  3. Lots of new files!
3 Likes