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

Allow for Template Extensions to Easily Inline Code #246

Open
mankyd opened this issue Jun 10, 2013 · 7 comments · May be fixed by #384
Open

Allow for Template Extensions to Easily Inline Code #246

mankyd opened this issue Jun 10, 2013 · 7 comments · May be fixed by #384

Comments

@mankyd
Copy link
Contributor

mankyd commented Jun 10, 2013

Currently, there is no quick and easy way to inline CSS and/or JS via webassets. For instance, the Jinja2 extension supports the following usage:

{% assets output="css/m.%(version)s.css", "css/a.css", "css/b.css" %}
<link rel="stylesheet" href="{{ ASSET_URL }}">
{% endassets %}

However, if you want to inline that css instead, you're out of luck. It would be great if I could easily replace that with:

{% assets filters="cssmin", "css/a.css", "css/b.css" %}
<style>{{ ASSET_CONTENTS }}</style>
{% endassets %}
@miracle2k
Copy link
Owner

It's something I wanted to add for some time, but I didn't consider this syntax. Kind of a genius idea.

@mankyd
Copy link
Contributor Author

mankyd commented Jun 10, 2013

Genius may be a little generous, but thanks :). I work on the PageSpeed team over at Google, and the ability to inline content will be super useful based on some of the research we've been doing. Keep up the good work!

@magwo
Copy link

magwo commented Aug 8, 2014

Any news on this?

@mankyd mankyd linked a pull request Jan 25, 2015 that will close this issue
@zllak
Copy link

zllak commented Feb 27, 2015

+1. That is kind of a must have feature. Any plan on merging this @miracle2k ? Thanks :)

@miracle2k
Copy link
Owner

Yes, but but the issue noted in #384 that would need to be addressed first.

@zllak
Copy link

zllak commented Apr 23, 2015

@miracle2k what is blocking this issue right now ? I might have some time to dig. I really need this to go further :) (this issue and the #384 PR)

@miracle2k
Copy link
Owner

As noted on the PR, the pull request forces a file system touch currently, even if ASSETS_CONTENT is not used, and auto_build is False. Part of the promise of auto_build=False is that the filesystem is not touched, and in fact now files exists; the urls could be generated solely based on the manifest.

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

Successfully merging a pull request may close this issue.

4 participants