Browse Source

Update to new assets and fix deprecation warning

tags/20190102
Sam Black 1 year ago
parent
commit
b4da6ca50a
Signed by: samwwwblack GPG Key ID: 0FF0223994EA47D8
1 changed files with 4 additions and 4 deletions
  1. +4
    -4
      build.py

+ 4
- 4
build.py View File

@@ -25,7 +25,6 @@ import subprocess
import time

import click
import staticjinja
import webassets

from datetime import datetime
@@ -33,6 +32,7 @@ from http.server import HTTPServer
from http.server import SimpleHTTPRequestHandler
from multiprocessing import Lock
from multiprocessing import Process
from staticjinja import Site
from webassets.ext.jinja2 import AssetsExtension

logger = logging.getLogger(__name__)
@@ -90,14 +90,14 @@ def generate_assets(assets_path, output_path, debug=False):
# Javascript
js_lapwing = webassets.Bundle("uikit/uikit.js",
"website/js/faconfig.js", # This must be before fontawesome.js
"fontawesome/js/fontawesome-all.js",
"fontawesome/js/all.js",
filters="uglifyjs",
output="js/lapwing.%(version)s.js")
webasset_env.register("js_lapwing", js_lapwing)

# SCSS -> CSS
css_lapwing = webassets.Bundle("website/scss/lapwing.scss",
"fontawesome/css/fa-svg-with-js.css",
"fontawesome/css/svg-with-js.css",
filters="libsass,cssutils",
output="css/lapwing.%(version)s.css")
webasset_env.register("css_lapwing", css_lapwing)
@@ -216,7 +216,7 @@ def build_website(minimize=False, lock=None):
env_globals["datestamp_{}".format(datestamp)] = git_date_stamp(
datestamp_file)

renderer = staticjinja.make_site(config["templates"], config["output"],
renderer = Site.make_site(config["templates"], config["output"],
extensions=[AssetsExtension])
# We need to add webassets and globals to the Jinja Environment
renderer._env.assets_environment = webassets_env


Loading…
Cancel
Save