2022-09-28 21:43:45 +00:00
|
|
|
#!/bin/python3
|
|
|
|
# little script to go over each image in images/ and change the front matter properties.
|
|
|
|
|
|
|
|
import os
|
|
|
|
|
|
|
|
CONTENT_DIR = '../content/images/'
|
|
|
|
|
|
|
|
images_dirs = os.listdir(CONTENT_DIR)
|
|
|
|
|
|
|
|
for dir in images_dirs:
|
|
|
|
try:
|
|
|
|
id = int(dir)
|
|
|
|
except ValueError:
|
|
|
|
continue
|
|
|
|
# change tags to image-tags
|
|
|
|
path = CONTENT_DIR + dir + '/index.md'
|
|
|
|
print(path)
|
2022-09-28 22:29:47 +00:00
|
|
|
# index_file = open(path, 'w+')
|
|
|
|
# content = index_file.read()
|
|
|
|
# print(content)
|
|
|
|
# content = content.replace('tags:', 'image-tags:')
|
|
|
|
# print(content)
|
2022-09-28 21:43:45 +00:00
|
|
|
break
|
|
|
|
index_file.write(content)
|
|
|
|
index_file.close()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|