forked from ruangrupa/konfluks
cal: set featured_image in template
This commit is contained in:
parent
1f21d0475f
commit
e32743ecd5
@ -75,6 +75,7 @@ def create_metadata(event):
|
|||||||
"duration": date.compress(event.duration),
|
"duration": date.compress(event.duration),
|
||||||
"location": event.location,
|
"location": event.location,
|
||||||
"uid": event.uid,
|
"uid": event.uid,
|
||||||
|
"featured_image": "",
|
||||||
"images": find_imageURLS(event.description), # currently not used in template
|
"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(
|
event_metadata["description"] = event_metadata["description"].replace(
|
||||||
img, "![]({})".format(img_name)
|
img, "![]({})".format(img_name)
|
||||||
)
|
)
|
||||||
|
if event_metadata["featured_image"] == "":
|
||||||
|
event_metadata["featured_image"] = img_name
|
||||||
if img_name in existing_images:
|
if img_name in existing_images:
|
||||||
existing_images.remove(img_name)
|
existing_images.remove(img_name)
|
||||||
|
|
||||||
|
@ -8,6 +8,9 @@ event_end: "{{ event.end }}"
|
|||||||
duration: "{{ event.duration }}"
|
duration: "{{ event.duration }}"
|
||||||
localized_begin: "{{ event.localized_begin }}"
|
localized_begin: "{{ event.localized_begin }}"
|
||||||
uid: "{{ event.uid }}"
|
uid: "{{ event.uid }}"
|
||||||
|
{% if event.featured_image %}
|
||||||
|
featured_image: "{{ event.featured_image }}"
|
||||||
|
{% endif %}
|
||||||
{% if event.location %}
|
{% if event.location %}
|
||||||
location: "{{ event.location }}"
|
location: "{{ event.location }}"
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
Loading…
Reference in New Issue
Block a user