Massive update to sync with the wp site
This commit is contained in:
parent
4a7c90f5bb
commit
ac7ca39956
75 changed files with 5381 additions and 105 deletions
|
|
@ -2,7 +2,7 @@ Compile [LESS](http://lesscss.org/) source files into CSS.
|
|||
|
||||
To use this plugin:
|
||||
|
||||
Create a ``less`` folder in your theme, put your ``.less`` files there, add a ``less/targets`` file listing the files you
|
||||
Create a `less` folder in your theme, put your `.less` files there, add a `less/targets` file listing the files you
|
||||
want compiled.
|
||||
|
||||
|
||||
Note: in some cases, you might have to run `nikola build` twice.
|
||||
|
|
|
|||
6
plugins/less/conf.py.sample
Normal file
6
plugins/less/conf.py.sample
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
# Compiler to process LESS files.
|
||||
LESS_COMPILER = 'lessc'
|
||||
|
||||
# A list of options to pass to the LESS compiler.
|
||||
# Final command is: LESS_COMPILER LESS_OPTIONS file.less
|
||||
LESS_OPTIONS = []
|
||||
|
|
@ -2,9 +2,11 @@
|
|||
Name = less
|
||||
Module = less
|
||||
|
||||
[Nikola]
|
||||
PluginCategory = Task
|
||||
|
||||
[Documentation]
|
||||
Author = Roberto Alsina
|
||||
Version = 0.1
|
||||
Website = http://plugins.getnikola.com/#less
|
||||
Description = Build CSS out of LESS sources
|
||||
|
||||
|
|
|
|||
|
|
@ -27,7 +27,6 @@
|
|||
from __future__ import unicode_literals
|
||||
|
||||
import codecs
|
||||
import glob
|
||||
import os
|
||||
import sys
|
||||
import subprocess
|
||||
|
|
@ -77,20 +76,19 @@ class BuildLess(Task):
|
|||
for theme_name in kw['themes']:
|
||||
src = os.path.join(utils.get_theme_path(theme_name), self.sources_folder)
|
||||
for task in utils.copy_tree(src, os.path.join(kw['cache_folder'], self.sources_folder)):
|
||||
if task['name'] in tasks:
|
||||
continue
|
||||
task['basename'] = 'prepare_less_sources'
|
||||
tasks[task['name']] = task
|
||||
yield task
|
||||
|
||||
# Build targets and write CSS files
|
||||
base_path = utils.get_theme_path(self.site.THEMES[0])
|
||||
dst_dir = os.path.join(self.site.config['OUTPUT_FOLDER'], 'assets', 'css')
|
||||
# Make everything depend on all sources, rough but enough
|
||||
deps = []
|
||||
if os.path.isfile(os.path.join(self.sources_folder, "targets")):
|
||||
deps += glob.glob(os.path.join(kw['cache_folder'], self.sources_folder,
|
||||
'*{0}'.format(self.sources_ext)))
|
||||
else:
|
||||
deps += glob.glob(os.path.join(base_path, self.sources_folder,
|
||||
'*{0}'.format(self.sources_ext)))
|
||||
for task in tasks.keys():
|
||||
if task.endswith(self.sources_ext):
|
||||
deps.append(task)
|
||||
|
||||
def compile_target(target, dst):
|
||||
utils.makedirs(dst_dir)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue