remove zpadding

This commit is contained in:
Matthieu Bessat 2022-09-28 23:43:45 +02:00
commit 325875a5c7
49 changed files with 63 additions and 2 deletions

View file

@ -0,0 +1,30 @@
#!/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)
index_file = open(path, 'w+')
content = index_file.read()
print(content)
content = content.replace('tags:', 'image-tags:')
print(content)
break
index_file.write(content)
index_file.close()

View file

@ -0,0 +1,18 @@
#!/bin/python3
# remove z padding in files
import os
CONTENT_DIR = '../content/images/'
images_dirs = os.listdir(CONTENT_DIR)
for dir in images_dirs:
# remove z padding
try:
id = int(dir)
except ValueError:
continue
if dir != id:
os.rename(CONTENT_DIR + dir, CONTENT_DIR + str(id))