Convert Hugo Content Files to Page Bundles

The bash script here converts the file to a page (leaf) bundle which is not convenient (since it converts the branch bundle to a leaf bundle). To exclude the file, try the code below

for FILE in *.md
if [[ "$FILE" == "" ]];then continue; fi
  # remove the last dot and subsequent chars to name the folder from the .md
  mkdir -p "$DIR"
  mv "$FILE" "$DIR"
find . \( -iname '*.md' ! -iname '' \) -execdir mv -i '{}' \;

Save the script in a file such as and make it executable depending on your platform. (On Windows, I have Git installed and double clicking on the sh file does the conversion for me automatically).

N.B. The script should be used in a folder full of .md files and the .sh should be in the same directory. (Solution put together with support from Stack-Overflow)