-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathcreateRobotProfile.py
34 lines (29 loc) · 998 Bytes
/
createRobotProfile.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
import os
import datetime
def main():
year = datetime.datetime.now().year
# year = 2024
filename = f"_robots/{year}.md"
toWrite = f"""---
layout: robot
year: {year}
robotName: ROBOT NAME
game: GAME NAME
thumbnail: /assets/images/notFound.png #supply a path to an image of the robot, you should place it in /assets/YYYY/example.png
metatitle: "{year} Robot: ROBOT NAME"
metadesc: GAME NAME Performance and Statistics
published: false #remove this line once youve filled in the data, or set the value to true
---"""
if not os.path.exists(filename):
with open(filename, "w") as f:
f.write(toWrite)
f.close
print(f"Success, Created file /{f.name}")
else:
print(f"File Already Exists: /{filename}")
if not os.path.exists(f"assets/{year}"):
os.makedirs(f"assets/{year}")
print(f"Success, Created Assets Folder /assets/{year}")
else:
print(f"Directory Already Exists: /assets/{year}")
main()