Commits

Anonymous committed 856aa2d

reconstruct js css position

Comments (0)

Files changed (5)

 .webassets-cache
 dist/
 local_conf.py
-*.nja
+*.nja
+main_bundle.js
 
 assets = fassets.Environment(app)
 assets.versions = 'hash:32'
+main_js = fassets.Bundle("main_bundle.js", 
+                        output='dist/main_bundle.%(version)s.js')
+assets.register('js_all', main_js)
+
+all_css = fassets.Bundle("style.css", 
+                         output='dist/main.%(version)s.css')
+assets.register('css_all', all_css)
+
+
 
 @app.before_request
 def something_before_request():

web/static/style.css

Empty file added.

web/templates/base.html

     <title>{%block title%}{{config.SITENAME}}{%endblock%}</title>
     <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
     <link rel="icon"  href="/static/favicon.ico">
-    
+
     <link rel="stylesheet" href="/static/libs/bootstrap/css/bootstrap.css">
 
+    {% assets "css_all" %}
+    <link rel="stylesheet" href="{{ ASSET_URL }}">
+    {% endassets %}
+    
+
+
+
+
     {%block css%}
     {%endblock%}
-
+    
+    % assets "js_all" %}
+        <script type="text/javascript" src="{{ ASSET_URL }}"></script>
+    {% endassets %}
 
     <script type="text/javascript" src="/static/libs/jquery.js"></script>
     <script type="text/javascript" src="/static/libs/bootstrap/js/bootstrap.js"></script>
 
 from mongoengine import MongoEngine
 
-from util.config import conf
+from conf.config import conf
 
 def get_db(database=None):
     if not database: