Skip to content
This repository has been archived by the owner on Sep 11, 2020. It is now read-only.

frascoweb/frasco-assets

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Frasco-Assets

Assets manager for Frasco using webassets, Flask-Assets and easywebassets.

Installation

pip install frasco-assets

Setup

Feature name: assets

Options of this feature are the same as webassets options.

Defining assets packages

You can create assets packages (using easywebassets) by defining them under the ASSETS configuration key. This must be a hash where keys are package names and values a list of assets.

features:
  - assets
assets:
  jquery:
    - vendor/jquery.js
  default:
    - css/layout.css
    - js/app.js

Current assets

Frasco-Assets maintain a default package available through frasco_assets.current_assets. If you define a default package in your configuration, it will be automatically added to the current assets.

from frasco_assets import current_assets
current_assets.append('@jquery')

## Rendering assets

You can use the assets directive in your Jinja templates to render assets. Without any arguments, this will render the current assets.

You can also use this directive to create packages on the fly.

{% assets 'css/home.css', '@jquery' %}

Commands

Webassets command are available through the assets command.

$ frasco assets build
$ frasco assets watch
$ frasco assets clean
$ frasco assets check

Releases

No releases published

Packages

No packages published