Ok, so I have some django projects using the now ubiquitous twitter bootstrap, together with the fantastish Font-Awesome. No problem. And I like my css LESS flavoured, because … well, because who likes to write css rules over and over? So this results in a folder structure for the assets which looks something like this:

├── assets
│   ├── bootstrap
│   │   ├── docs
│   │   ├── img
│   │   ├── js
│   │   └── less
│   ├── css
│   ├── font
│   ├── img
│   └── js

To enable font-awesome you’ll have inside the less directory a file called font-awesome.less indicating the relative path to the font folder:

@FontAwesomePath:   "../../font";

because the font file lives two levels out. So during development I would call the less files from base.html simply as:

But when I ran the Makefile

lessc --compress ${BOOTSTRAP_LESS} > ${BOOTSTRAP_MIN}                                                                                                                               

This would keep the relative path

@FontAwesomePath:   "../../font";

however, the minified css file now lived only one level away from the font directory (as you can see above). So what was the obvious solution? Well … here’s my dumb way out: modify the Makefile

So to solve this problem, I modify the Makefile, use sed, test some regex, test regex some more, break, crash burn … and finally make it work. Was this a good solution? Well, two weeks later I realized there’s a much, much simpler solution: make a copy of the font/ directory in the bootstrap/ directory … like so:

├── assets
│   ├── bootstrap
│   │   ├── docs
│   │   ├── img
│   │   ├── font
│   │   ├── js
│   │   └── less
│   ├── css
│   ├── font
│   ├── img
│   └── js

so that:

@FontAwesomePath:   "../../font";
is always
@FontAwesomePath:   "../font";

DUUUHH!

Anyway. I just thought I would share this in case some unsuspecting n00b is looking for regex-es to solve this little issue

Here’s a link to solve the issue of highlighting the menu item corresponding to the active page in wordpress 3.  (When using wp_nav_menu )