This commit is contained in:
gauthiier 2025-09-21 07:32:21 +02:00
parent 5ed1a6ebd7
commit 2e2da08a09
4 changed files with 20 additions and 7 deletions

4
.gitignore vendored
View File

@ -1,7 +1,7 @@
conf.yml conf.yml
public/ public/
content/events content/events/
content/bibliography content/bibliography/
# ---> macOS # ---> macOS
# General # General

View File

@ -2,9 +2,22 @@
Site logics of "Mathematics & Artifice" Site logics of "Mathematics & Artifice"
''' Setup:
```
> python -m venv venv > python -m venv venv
> source venv/bin/activate > source venv/bin/activate
> pip install -r requirements.txt > pip install -r requirements.txt
> python make.py > python make.py
''' ```
Fetch bibliography (make sure conf.yml is set/valid):
```
> python fetch_bib.py
> python make.py
```
Fetch events (make sure conf.yml is set/valid):
```
> python fetch_ics.py
> python make.py
```

View File

@ -62,7 +62,7 @@ if __name__ == "__main__":
fm_date = e.begin.format(DFMT) fm_date = e.begin.format(DFMT)
fm_date_interval = f"{e.begin.format(DHFMT)}-{e.end.format(HFMT)}" fm_date_interval = f"{e.begin.format(DHFMT)}-{e.end.format(HFMT)}"
filename = f'{fm_date}-{name}.md' filename = f'{fm_date}-{name}.md'
filepath = pathlib.Path(conf['content']) / 'event' / filename filepath = pathlib.Path(conf['content']) / 'events' / filename
if not filepath.exists(): if not filepath.exists():
print(f"new event: {e.name}") print(f"new event: {e.name}")

View File

@ -59,7 +59,7 @@ if __name__ == "__main__":
if not events_dir.exists(): if not events_dir.exists():
print("path content/events does not exist.") print("path content/events does not exist.")
else: else:
events = list(utils.get_files_in_subdir(conf['content'], 'event', 'md').values()) events = list(utils.get_files_in_subdir(conf['content'], 'events', 'md').values())
for e in events: for e in events:
p = frontmatter.load(e) p = frontmatter.load(e)
summary = f"{p['title']} - {p['date']}" summary = f"{p['title']} - {p['date']}"