remove zpadding
This commit is contained in:
parent
16137dce12
commit
325875a5c7
49 changed files with 63 additions and 2 deletions
30
import_mess/rebuild_current_images.py
Normal file
30
import_mess/rebuild_current_images.py
Normal 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()
|
||||
|
||||
|
||||
|
||||
|
||||
18
import_mess/remove_zpadding_images_names.py
Normal file
18
import_mess/remove_zpadding_images_names.py
Normal 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))
|
||||
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue