craft-letter/scripts/util.py
2026-03-03 22:39:06 +01:00

10 lines
312 B
Python

from pathlib import Path
def get_latest_newsletter_number():
# Find the number of the latest newsletter
destination_path = Path(f"./content/newsletter")
p = destination_path.glob("craft-letter-*.md")
files = [x for x in p if x.is_file()]
letter_number = len(files)
return letter_number