-
Notifications
You must be signed in to change notification settings - Fork 4
/
pelicanconf.py
76 lines (58 loc) · 2.29 KB
/
pelicanconf.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
#!/usr/bin/env python
# -*- coding: utf-8 -*- #
from __future__ import unicode_literals
from urllib.parse import urlencode
AUTHOR = 'EUREC4A Community'
SITENAME = 'EUREC4A Hackathon 2020'
SITETITLE = "EUREC4A"
SITESUBTITLE = "Hackathon 2020"
SITEURL = ''
PATH = 'content'
MARKUP = ("md", "ipynb")
THEME = 'themes/flex'
SITELOGO = SITEURL + "/images/logo_eurec4a.png"
MAIN_MENU = True
_menuitems = [('Archives', '/archives.html'),
('Categories', '/categories.html'),
('Tags', '/tags.html'),
('Authors', '/authors.html'),]
def make_menu(basepath):
return [(name, basepath + link) for name, link in _menuitems]
MENUITEMS = make_menu(SITEURL)
TIMEZONE = 'UTC'
DEFAULT_LANG = 'en'
# Feed generation is usually not desired when developing
FEED_ALL_ATOM = None
CATEGORY_FEED_ATOM = None
TRANSLATION_FEED_ATOM = None
AUTHOR_FEED_ATOM = None
AUTHOR_FEED_RSS = None
# Blogroll
LINKS = (('eurec4a.eu', 'http://eurec4a.eu/'),
('operational center', 'https://observations.ipsl.fr/aeris/eurec4a/'),
('Thredds Catalog', 'https://observations.ipsl.fr/thredds/catalog/EUREC4A/catalog.html'),
('AERIS leaflet', 'https://observations.ipsl.fr/aeris/eurec4a/Leaflet/'),
)
# Social widget
SOCIAL = (
('github', 'https://github.com/eurec4a'),
)
STATIC_PATHS = ['images']
DEFAULT_PAGINATION = False
# Uncomment following line if you want document-relative URLs when developing
#RELATIVE_URLS = True
from pelican_jupyter import markup as nb_markup
PLUGINS = [nb_markup]
IGNORE_FILES = [".ipynb_checkpoints"]
def binder_link(data_path="",
env_repo="https://github.com/eurec4a/hackathon_env",
data_repo="https://github.com/eurec4a/hackathon2020_blog",
env_branch="master",
data_branch="master",
data_prefix="content/",
binder="https://mybinder.org"):
nbgitpuller_src= urlencode({"repo": data_repo, "urlpath": "tree/{}/{}{}".format(data_repo.split("/")[-1], data_prefix, data_path), "branch": data_branch})
nbgitpuller_conf = urlencode({"urlpath": "git-pull?{}".format(nbgitpuller_src)})
group, repo = env_repo.split("/")[-2:]
return "{}/v2/gh/{}/{}/{}?{}".format(binder, group, repo, env_branch, nbgitpuller_conf)
JINJA_FILTERS = {'binder_link': binder_link}