diff --git a/lumbunglib/cloudcal.py b/lumbunglib/cloudcal.py index fd27482..2375f31 100644 --- a/lumbunglib/cloudcal.py +++ b/lumbunglib/cloudcal.py @@ -75,6 +75,7 @@ def create_metadata(event): "duration": date.compress(event.duration), "location": event.location, "uid": event.uid, + "featured_image": "", "images": find_imageURLS(event.description), # currently not used in template } @@ -158,6 +159,8 @@ def create_event_post(post_dir, event): event_metadata["description"] = event_metadata["description"].replace( img, "![]({})".format(img_name) ) + if event_metadata["featured_image"] == "": + event_metadata["featured_image"] = img_name if img_name in existing_images: existing_images.remove(img_name) diff --git a/lumbunglib/templates/calendar.md b/lumbunglib/templates/calendar.md index 849530c..e27acbe 100644 --- a/lumbunglib/templates/calendar.md +++ b/lumbunglib/templates/calendar.md @@ -8,6 +8,9 @@ event_end: "{{ event.end }}" duration: "{{ event.duration }}" localized_begin: "{{ event.localized_begin }}" uid: "{{ event.uid }}" +{% if event.featured_image %} +featured_image: "{{ event.featured_image }}" +{% endif %} {% if event.location %} location: "{{ event.location }}" {% endif %}