Browse Source

allow for description overrides

Getty Ritter 2 years ago
parent
commit
24ade85473
2 changed files with 16 additions and 2 deletions
  1. 5 1
      main.py
  2. 11 1
      works/poems/the-festival-of-fears/metadata.yaml

+ 5 - 1
main.py

@@ -8,6 +8,7 @@ import pystache
 import shutil
 import sys
 import tempfile
+from typing import Optional
 import yaml
 
 class Datum:
@@ -39,6 +40,7 @@ class Work:
     title: str
     date: str
     contents: str
+    description: Optional[str] = None
 
 class Path:
     OUTDIR=tempfile.TemporaryDirectory()
@@ -194,7 +196,9 @@ def main():
                 # report other works in their own year
                 copy = f'© Getty Ritter {w.date}'
 
-            if slug in category_lookup:
+            if w.description is not None:
+                description = w.description
+            elif slug in category_lookup:
                 singular = category_lookup[slug]['singular']
                 description = f'{w.title}: a {singular}'
             else:

+ 11 - 1
works/poems/the-festival-of-fears/metadata.yaml

@@ -1 +1,11 @@
-{"category": "poem", "name": "The Festival of Fears", "date": "2006", "slug": "the-festival-of-fears"}
+category: poem
+name: The Festival of Fears
+date: 2006
+slug: the-festival-of-fears
+description: |
+  For the Garaths at Sorn, by the seas great and black,  
+  As they waited for all of their wives to come back  
+  And fired their surrs at the tumelant whales  
+  From the grelleking ships with no wind in their sails,  
+  The longest of days in all the long years  
+  Was the wintry cold Festival of Fears.