33 lines
704 B
Python
33 lines
704 B
Python
import random
|
|
import string
|
|
import datetime
|
|
|
|
generate_hash = hash
|
|
|
|
|
|
def create_mockup(topic, image_path):
|
|
date = datetime.date.today().strftime("%Y-%m-%d")
|
|
hash = generate_hash(datetime.datetime.now().__str__())
|
|
filename = f"content/mockups/{topic}-mockup-{date}-{hash}.md"
|
|
|
|
with open(filename, 'w') as f:
|
|
f.write(f"""---
|
|
title: {topic} Mockup
|
|
date: {date}
|
|
tags: [mockup, {topic}]
|
|
---
|
|
|
|
import MockupGallery from '@site/src/components/MockupGallery';
|
|
|
|
# {topic} Mockup
|
|
|
|
<MockupGallery images={{['{image_path}']}} />
|
|
|
|
[Additional description or notes]
|
|
""")
|
|
print(f"Created new mockup page: {filename}")
|
|
|
|
|
|
# Usage
|
|
create_mockup("LoginScreen", "/img/mockups/login-screen-v1.png")
|