584d71e16ab743bbeea75e627d5f9cfb6f81bc5b
[wolnelektury.git] / src / wolnelektury / settings / static.py
1 # This file is part of Wolne Lektury, licensed under GNU Affero GPLv3 or later.
2 # Copyright © Fundacja Wolne Lektury. 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
12 # URL that handles the media served from MEDIA_ROOT. Make sure to use a
13 # trailing slash if there is a path component (optional in other cases).
14 # Examples: "http://media.lawrence.com", "http://example.com/media/"
15 MEDIA_URL = '/media/'
16 STATIC_URL = '/static/'
17
18 IMAGE_DIR = 'book/pictures/'
19
20 # CSS and JavaScript file groups
21
22 PIPELINE = {
23     'STYLESHEETS': {
24         'main': {
25             'source_filenames': [
26                 'contrib/jquery-ui-1.13.1.custom/jquery-ui.css',
27                 'css/jquery.countdown.css',
28
29                 '2022/styles/main.scss',
30                 '2022/more.scss',
31                 'chunks/edit.scss',
32             ],
33             'output_filename': 'css/compressed/main.css',
34         },
35         'book_text': {
36             'source_filenames': [
37                 'css/import/gelasio.css',
38                 'scss/book_text.scss',
39                 'css/new.book.css',
40                 'annoy/banner.scss',
41                 'annoy/book_text.scss',
42                 '2022/styles/reader_player.scss',
43
44                 'css/master.picture.css',
45             ],
46             'output_filename': 'css/compressed/book_text.css',
47         },
48         'widget': {
49             'source_filenames': ('scss/widget.scss',),
50             'output_filename': 'css/compressed/widget.css',
51         },
52     },
53     'JAVASCRIPT': {
54         'main': {
55             'source_filenames': [
56                 '2022/scripts/vendor.js',
57                 'contrib/jquery-ui-1.13.1.custom/jquery-ui.js',
58
59                 'js/search.js',
60                 'js/header.js',
61                 'book/filter.js',
62                 'chunks/edit.js',
63                 '2022/scripts/modernizr.js',
64                 'js/main.js',
65
66                 'js/contrib/jquery.cycle2.min.js',
67                 'sponsors/js/sponsors.js',
68                 'annoy/banner.js',
69
70                 'js/contrib/jquery.countdown.js', 'js/contrib/jquery.countdown-pl.js',
71                 'js/contrib/jquery.countdown-de.js', 'js/contrib/jquery.countdown-uk.js',
72                 'js/contrib/jquery.countdown-es.js', 'js/contrib/jquery.countdown-lt.js',
73                 'js/contrib/jquery.countdown-ru.js', 'js/contrib/jquery.countdown-fr.js',
74                 'pdcounter/pdcounter.js',
75
76             ],
77             'output_filename': 'js/compressed/main.min.js'
78         },
79         'player': {
80             'source_filenames': [
81                 'js/contrib/jplayer/jquery.jplayer.min.js',
82                 'js/contrib/jplayer/jplayer.playlist.min.js',
83                 'player/player.js',
84             ],
85             'output_filename': 'js/compressed/player.min.js',
86         },
87         'book_text': {
88             'source_filenames': [
89                 'js/contrib/jquery.form.js',
90                 'js/contrib/jquery.jqmodal.js',
91                 'js/book_text/info.js',
92                 'js/book_text/menu.js',
93                 'js/book_text/note.js',
94                 'js/book_text/references.js',
95                 'js/book_text/settings.js',
96                 'js/book_text/toc.js',
97                 'js/locale.js',
98                 'js/dialogs.js',
99                 'annoy/book_text.js',
100
101                 'js/contrib/jquery.highlightfade.js',
102                 'js/contrib/raphael-min.js',
103                 'js/contrib/progressSpin.min.js',
104                 'annoy/banner.js',
105             ],
106             'output_filename': 'js/book_text.js',
107         },
108         'widget': {
109             'source_filenames': (
110                 'js/contrib/jquery.js',
111                 'js/contrib/jquery-ui-1.8.16.custom.min.js',
112                 'js/search.js',
113                 'js/widget_run.js',
114             ),
115             'output_filename': 'js/widget.min.js',
116         },
117     },
118     'CSS_COMPRESSOR': None,
119     'JS_COMPRESSOR': 'pipeline.compressors.jsmin.JSMinCompressor',
120     'COMPILERS': (
121         'libsasscompiler.LibSassCompiler',
122     )
123 }
124
125 STATICFILES_STORAGE = 'fnpdjango.pipeline_storage.GzipPipelineManifestStorage'
126
127 # PIPELINE_PYSCSS_BINARY = '/usr/bin/env pyscss'
128 # PIPELINE_PYSCSS_ARGUMENTS = ''
129
130
131 STATICFILES_FINDERS = [
132     'django.contrib.staticfiles.finders.FileSystemFinder',
133     'django.contrib.staticfiles.finders.AppDirectoriesFinder',
134     'pipeline.finders.CachedFileFinder',
135     'pipeline.finders.PipelineFinder',
136 ]