Commit 55da712d authored by Matthieu Boileau's avatar Matthieu Boileau

Fix #22

parent 38823d30
......@@ -83,8 +83,14 @@ class HomePage(Page):
def build_link_name(link_type: str, suffix: str):
"""Build archive or pdf book links from slug name"""
if link_type in self.variables['links']:
self.variables['links'][link_type]['target'] = \
self.variables['slug_title'] + suffix
try:
# For example look for yaml entry: `book: file: filename.pdf`
self.variables['links'][link_type]['target'] = \
self.variables[link_type]['file']
except KeyError:
# Use <slug_title>.pdf
self.variables['links'][link_type]['target'] = \
self.variables['slug_title'] + suffix
# Get chapters from notebook files
chapters = []
......
Markdown is supported
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