179467d9cb061f39bc1c99df0194e1147107f25f
[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                 'css/jquery.countdown.css',
29                 '2022/styles/main.scss',
30                 '2022/more.scss',
31                 'chunks/edit.scss',
32             ],
33             'output_filename': 'css/compressed/2022.css',
34         },
35         'main': {
36             # styles both for mobile and for big screen
37             'source_filenames': [
38                 'css/import/gelasio.css',
39
40                 'css/jquery.countdown.css',
41                 'jplayer/jplayer.blue.monday.css',
42
43                 'sponsors/css/sponsors.css',
44
45                 'annoy/banner.scss',
46
47                 'css/ui-lightness/jquery-ui-1.8.16.custom.css',
48
49                 'css/tlite.css',
50
51                 'scss/main.scss',
52                 'club/club.scss',
53             ],
54             'output_filename': 'css/compressed/main.css',
55         },
56         'book': {
57             'source_filenames': [
58                 'css/import/gelasio.css',
59                 'css/master.book.css',
60             ],
61             'output_filename': 'css/compressed/book.css',
62         },
63         'book_text': {
64             'source_filenames': [
65                 'css/import/gelasio.css',
66                 'scss/book_text.scss',
67                 'css/new.book.css',
68                 'annoy/banner.scss',
69                 'annoy/book_text.scss',
70                 '2022/styles/reader_player.scss',
71
72                 'css/master.picture.css',
73             ],
74             'output_filename': 'css/compressed/book_text.css',
75         },
76         'forum': {
77             'source_filenames': [
78                 'scss/forum.scss',
79             ],
80             'output_filename': 'css/compressed/compressed/forum.css',
81         },
82         'picture': {
83             'source_filenames': [
84                 'css/import/gelasio.css',
85                 'css/master.book.css',
86                 'css/master.picture.css',
87             ],
88             'output_filename': 'css/compressed/picture.css',
89         },
90         'player': {
91             'source_filenames': [
92                 'jplayer/jplayer.blue.monday.css',
93                 'player/player.css',
94             ],
95             'output_filename': 'css/compressed/player.css',
96         },
97         'simple': {
98             'source_filenames': ('css/simple.css',),
99             'output_filename': 'css/compressed/simple.css',
100         },
101         'widget': {
102             'source_filenames': ('scss/widget.scss',),
103             'output_filename': 'css/compressed/widget.css',
104         },
105     },
106     'JAVASCRIPT': {
107         'base': {
108             'source_filenames': (
109                 'js/contrib/jquery.cycle2.min.js',
110                 'js/contrib/jquery.jqmodal.js',
111                 'js/contrib/jquery.form.js',
112                 'js/contrib/jquery.paging.min.js',
113                 'js/contrib/jquery.countdown.js', 'js/contrib/jquery.countdown-pl.js',
114                 'js/contrib/jquery.countdown-de.js', 'js/contrib/jquery.countdown-uk.js',
115                 'js/contrib/jquery.countdown-es.js', 'js/contrib/jquery.countdown-lt.js',
116                 'js/contrib/jquery.countdown-ru.js', 'js/contrib/jquery.countdown-fr.js',
117                 'js/contrib/jquery.shorten.js',
118
119                 'js/contrib/jquery-ui-1.8.16.custom.min.js',
120
121                 'js/contrib/tlite.min.js',
122
123                 'jplayer/jquery.jplayer.min.js',
124                 'jplayer/jplayer.playlist.min.js',
125                 'player/player.js',
126
127                 'js/locale.js',
128                 'js/dialogs.js',
129                 'js/base.js',
130                 'pdcounter/pdcounter.js',
131                 'sponsors/js/sponsors.js',
132                 'player/openplayer.js',
133                 'js/search.js',
134                 'funding/funding.js',
135                 'club/form.js',
136
137                 'annoy/banner.js',
138                 ),
139             'output_filename': 'js/base.min.js',
140         },
141         '2022': {
142             'source_filenames': [
143                 '2022/scripts/vendor.js',
144                 'contrib/jquery-ui-1.13.1.custom/jquery-ui.js',
145                 'js/search.js',
146                 'js/2022.js',
147                 '2022/book/filter.js',
148                 'chunks/edit.js',
149                 '2022/scripts/modernizr.js',
150                 '2021/scripts/main.js',
151
152                 'js/contrib/jquery.cycle2.min.js',
153                 'sponsors/js/sponsors.js',
154
155                 'js/contrib/jquery.countdown.js', 'js/contrib/jquery.countdown-pl.js',
156                 'js/contrib/jquery.countdown-de.js', 'js/contrib/jquery.countdown-uk.js',
157                 'js/contrib/jquery.countdown-es.js', 'js/contrib/jquery.countdown-lt.js',
158                 'js/contrib/jquery.countdown-ru.js', 'js/contrib/jquery.countdown-fr.js',
159                 'pdcounter/pdcounter.js',
160
161             ],
162             'output_filename': 'js/2022.min.js'
163         },
164         'player': {
165             'source_filenames': [
166                 'jplayer/jquery.jplayer.min.js',
167                 'jplayer/jplayer.playlist.min.js',
168                 'player/player.js',
169             ],
170             'output_filename': 'js/player.min.js',
171         },
172         '2022_player': {
173             'source_filenames': [
174                 'js/contrib/jplayer/jquery.jplayer.min.js',
175                 'js/contrib/jplayer/jplayer.playlist.min.js',
176                 'player/2022_player.js',
177             ],
178             'output_filename': 'js/2022_player.min.js',
179         },
180         'book': {
181             'source_filenames': [
182                 'js/contrib/jquery.eventdelegation.js',
183                 'js/contrib/jquery.scrollto.js',
184                 'js/contrib/jquery.highlightfade.js',
185                 'js/book_text/other.js',
186                 'js/book.js',
187
188                 'js/contrib/raphael-min.js',
189                 'js/contrib/progressSpin.min.js',
190                 'js/picture.js',
191             ],
192             'output_filename': 'js/book.min.js',
193         },
194         'book_text': {
195             'source_filenames': [
196                 'js/contrib/jquery.cycle2.min.js',
197                 'js/contrib/jquery.form.js',
198                 'js/contrib/jquery.jqmodal.js',
199                 'js/book_text/info.js',
200                 'js/book_text/menu.js',
201                 'js/book_text/note.js',
202                 'js/book_text/references.js',
203                 'js/book_text/settings.js',
204                 'js/book_text/toc.js',
205                 'js/locale.js',
206                 'js/dialogs.js',
207                 'annoy/book_text.js',
208
209                 'js/contrib/jquery.highlightfade.js',
210                 'js/contrib/raphael-min.js',
211                 'player/openplayer.js',
212                 'js/contrib/progressSpin.min.js',
213                 'annoy/banner.js',
214             ],
215             'output_filename': 'js/book_text.js',
216         },
217         'picture': {
218             'source_filenames': [
219                 'js/picture.js',
220             ],
221             'output_filename': 'js/picture.min.js',
222         },
223         'book_ie': {
224             'source_filenames': ('js/contrib/ierange-m2.js',),
225             'output_filename': 'js/book_ie.min.js',
226         },
227         'widget': {
228             'source_filenames': (
229                 'js/contrib/jquery.js',
230                 'js/contrib/jquery-ui-1.8.16.custom.min.js',
231                 'js/search.js',
232                 'js/widget_run.js',
233             ),
234             'output_filename': 'js/widget.min.js',
235         },
236     },
237     'CSS_COMPRESSOR': None,
238     'JS_COMPRESSOR': 'pipeline.compressors.jsmin.JSMinCompressor',
239     'COMPILERS': (
240         'libsasscompiler.LibSassCompiler',
241     )
242 }
243
244 STATICFILES_STORAGE = 'fnpdjango.pipeline_storage.GzipPipelineManifestStorage'
245
246 # PIPELINE_PYSCSS_BINARY = '/usr/bin/env pyscss'
247 # PIPELINE_PYSCSS_ARGUMENTS = ''
248
249
250 STATICFILES_FINDERS = [
251     'django.contrib.staticfiles.finders.FileSystemFinder',
252     'django.contrib.staticfiles.finders.AppDirectoriesFinder',
253     'pipeline.finders.CachedFileFinder',
254     'pipeline.finders.PipelineFinder',
255 ]