changed setting to specify embed asset path instead of override

parent a358bf47
......@@ -195,15 +195,15 @@ You can override these rules using the following settings:
Setting that controls the maximum image size (in bytes) to embed in CSS using Data-URIs.
Internet Explorer 8 has issues with assets under 32 kilobytes.
Defaults to ``32700``
``PIPELINE_EMBED_ALL_IMAGES``
``PIPELINE_EMBED_PATH``
..........................
Setting that controls whether or not an asset needs to be in a directory named "**embed**" in
order to be embedded.
Setting the directory that an asset needs to be in so that it is embedded
Defaults to ``False``
Defaults to ``r'[/]?embed/'``
Rewriting CSS urls
......
......@@ -16,7 +16,6 @@ from pipeline.conf import settings
from pipeline.utils import to_class, relpath
from pipeline.storage import default_storage
EMBEDDABLE = r'[/]?embed/'
URL_DETECTOR = r'url\([\'"]?([^\s)]+\.[a-z]+[\?\#\d\w]*)[\'"]?\)'
URL_REPLACER = r'url\(__EMBED__(.+?)(\?\d+)?\)'
......@@ -158,8 +157,7 @@ class Compressor(object):
if not variant:
return False
if not ((settings.PIPELINE_EMBED_ALL_IMAGES or re.search(EMBEDDABLE, path)) and \
self.storage.exists(path)):
if not (re.search(settings.PIPELINE_EMBED_PATH, path) and self.storage.exists(path)):
return False
if not ext in EMBED_EXTS:
return False
......
......@@ -56,7 +56,7 @@ PIPELINE_MIMETYPES = getattr(settings, 'PIPELINE_MIMETYPES', (
))
PIPELINE_EMBED_MAX_IMAGE_SIZE = getattr(settings, 'PIPELINE_EMBED_MAX_IMAGE_SIZE', 32700)
PIPELINE_EMBED_ALL_IMAGES = getattr(settings, 'PIPELINE_EMBED_ALL_IMAGES', False)
PIPELINE_EMBED_PATH = getattr(settings, 'PIPELINE_EMBED_PATH', r'[/]?embed/')
if PIPELINE_COMPILERS is None:
PIPELINE_COMPILERS = []
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment