Commit f302370d authored by colmoneill's avatar colmoneill

a postcss-css next plugin

parent ca7c04c3
{
"name": "osp.tools.osp-blog",
"version": "0.0.1",
"description": "osp blog npm needs",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "git@gitlab.constantvzw.org:osp/tools.osp-blog.www.git"
},
"author": "",
"license": "ISC",
"dependencies": {
"caniuse": "^0.1.3",
"caniuse-db": "^1.0.30000794",
"postcss": "^6.0.16",
"postcss-cli": "^4.1.1",
"postcss-cssnext": "^3.1.0"
}
}
......@@ -47,7 +47,7 @@ DIRECT_TEMPLATES = [
'index', 'tags', 'categories', 'authors', 'archives', 'search']
PLUGIN_PATHS = ['plugins']
PLUGINS = ['tipue_search', 'neighbors']
PLUGINS = ['tipue_search', 'neighbors', 'process_css']
TIPUE_SEARCH = True
......
import shlex
import subprocess
from pelican import signals, contents
from pelican.utils import get_date
from bs4 import BeautifulSoup
import random
def process_css(pelican):
path = str(pelican.settings['OUTPUT_PATH'] + '/theme/css/' + pelican.settings['CSS_FILE'])
cmd = "./node_modules/.bin/postcss --map --use postcss-cssnext --output {} {}".format(path, path)
call_params = shlex.split(cmd)
subprocess.call(call_params)
def register():
signals.finalized.connect(process_css)
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