npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

static-jade-brunch

v2.7.0

Published

Adds Jade support to Brunch, without wrapping the compiled HTML into modules.

Downloads

52

Readme

build status

static-jade-brunch

Adds Jade support to brunch without wrapping the compiled html in modules of type commonjs/amd.

With it you can get rid of index.html and use index.jade instead.

If before the brunch compilation the directory structure is something like:

app
| assets
| | font
| | img
| scripts
| styles
| partials
| | presentation.jade
| index.jade

after the brunch build the content of app directory would be like:

| assets
| | font
| | img
| | partials
| | | presentation.html
| | index.html
| scripts
| styles
| partials
| | presentation.jade
| index.jade

and the content of the public/ directory:

css
| ...
js
| app.js
| templates.js
| vendor.js
partials
| presentatin.html
index.html

Usage

Add "jade-brunch": "x.y.z" and "static-jade-brunch": "x.y.z" to package.json of your brunch app.

Pick a plugin version that corresponds to your minor (y) brunch version.

If you want to use git version of plugin, add:

Useful convensions

Brunch concatenates all your files in app/, test/ and vendor/ directories to two files by default:

  • app.js contains your application code.
  • vendor.js contains code of libraries you depend on (e.g. jQuery).

To avoid the inclusion of compiled jade file in app.js by the jade-brunch plugin, is possible to add a template file handler that point to a different output file. Inside config.coffee:

templates:
      joinTo:
        'js/templates.js': /.+\.jade$/

The brunch compiler ignore each file starting with _ (underscore) and that is useful for the chunks of jade that are included or extended.

The brunch compiler copy the content of the assets/ directory without recompile it. To permit others plugin (eg. auto-reload-brunch plugin) to manage the files generated by static-jade-brunch, all the generated files are placed inside the assets/ directory.

Configuration Options

The plugin can be configured to filter wich file to compile and to place in the assets directory, it can:

  • build only the files inside the directories that match a regular expression in the config.plugins.static_jade.path array. (best)
  • build only the files that end with the extension specified by config.plugins.static_jade.extension string.
  • place the output files in the relative path specified in asset option (app/assets by default). It can be useful when the project is using more assets directories (see config.conventions.assets)

Config example:

  plugins:
    jade:
      options:          # can be added all the supported jade options
        pretty: yes     # Adds pretty-indentation whitespaces to output (false by default)
        compiler: funny # Compiler to replace jade's default
                        # ...
      locals:           # locals can be added
        foo: 'jade is cool'
    static_jade:                        # all optionals
      extension:  ".static.jade"        # static-compile each file with this extension in `assets`
      path:       [ /app(\/|\\)docs/ ]  # static-compile each file in this directories
      asset:      "app/jade_asset"      # specify the compilation output

but is supported this configuration too (for backwards compatibility):

  plugins:
    jade:
      pretty: yes # Adds pretty-indentation whitespaces to output (false by default)
    static_jade:                        # all optionals
      extension:  ".static.jade"        # static-compile each file with this extension in `assets`
      path:       [ /app(\/|\\)docs/ ]  # static-compile each file in this directories
      asset:      "app/jade_asset"     # specify the compilation output

help?

If in doubt, you can play with the project static-jade-brunch-bootstrap

License

Copyright (c) 2012 "ilkosta" Costantino Giuliodori.

Licensed under the MIT license.