Commit fa70ab72 authored by Matthieu Boileau's avatar Matthieu Boileau

Reorg links config and template

parent 76201525
Pipeline #7740 passed with stage
in 1 minute and 51 seconds
......@@ -55,14 +55,11 @@ class NbCourse:
'authors': [],
'chapter_preview_only': [],
'license': None,
'links': [{
'title': 'Manual',
'target': 'manual.html',
'icon': {
'path': 'img/Infobox_info_icon.svg',
'width': '35px',
}
}]
'links': {'manual': {
'title': 'Manual',
'target': 'manual.html',
}
}
}
def __init__(self, user_conf=None):
......@@ -230,7 +227,7 @@ nbcourse --init\
dst_files = [dst_path / file for file in files]
else: # dealing with single file, preserve directory tree
src_files = [src_path]
rpath = src_path.relative_to(self.conf['nb']['dir'])
rpath = src_path.relative_to(self.conf['nb']['path'])
dst_path = self.conf['output_path'] / rpath
dst_files = [dst_path]
return src_files, dst_path, dst_files
......
......@@ -18,31 +18,21 @@ chapter_preview_only:
- 4
- 5
links:
- title: Notice
manual:
title: Manual
target: manual.html
icon:
path: img/Infobox_info_icon.svg
width: 35px
- title: Exécuter
binder:
title: Exécuter
target: https://mybinder.org/v2/gh/fitzinger/cours-python/master
icon:
path: https://mybinder.org/badge.svg
width: auto
- title: Version pdf
book:
title: Version pdf
target: cours-python.pdf
icon:
path: img/Adobe_PDF_icon.svg
width: 30px
- title: Sources
gitlab:
title: Sources
target: https://gitlab.math.unistra.fr/fitzinger/cours-python
icon:
path: img/GitLab_Logo.svg
width: 30px
- title: Archive complète
archive:
title: Archive complète
target: cours-python.zip
icon:
path: img/download.svg
width: 35px
license:
text: Contenu mis à disposition sous licence
target: https://creativecommons.org/licenses/by-sa/4.0/
......
{% extends "base.html" %}
{% set link_icons =
{'manual':
{'path': 'img/Infobox_info_icon.svg',
'width': '35px'},
'binder':
{'path': 'https://mybinder.org/badge.svg',
'width': 'auto'},
'book':
{'path': 'img/Adobe_PDF_icon.svg',
'width': '30px'},
'gitlab':
{'path': 'img/GitLab_Logo.svg',
'width': '30px'},
'archive':
{'path': 'img/download.svg',
'width': '35px'}
}
%}
{% block content %}
{% if picture %}
<img src="{{ picture.path }}" alt="{{ picture.path }}" width="{{ picture.width }}">
......@@ -35,13 +54,13 @@
<hr>
<table id="bottom">
<tr>
{% for link in links %}
{% for link in links.values() %}
<td>{{ link.title }}</td>
{% endfor %}
</tr>
<tr>
{% for link in links %}
<td><a href="{{ link.target }}"><img src="{{ link.icon.path }}" width="{{ link.icon.width }}"></a></td>
{% for link_type, link in links.items() %}
<td><a href="{{ link.target }}"><img src="{{ link_icons[link_type]['path'] }}" width="{{ link_icons[link_type]['width'] }}"></a></td>
{% endfor %}
</tr>
</table>
......@@ -50,7 +69,9 @@
{% for author in authors %}
<tr>
<td>{{ author.name }}</td>
{% if author.email %}
<td><a href="mailto: {{ author.email }}"><img style="display:inline" width="20" src="img/email.svg"></a></td>
{% endif %}
</tr>
{% endfor %}
</table>
......
......@@ -14,21 +14,21 @@ authors:
chapter_preview_only:
- 2
links:
- title: Manual
manual:
title: Manual
target: manual.html
icon:
path: img/Infobox_info_icon.svg
width: 35px
- title: PDF version
binder:
title: Run
target: https://mybinder.org
book:
title: PDF version
target: sample-cours.pdf
icon:
path: img/Adobe_PDF_icon.svg
width: 30px
- title: Complete archive
gitlab:
title: Sources
target: https://gitlab.com
archive:
title: Complete archive
target: sample-course.zip
icon:
path: img/download.svg
width: 35px
license:
text: Content available under license
target: https://creativecommons.org/licenses/by-sa/4.0/
......
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