9e07efb2788e5570e76839ffd7ed377faac496e7
[wolnelektury.git] / src / wolnelektury / settings / static.py
1 # This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later.
2 # Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information.
3 #
4 from os import path
5 from .paths import VAR_DIR
6
7 # Absolute path to the directory that holds media.
8 # Example: "/home/media/media.lawrence.com/"
9 MEDIA_ROOT = path.join(VAR_DIR, 'media/')
10 STATIC_ROOT = path.join(VAR_DIR, 'static/')
11 SEARCH_INDEX = path.join(VAR_DIR, 'search_index/')
12
13 # URL that handles the media served from MEDIA_ROOT. Make sure to use a
14 # trailing slash if there is a path component (optional in other cases).
15 # Examples: "http://media.lawrence.com", "http://example.com/media/"
16 MEDIA_URL = '/media/'
17 STATIC_URL = '/static/'
18
19 IMAGE_DIR = 'book/pictures/'
20
21 # CSS and JavaScript file groups
22
23 PIPELINE = {
24     'STYLESHEETS': {
25         '2022': {
26             'source_filenames': [
27                 'contrib/jquery-ui-1.13.1.custom/jquery-ui.css',
28                 '2022/styles/main.scss',
29                 '2022/more.scss',
30                 'chunks/edit.scss',
31             ],
32             'output_filename': 'css/compressed/2022.css',
33         },
34         'main': {
35             # styles both for mobile and for big screen
36             'source_filenames': [
37                 'css/import/gelasio.css',
38
39                 'css/jquery.countdown.css',
40                 'jplayer/jplayer.blue.monday.css',
41
42                 'sponsors/css/sponsors.css',
43
44                 'annoy/banner.scss',
45
46                 'css/ui-lightness/jquery-ui-1.8.16.custom.css',
47
48                 'css/tlite.css',
49
50                 'scss/main.scss',
51                 'club/club.scss',
52             ],
53             'output_filename': 'css/compressed/main.css',
54         },
55         'book': {
56             'source_filenames': [
57                 'css/import/gelasio.css',
58                 'css/master.book.css',
59             ],
60             'output_filename': 'css/compressed/book.css',
61         },
62         'book_text': {
63             'source_filenames': [
64                 'css/import/gelasio.css',
65                 'scss/book_text.scss',
66                 'css/new.book.css',
67                 'annoy/banner.scss',
68                 'annoy/book_text.scss',
69
70                 'css/master.picture.css',
71             ],
72             'output_filename': 'css/compressed/book_text.css',
73         },
74         'forum': {
75             'source_filenames': [
76                 'scss/forum.scss',
77             ],
78             'output_filename': 'css/compressed/compressed/forum.css',
79         },
80         'picture': {
81             'source_filenames': [
82                 'css/import/gelasio.css',
83                 'css/master.book.css',
84                 'css/master.picture.css',
85             ],
86             'output_filename': 'css/compressed/picture.css',
87         },
88         'player': {
89             'source_filenames': [
90                 'jplayer/jplayer.blue.monday.css',
91                 'player/player.css',
92             ],
93             'output_filename': 'css/compressed/player.css',
94         },
95         'simple': {
96             'source_filenames': ('css/simple.css',),
97             'output_filename': 'css/compressed/simple.css',
98         },
99         'widget': {
100             'source_filenames': ('scss/widget.scss',),
101             'output_filename': 'css/compressed/widget.css',
102         },
103     },
104     'JAVASCRIPT': {
105         'base': {
106             'source_filenames': (
107                 'js/contrib/jquery.cycle2.min.js',
108                 'js/contrib/jquery.jqmodal.js',
109                 'js/contrib/jquery.form.js',
110                 'js/contrib/jquery.paging.min.js',
111                 'js/contrib/jquery.countdown.js', 'js/contrib/jquery.countdown-pl.js',
112                 'js/contrib/jquery.countdown-de.js', 'js/contrib/jquery.countdown-uk.js',
113                 'js/contrib/jquery.countdown-es.js', 'js/contrib/jquery.countdown-lt.js',
114                 'js/contrib/jquery.countdown-ru.js', 'js/contrib/jquery.countdown-fr.js',
115                 'js/contrib/jquery.shorten.js',
116
117                 'js/contrib/jquery-ui-1.8.16.custom.min.js',
118
119                 'js/contrib/tlite.min.js',
120
121                 'jplayer/jquery.jplayer.min.js',
122                 'jplayer/jplayer.playlist.min.js',
123                 'player/player.js',
124
125                 'js/locale.js',
126                 'js/dialogs.js',
127                 'js/base.js',
128                 'pdcounter/pdcounter.js',
129                 'sponsors/js/sponsors.js',
130                 'player/openplayer.js',
131                 'js/search.js',
132                 'funding/funding.js',
133                 'club/form.js',
134
135                 'annoy/banner.js',
136                 ),
137             'output_filename': 'js/base.min.js',
138         },
139         '2022': {
140             'source_filenames': [
141                 'contrib/jquery-ui-1.13.1.custom/jquery-ui.js',
142                 'js/search.js',
143                 'js/2022.js',
144                 '2022/book/filter.js',
145                 'chunks/edit.js',
146
147                 'js/contrib/jquery.countdown.js', 'js/contrib/jquery.countdown-pl.js',
148                 'js/contrib/jquery.countdown-de.js', 'js/contrib/jquery.countdown-uk.js',
149                 'js/contrib/jquery.countdown-es.js', 'js/contrib/jquery.countdown-lt.js',
150                 'js/contrib/jquery.countdown-ru.js', 'js/contrib/jquery.countdown-fr.js',
151                 'pdcounter/pdcounter.js',
152
153             ],
154             'output_filename': 'js/2022.min.js'
155         },
156         'player': {
157             'source_filenames': [
158                 'jplayer/jquery.jplayer.min.js',
159                 'jplayer/jplayer.playlist.min.js',
160                 'player/player.js',
161             ],
162             'output_filename': 'js/player.min.js',
163         },
164         '2022_player': {
165             'source_filenames': [
166                 'js/contrib/jplayer/jquery.jplayer.min.js',
167                 'js/contrib/jplayer/jplayer.playlist.min.js',
168                 'player/2022_player.js',
169             ],
170             'output_filename': 'js/2022_player.min.js',
171         },
172         'book': {
173             'source_filenames': [
174                 'js/contrib/jquery.eventdelegation.js',
175                 'js/contrib/jquery.scrollto.js',
176                 'js/contrib/jquery.highlightfade.js',
177                 'js/book_text/other.js',
178                 'js/book.js',
179
180                 'js/contrib/raphael-min.js',
181                 'js/contrib/progressSpin.min.js',
182                 'js/picture.js',
183             ],
184             'output_filename': 'js/book.min.js',
185         },
186         'book_text': {
187             'source_filenames': [
188                 'js/contrib/jquery.cycle2.min.js',
189                 'js/contrib/jquery.form.js',
190                 'js/contrib/jquery.jqmodal.js',
191                 'js/book_text/info.js',
192                 'js/book_text/menu.js',
193                 'js/book_text/note.js',
194                 'js/book_text/references.js',
195                 'js/book_text/settings.js',
196                 'js/book_text/toc.js',
197                 'js/locale.js',
198                 'js/dialogs.js',
199                 'annoy/book_text.js',
200
201                 'js/contrib/jquery.highlightfade.js',
202                 'js/contrib/raphael-min.js',
203                 'player/openplayer.js',
204                 'js/contrib/progressSpin.min.js',
205                 'annoy/banner.js',
206             ],
207             'output_filename': 'js/book_text.js',
208         },
209         'picture': {
210             'source_filenames': [
211                 'js/picture.js',
212             ],
213             'output_filename': 'js/picture.min.js',
214         },
215         'book_ie': {
216             'source_filenames': ('js/contrib/ierange-m2.js',),
217             'output_filename': 'js/book_ie.min.js',
218         },
219         'widget': {
220             'source_filenames': (
221                 'js/contrib/jquery.js',
222                 'js/contrib/jquery-ui-1.8.16.custom.min.js',
223                 'js/search.js',
224                 'js/widget_run.js',
225             ),
226             'output_filename': 'js/widget.min.js',
227         },
228     },
229     'CSS_COMPRESSOR': None,
230     'JS_COMPRESSOR': 'pipeline.compressors.jsmin.JSMinCompressor',
231     'COMPILERS': (
232         'libsasscompiler.LibSassCompiler',
233     )
234 }
235
236 STATICFILES_STORAGE = 'fnpdjango.pipeline_storage.GzipPipelineManifestStorage'
237
238 # PIPELINE_PYSCSS_BINARY = '/usr/bin/env pyscss'
239 # PIPELINE_PYSCSS_ARGUMENTS = ''
240
241
242 STATICFILES_FINDERS = [
243     'django.contrib.staticfiles.finders.FileSystemFinder',
244     'django.contrib.staticfiles.finders.AppDirectoriesFinder',
245     'pipeline.finders.CachedFileFinder',
246     'pipeline.finders.PipelineFinder',
247 ]