Last active
December 27, 2020 20:56
-
-
Save Arty2/b102e4049ff4cf81d17125e420fd82f2 to your computer and use it in GitHub Desktop.
Loop through every .jpg file in the same directory and make a Hugo page bundle out of each.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo OFF | |
rem loop through all JPG files | |
for %%f IN (*.jpg) DO ( | |
rem make a new directory with the same filename | |
mkdir %%~nf | |
rem move file the new directory | |
move %%f %%~nf/%%f | |
rem go inside the new directory | |
cd %%~nf | |
rem generate YAML frontmatter and save as index.en.md | |
( | |
echo --- | |
echo directURL: %%f | |
echo cover: %%f | |
echo render: never | |
echo list: local | |
echo publishResources: false | |
rem date is not returned consistently across locales | |
rem echo date: %%~tf | |
echo --- | |
) > index.en.md | |
rem create file in another language with the same content | |
copy index.en.md index.el.md | |
rem return back to the working directory | |
cd ../ | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment