Format month photo path component with a leading 0

This commit is contained in:
Eryn Wells 2023-01-29 16:28:35 -08:00
parent 8aaeef4d45
commit c6531e618d

View file

@ -48,7 +48,7 @@ def main(argv):
month = earliest_exif_date.month
name = args.title if args.title else os.path.splitext(os.path.basename(photo))[0]
post_path = os.path.join(PHOTOS_CONTENT_DIR, str(year), str(month), name)
post_path = os.path.join(PHOTOS_CONTENT_DIR, f'{year:04}', f'{month:02}', name)
try:
hugo_command = ['hugo', 'new', '--clock', earliest_exif_date.isoformat(), post_path]