varia.website/plugins-custom/events-ics/README.md

64 lines
1.7 KiB
Markdown
Raw Normal View History

2021-01-19 22:33:28 +01:00
# events
2021-01-19 22:36:20 +01:00
modified pelican events plugin
Original author: Federico Ceratto <federico.ceratto@gmail.com>
2021-01-19 22:33:28 +01:00
events
2021-01-19 22:36:20 +01:00
---
2021-01-19 22:33:28 +01:00
This plugin scans blog posts for an events.
2021-01-19 22:36:20 +01:00
It also generates an `.ical` calendar file.
2021-01-19 22:33:28 +01:00
2021-01-19 22:36:20 +01:00
## Dependencies
2021-01-19 22:33:28 +01:00
2021-01-19 22:36:20 +01:00
This plugin depends on the `icalendar` package, which can be installed
2021-01-19 22:33:28 +01:00
using APT or RPM or, if you are unlucky, via pip::
pip install icalendar
2021-01-19 22:36:20 +01:00
## Usage
2021-01-19 22:33:28 +01:00
Add the following to pelicanconf.py::
2021-01-19 22:36:20 +01:00
PLUGIN_EVENTS = {
'ics_calendars': ['events.ics', 'meetings.ics'],
'default_location' : '',
'calendar_per_category': False
}
2021-01-19 22:33:28 +01:00
Create articles and usual and add the "event-start" metadata to turn them into
events. The event start is independent of the article "date".
"event-start" is in "YYYY-MM-DD hh:mm" format.
Also add "event-end", in the same format, or "event-duration" as a number
followed by a dimension:
w: weeks
d: days
h: hours
m: minutes
s: seconds
You can also add recurring events by setting the 'event-recurring' setting. Use 'daily', 'weekly', 'monthly' or 'yearly'. These will continue untill a set end date in "YYYY-MM-DD hh:mm" format.
Specify an optional "location" or set a default location in pelicanconf.py
Example in ReST format::
:event-start: 2015-01-21 10:30
:event-duration: 2h
2021-01-19 22:36:20 +01:00
:event-recurring: weekly untill 2015-12-21
2021-01-19 22:33:28 +01:00
:location: somewhere
Calendar per Category:
2021-01-19 22:36:20 +01:00
If you set the calendar_per_category setting to True, the plugin will create a calendar for every category you list both in ics_calendar and the article metadata.
2021-01-19 22:33:28 +01:00
To generate an sorted event list in a dedicated page copy the events_list.html
template under the templates directory in your theme, then create a page:
content/pages/events_list.rst::
2021-01-19 22:36:20 +01:00
Events list
###########
:slug: events-list
:summary:
:template: events_list