mirror of
https://github.com/getpelican/pelican.git
synced 2025-10-15 20:28:56 +02:00
Remove redundant LESS_COMPILER setting
This commit is contained in:
parent
2b93d6d855
commit
f558389006
5 changed files with 11 additions and 8 deletions
|
|
@ -134,7 +134,7 @@ class Pelican(object):
|
|||
generators = [ArticlesGenerator, PagesGenerator, StaticGenerator]
|
||||
if self.settings['PDF_GENERATOR']:
|
||||
generators.append(PdfGenerator)
|
||||
if self.settings['LESS_GENERATOR']:
|
||||
if self.settings['LESS_GENERATOR']: # can be True or PATH to lessc
|
||||
generators.append(LessCSSGenerator)
|
||||
return generators
|
||||
|
||||
|
|
|
|||
|
|
@ -418,7 +418,7 @@ class PdfGenerator(Generator):
|
|||
|
||||
|
||||
class LessCSSGenerator(Generator):
|
||||
"""Compile less css files. This assumes we have `lessc` in our PATH."""
|
||||
"""Compile less css files."""
|
||||
|
||||
def _compile(self, less_file, source_dir, dest_dir):
|
||||
base = os.path.relpath(less_file, source_dir)
|
||||
|
|
@ -433,13 +433,18 @@ class LessCSSGenerator(Generator):
|
|||
logger.error("Couldn't create the pdf output folder in " +
|
||||
target_dir)
|
||||
|
||||
cmd = ' '.join([self.settings['LESS_COMPILER'], less_file, target])
|
||||
cmd = ' '.join([self._lessc, less_file, target])
|
||||
subprocess.call(cmd, shell=True)
|
||||
logger.info(u' [ok] compiled %s' % base)
|
||||
|
||||
def generate_output(self, writer=None):
|
||||
logger.info(u' Compiling less css')
|
||||
|
||||
# store out compiler here, so it won't be evaulted on each run of
|
||||
# _compile
|
||||
lg = self.settings['LESS_GENERATOR']
|
||||
self._lessc = lg if isinstance(lg, basestring) else 'lessc'
|
||||
|
||||
# walk static paths
|
||||
for static_path in self.settings['STATIC_PATHS']:
|
||||
for f in self.get_files(
|
||||
|
|
|
|||
|
|
@ -68,7 +68,6 @@ _DEFAULT_CONFIG = {'PATH': '.',
|
|||
'ARTICLE_PERMALINK_STRUCTURE': '',
|
||||
'TYPOGRIFY': False,
|
||||
'LESS_GENERATOR': False,
|
||||
'LESS_COMPILER': '/usr/bin/lessc',
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue