Massive update to sync with the wp site

This commit is contained in:
Don Harper 2019-05-20 16:48:56 -05:00
parent 4a7c90f5bb
commit ac7ca39956
75 changed files with 5381 additions and 105 deletions

View file

@ -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.

View 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 = []

View file

@ -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

View file

@ -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)

View file

@ -2,7 +2,7 @@ Compile [SASS](http://sass-lang.com/) source files into CSS.
To use this plugin:
Create a ``sass`` folder in your theme, put your ``.scss`` files there, add a ``sass/targets`` file listing the files you
Create a `sass` folder in your theme, put your `.scss` files there, add a `sass/targets` file listing the files you
want compiled.
Note: in some cases, you might have to run `nikola build` twice.

View file

@ -0,0 +1,6 @@
# Compiler to process Sass files.
SASS_COMPILER = 'sass'
# A list of options to pass to the Sass compiler.
# Final command is: SASS_COMPILER SASS_OPTIONS file.s(a|c)ss
SASS_OPTIONS = []

View file

@ -2,6 +2,9 @@
Name = sass
Module = sass
[Nikola]
PluginCategory = Task
[Documentation]
Author = Roberto Alsina, Chris Warrick
Version = 0.1

View file

@ -27,7 +27,6 @@
from __future__ import unicode_literals
import codecs
import glob
import os
import sys
import subprocess
@ -45,7 +44,7 @@ class BuildSass(Task):
def gen_tasks(self):
"""Generate CSS out of Sass sources."""
self.logger = utils.get_logger('build_sass', self.site.loghandlers)
self.logger = utils.get_logger('build_sass', utils.STDERR_HANDLER)
self.compiler_name = self.site.config['SASS_COMPILER']
self.compiler_options = self.site.config['SASS_OPTIONS']
@ -85,17 +84,13 @@ class BuildSass(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 = []
for ext in self.sources_ext:
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(ext)))
else:
deps += glob.glob(os.path.join(base_path, self.sources_folder,
'*{0}'.format(ext)))
for task in tasks.keys():
for ext in self.sources_ext:
if task.endswith(ext):
deps.append(task)
def compile_target(target, dst):
utils.makedirs(dst_dir)