site relaunch
This commit is contained in:
@@ -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 _:
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user