site relaunch

This commit is contained in:
evilchili
2023-06-11 21:35:15 -07:00
parent a6c101b01b
commit b70e416a3f
38 changed files with 834 additions and 70 deletions
+5 -2
View File
@@ -49,6 +49,7 @@ class ContentType(str, Enum):
lore = 'lore'
monster = 'monster'
region = 'region'
location = 'location'
page = 'page'
@@ -226,9 +227,11 @@ def new(
print("You must specify a category for 'post' content.")
sys.exit()
case 'monster':
category = 'beastiary'
category = 'bestiary'
case 'region':
category = 'regions'
category = 'locations'
case 'location':
category = 'locations'
case 'page':
category = 'pages'
case _:
+2 -2
View File
@@ -18,10 +18,10 @@ def create(content_type: str, title: str, template_dir: str,
return slugify(s, regex_subs=SETTINGS['SLUG_REGEX_SUBSTITUTIONS'])
template_path = Path(template_dir)
template_name = template + ".md"
template_name = f"{template or content_type}.md"
if not (template_path / template_name).exists():
print(f"Expected template {template_name} not found. Using default markdown template.")
template_name = 'default.md'
print("Not found. Using default markdown template.")
env = Environment(
loader=FileSystemLoader(template_path),
trim_blocks=True,