Skip to content
This repository has been archived by the owner on Nov 24, 2023. It is now read-only.

Add a template tag that interfaces with Bowers main directive #9

Open
gaqzi opened this issue Mar 2, 2014 · 1 comment
Open

Add a template tag that interfaces with Bowers main directive #9

gaqzi opened this issue Mar 2, 2014 · 1 comment

Comments

@gaqzi
Copy link
Contributor

gaqzi commented Mar 2, 2014

One thing I noticed with jQuery switching the path to where the main file is located is that currently things are kind of brittle.

If a library changes the location you've to go in and change the includes to get it working again.

So I suggest a tag working like this:

{% bower 'packagename' 'fallback-path-if-no-main' %}
Ex:
{% bower 'jquery' 'jquery/dist/jquery.js' %}

The main field in Bower can be a string or an array, so I would suggest that in case the main is an array the tag would pick the first item in the list. If passed in argument is packagename/file.js it'll look for that file in the array and output the path to the file. If main is just a string the filename after the slash will be matched against that file and if it doesn't match an error will be raised.

To get a listing of all the files do: bower list --paths

If you agree with this I'll implement it.

@gaqzi
Copy link
Contributor Author

gaqzi commented Mar 2, 2014

There would probably have to be a keyword argument for the base path to bower folder with the default being bower_components. Just in case one app has decided to put it in some other location.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant