-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathpelicanconf.py
More file actions
191 lines (159 loc) · 5.71 KB
/
pelicanconf.py
File metadata and controls
191 lines (159 loc) · 5.71 KB
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
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
#!/usr/bin/env python
# -*- coding: utf-8 -*- #
from __future__ import unicode_literals
"""
All the variables listed in this file are available to the HTML template files
using Jinja2 syntax.
"""
from datetime import timedelta
def Yesterday(time):
return time - datetime.timedelta(1)
#from jinja2 import Environment
#env = Environment()
#env.globals['Yesterday'] = Yesterday
#Environment.filters['Yesterday'] = Yesterday
# File Locations
# ----------------------------------------
# Where to find content files (markdown, html, ...):
PATH = "content"
# Files under PATH to copy *without* parsing the content:
# 'pages/' is the only exception that the html and md files will still be parsed
STATIC_PATHS = ['images', 'pdfs', 'media', 'pages']
# Where to find theme files (css):
THEME = 'theme'
# Where to find plugins:
PLUGIN_PATHS = ['plugins']
ARTICLE_PATHS = ['articles']
PAGE_PATHS = ['']
# Where to save the website after building:
OUTPUT_PATH = 'build'
# Site-wide Configuration
# ----------------------------------------
# Metadata
SITENAME = "UC Davis Data Science Initiative" # configure at publishconf.py
SITEURL = "" # configure at publishconf.py
AUTHOR = "UC Davis DSI" # default author
DEFAULT_LANG = "en"
# Time
DEFAULT_DATE = 'fs'
CHECK_MODIFIED_METHOD = 'mtime'
#DEFAULT_DATE_FORMAT = '%a %b %d %I:%M%p %Y'
DEFAULT_DATE_FORMAT = '%a %b %d'
TIMEZONE = 'America/Los_Angeles'
# 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
RELATIVE_URLS = True # development view
BOOTSTRAP_THEME = "flatly" # Pelican themes
HIDE_SIDEBAR = True
HIDE_SITENAME = True
DISPLAY_RECENT_POSTS_ON_SIDEBAR = False
# Site-wide Content
# ----------------------------------------
# Icon for browser tabs
FAVICON = "images/favicon.ico"
# DO NOT REMOVE THIS, this tells which template html should be generated
# as part of build/
DIRECT_TEMPLATES = ('index', 'categories', 'archives', 'search', 'jobs', 'filemap')
# PLUGINS
# ----------------------------------------
PLUGINS = ["tipue_search", "render_math"]
MATH_JAX = {'process_escapes': True}
# Page/Article Configuration
# ----------------------------------------
# Parse file metadata from the file name of the article / page files
# See Python Group regex syntax for the below pattern grabs the groups
FILENAME_METADATA = '(?P<tags>.*)_(?P<slug>.*)..*'
# Index of all article posts
INDEX_SAVE_AS = 'announcements.html'
# How many posts to show on the index page
DEFAULT_PAGINATION = 8
# ARTICLE / EVENT POST SETTINGS
ARTICLE_SAVE_AS = 'posts/{tags[0]}/{slug}{date:%Y%m%d}.html'
ARTICLE_URL = 'posts/{tags[0]}/{slug}{date:%Y%m%d}.html'
USE_FOLDER_AS_CATEGORY = True
SHOW_ARTICLE_CATEGORY = False
SHOW_ARTICLE_AUTHOR = False
SHOW_DATE_MODIFIED = False
# Page settings
PATH_METADATA = '(?P<path_no_ext>.*)\..*'
PAGE_SAVE_AS = '{path_no_ext}.html'
PAGE_URL = '{path_no_ext}.html'
# Home Page Options
# ----------------------------------------
BANNER = 'images/dsi_banner.png' # the image for main homepage banner
RECENT_POST_COUNT = 20 # number of posts displayed on homepage banner
# The tags displayed in the `News` columns on the homepage
# APriority is to put this first alphabetically.
EVENTS_TAGS = ['APriority', 'CFP', 'Job', 'Workshop', 'Bootcamp', 'Talk', 'Symposium', 'Seminar', 'OfficeHours', 'Recent', 'WorkingGroup', 'Coffee Hour']
NEWS_CATEGORIES = ['CFP', 'News']
OPPORTUNITIES_TAGS = ['Job']
RESOURCES_TAGS = ['OfficeHours', 'CFP']
# Menu Bar Options
# ----------------------------------------
SITELOGO = 'images/dsi_brand_logo.png'
SITELOGO_SIZE = 75 # width of icon
DISPLAY_PAGES_ON_MENU = False
DISPLAY_CATEGORIES_ON_MENU = False
# We control all the menu items via a list
MENUITEMS = [
('About', [
('Mission', 'mission.html'),
('Membership', 'membership.html'),
('Mailing List', 'signup.html'),
('Giving', 'giving.html'),
('FAQ', 'faq.html'),
('Space', 'space.html'),
('Directions', 'directions.html'),
('Contact Us', 'mailto:datascience@ucdavis.edu')
]),
('Research', [
('Services', 'services.html'),
('Office Hours', 'office_hours.html'),
('Collaboration', 'collaboration.html'),
('Software Development', 'software.html'),
('Github Repos.', 'https://github.com/dsidavis')
]),
('Events', [
('Announcements', 'category/recent.html'),
('Workshops/Training', 'workshops.html'),
('Calendar', 'calendar.html'),
('Past Events', 'category/past.html'),
('Categories', 'categories.html')
]),
# ('News', ''),
('People', [
('Administration', 'administration.html'),
('Faculty', 'facultyaffiliates.html'),
('Affiliates', 'affiliates.html'),
]),
('Resources', [
('Jobs', 'jobs.html'),
('Courses', 'courses.html'),
('Tutorials', 'tag/tutorial.html'),
('Technologies', 'technologies.html'),
('Related Links', 'related_links.html'),
]),
]
SOCIAL = () # menu bar buttons
# ARTICLE GLYPHICONS, they come by default with bootstrap flatly theme
GLYPHICON = {
# Categories
"OfficeHours": "glyphicon glyphicon-comment",
"Jobs": "glyphicon glyphicon-briefcase",
# Tags - Working Groups
"Study Group": "glyphicon glyphicon-book",
"Working Group": "glyphicon glyphicon-wrench",
# Tags - Events
"Bootcamp": "glyphicon glyphicon-education",
"Workshop": "glyphicon glyphicon-education",
"unSeminar": "glyphicon glyphicon-comment",
"Symposium": "glyphicon glyphicon-blackboard",
"Talk": "glyphicon glyphicon-blackboard",
# Tags - Other
"News": "glyphicon glyphicon-bullhorn",
"CFP": "glyphicon glyphicon-comment"
}