Commit 2864c54f authored by Matthieu Boileau's avatar Matthieu Boileau
Browse files

Merge branch 'dev-calendar' into 'master'

Move .ics to cal/ dir

See merge request !9
parents 2d4a72e2 72463489
Pipeline #19426 passed with stages
in 17 seconds
__version__ = '0.3.4'
__version__ = '0.3.5'
......@@ -763,9 +763,11 @@ class SeminarPage(IndexPage):
-//{self.conf.site['calendar']['organization']}//{self.seminar['type']} "
f"{self.title}//FR")
ical_content = build_calendar(prodid, ical_events)
ical_filepath = Path(self._get_filename()).with_suffix('.ics')
ical_filepath = 'cal' / Path(self._get_filename()).with_suffix('.ics')
ical_outpath = self.conf.output_path / ical_filepath
log.debug(f"Export ical file to {ical_outpath}")
# Create parent directory if not exists
ical_outpath.parent.mkdir(exist_ok=True, parents=True)
ical_outpath.write_text(ical_content)
if 'url' in self.conf.site:
self.ical_url = \
......
......@@ -310,8 +310,8 @@ def test_SeminarPage(miniwebsite):
'expérience',
'url': 'séminaire/séminaire-beau-souffrance-réveiller-beauté-horizon-manquer.html#naître-fumée-expérience'
}]
assert page.ical_url == "https://fakelab.fk/s%C3%A9minaire-beau-souffrance-r%C3%A9veiller-beaut%C3%A9-horizon-manquer.ics"
ical_filepath = Path(page._get_filename()).with_suffix('.ics')
assert page.ical_url == "https://fakelab.fk/cal/s%C3%A9minaire-beau-souffrance-r%C3%A9veiller-beaut%C3%A9-horizon-manquer.ics"
ical_filepath = 'cal' / Path(page._get_filename()).with_suffix('.ics')
ical_outpath = page.conf.output_path / ical_filepath
# Read the 20 first lines of the ical file
with open(ical_outpath) as f:
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment