Revert "Remove SelectiveFileSystemFolder finder workaround" (#4533)
* Revert "Remove SelectiveFileSystemFolder finder workaround" * Remove `static` from selective finderhumitos/vcs/show-links
parent
f9965a1427
commit
a89d4c1186
|
@ -0,0 +1,18 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
from __future__ import division, print_function, unicode_literals
|
||||
|
||||
from django.contrib.staticfiles.finders import FileSystemFinder
|
||||
|
||||
|
||||
class SelectiveFileSystemFinder(FileSystemFinder):
|
||||
|
||||
"""
|
||||
Add user media paths in ``media/`` to ignore patterns.
|
||||
|
||||
This allows collectstatic inside ``media/`` without collecting all of the
|
||||
paths that include user files
|
||||
"""
|
||||
|
||||
def list(self, ignore_patterns):
|
||||
ignore_patterns.extend(['epub', 'pdf', 'htmlzip', 'json', 'man'])
|
||||
return super(SelectiveFileSystemFinder, self).list(ignore_patterns)
|
|
@ -176,6 +176,10 @@ class CommunityBaseSettings(Settings):
|
|||
os.path.join(SITE_ROOT, 'readthedocs', 'static'),
|
||||
os.path.join(SITE_ROOT, 'media'),
|
||||
]
|
||||
STATICFILES_FINDERS = [
|
||||
'readthedocs.core.static.SelectiveFileSystemFinder',
|
||||
'django.contrib.staticfiles.finders.AppDirectoriesFinder',
|
||||
]
|
||||
|
||||
TEMPLATES = [
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue