Simple lektor sass plugin
- Using python's libsass to compile the final CSS Closes #4
This commit is contained in:
parent
6ceae7c22c
commit
cba44a38fc
11 changed files with 216 additions and 5519 deletions
22
packages/sassify/lektor_sassify.py
Normal file
22
packages/sassify/lektor_sassify.py
Normal file
|
@ -0,0 +1,22 @@
|
|||
import sass
|
||||
from lektor.pluginsystem import Plugin
|
||||
from werkzeug.utils import cached_property
|
||||
|
||||
|
||||
class SassifyPlugin(Plugin):
|
||||
name = "Sassify"
|
||||
description = "Sassify"
|
||||
|
||||
def on_before_build_all(self, builder, **extra):
|
||||
sass.compile(
|
||||
dirname=(
|
||||
self.config["sassify"]["src_path"],
|
||||
self.config["sassify"]["dest_path"],
|
||||
),
|
||||
output_style="compressed",
|
||||
)
|
||||
|
||||
@cached_property
|
||||
def config(self):
|
||||
conf = self.get_config()
|
||||
return {section: conf.section_as_dict(section) for section in conf.sections()}
|
14
packages/sassify/setup.py
Normal file
14
packages/sassify/setup.py
Normal file
|
@ -0,0 +1,14 @@
|
|||
from setuptools import setup
|
||||
|
||||
|
||||
setup(
|
||||
name="lektor-sassify",
|
||||
version="0.1",
|
||||
py_modules=["lektor_sassify"],
|
||||
entry_points={
|
||||
"lektor.plugins": [
|
||||
"sassify = lektor_sassify:SassifyPlugin",
|
||||
]
|
||||
},
|
||||
install_requires=["libsass==0.20.1"],
|
||||
)
|
Loading…
Add table
Add a link
Reference in a new issue