forked from pyvideo/pyvideo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpelicanconf.py
executable file
·142 lines (121 loc) · 3.7 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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
#!/usr/bin/env python
# -*- coding: utf-8 -*- #
from __future__ import unicode_literals
import json
import os
AUTHOR = "Software Livre Brasil"
SITENAME = "Vídeos de Software Livre no Brasil"
SITEURL = 'https://videos.gnulinux.com.br'
TEMPLATE_PAGES = {
'languages.html': 'languages.html',
}
PATH = 'content'
DATA_DIR = 'conferences'
NO_PUBLISH_FILE = 'NO_PUBLISH.json'
IGNORE_FILES = [
'.#*',
'category.json',
'CONTRIBUTING.rst',
'CONTRIBUTORS_WITHOUT_COMMITS.rst',
NO_PUBLISH_FILE,
'README.rst',
'*.schemas/video.json',
'*posters/apsimregions-a-gridded-modeling-framework-for-th.json',
]
TIMEZONE = 'America/Sao_Paulo'
DEFAULT_LANG = u'pt_BR'
DEFAULT_PAGINATION = 10
DEFAULT_CATEGORY = "Undefined"
AUTHOR_URL = AUTHOR_SAVE_AS = 'palestrante/{slug}.html'
ARTICLE_URL = ARTICLE_SAVE_AS = '{category}/{slug}.html'
ARTICLE_LANG_URL = ARTICLE_LANG_SAVE_AS = '{category}/{slug}-{lang}.html'
DRAFT_URL = DRAFT_SAVE_AS = 'drafts/{category}/{slug}.html'
DRAFT_LANG_URL = DRAFT_LANG_SAVE_AS = 'drafts/{category}/{slug}-{lang}.html'
PAGE_URL = PAGE_SAVE_AS = 'paginas/{slug}.html'
PAGE_LANG_URL = PAGE_LANG_SAVE_AS = 'paginas/{slug}-{lang}.html'
CATEGORY_URL = CATEGORY_SAVE_AS = 'eventos/{slug}.html'
TAGS_URL = TAGS_SAVE_AS = 'tags.html'
# Hack to avoid this issue: https://github.com/getpelican/pelican/issues/1137
TAG_URL = 'tag/{slug}/'
TAG_SAVE_AS = 'tag/{slug}/index.html'
# End hack to avoid issue #1137
YEAR_ARCHIVE_SAVE_AS = 'archives/{date:%Y}/index.html'
MONTH_ARCHIVE_SAVE_AS = 'archives/{date:%Y}/{date:%b}/index.html'
CATEGORIES_SAVE_AS = 'eventos.html'
AUTHORS_SAVE_AS = 'palestrantes.html'
USE_FOLDER_AS_CATEGORY = False
# Feeds
FEED_MAX_ITEMS = 100
FEED_ALL_ATOM = 'feeds/all.atom.xml'
FEED_ALL_RSS = 'feeds/all.rss.xml'
CATEGORY_FEED_ATOM = 'feeds/event_{slug}.atom.xml'
CATEGORY_FEED_RSS = 'feeds/event_{slug}.rss.xml'
AUTHOR_FEED_ATOM = 'feeds/speaker_{slug}.atom.xml'
AUTHOR_FEED_RSS = 'feeds/speaker_{slug}.rss.xml'
TAG_FEED_ATOM = 'feeds/tag_{slug}.atom.xml'
TAG_FEED_RSS = 'feeds/tag_{slug}.rss.xml'
# Uncomment following line if you want document-relative URLs when developing
RELATIVE_URLS = True
DELETE_OUTPUT_DIRECTORY = True
THEME = 'themes/slvideo/'
GITHUB_URL = 'https://github.com/phls/pyvideo'
#CONTRIBUTE_URL = 'https://github.com/pyvideo/pyvideo/wiki/How-to-Contribute-Media'
#API_URL = 'https://api.pyvideo.org'
API_URL = 'http://videos.softwarelivre.org'
STATIC_PATHS = [
'images',
'extra/robots.txt',
'extra/favicon.ico',
'extra/CNAME',
]
EXTRA_PATH_METADATA = {
'extra/CNAME': {'path': 'CNAME'},
'extra/robots.txt': {'path': 'robots.txt'},
'extra/favicon.ico': {'path': 'favicon.ico'}
}
PLUGIN_PATHS = ['plugins']
PLUGINS = [
'pelican_alias',
'drop_no_publish',
'json_reader',
'replace_underscore',
'extended_sitemap',
'event_series',
'event_info',
'aggregations',
'writer',
]
# https://en.wikipedia.org/wiki/ISO_639-3
# https://en.wikipedia.org/wiki/List_of_ISO_639-3_codes
VIDEO_LANGUAGE_NAMES = {
'ita': 'Italian',
'zho': 'Chinese',
'por': 'Portuguese',
'ukr': 'Ukrainian',
'deu': 'German',
'eng': 'English',
'rus': 'Russian',
'fra': 'French',
'spa': 'Spanish',
'eus': 'Basque',
'cat': 'Catalan',
'glg': 'Galician',
'kor': 'Korean',
'lit': 'Lithuanian',
'jpn': 'Japanese',
'slk': 'Slovak',
'pol': 'Polish',
'heb': 'Hebrew',
'tha': 'Thai',
'ces': 'Czech',
}
def jinja_language_name(code):
return VIDEO_LANGUAGE_NAMES.get(code, code)
JINJA_FILTERS = {
'language_name': jinja_language_name,
'commafy': lambda v: "{:,}".format(v)
}
try:
PR_NUMBER = int(os.environ.get('TRAVIS_PULL_REQUEST'))
except (TypeError, ValueError):
PR_NUMBER = None