Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

trouble with static tag #127

Open
NikolayGalkin opened this issue Mar 1, 2013 · 2 comments
Open

trouble with static tag #127

NikolayGalkin opened this issue Mar 1, 2013 · 2 comments

Comments

@NikolayGalkin
Copy link

Hi!

First of all thanks for the HamlPy. Realy good tool. But I have a trouble with {% staic %} tag. I try to add style in base.haml template but it rise an exception. Current example work perfect:

%head
%link{rel: "stylesheet", href: "/media/static/css/bootstrap.min.css" }

But when I try to use static tag i got fail :(
%head
%link{rel: "stylesheet", href: {% static "css/bootstrap.min.css" %} }

Maybe it would be better to provide in hamlpy some tags for current case. for example in hamlpy.templates.tags there were some tags like:

- style "css/bootstrap.min.css"
which will render:
< link rel="stylesheet" href="/media/static/css/bootstrap.min.css">

Of course it will be perfect if there is a JS tags in hamlpy tags.

Have a nice day!

@kevinastone
Copy link

Did you load the staticfiles templatetags? You're also not putting quotes around your attribute names.

@hiway
Copy link

hiway commented Nov 26, 2013

This works:

%link{rel: 'stylesheet', type: 'text/css', href: '{% static "css/grid.css" %}' }

Note the single quotes hiding the raw django template tag from haml.

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

No branches or pull requests

3 participants