Commits

catseye  committed 8e1c296

To change jQuery, supply a base.html in your own template dir.

  • Participants
  • Parent commits 766118f

Comments (0)

Files changed (3)

File src/chrysoberyl/commands.py

     """Render all nodes to a set of HTML5 files.
 
     """
-    optparser.add_option("--jquery-url",
-                         dest="jquery_url", metavar='URL',
-                         default='http://code.jquery.com/jquery-1.8.1.min.js',
-                         help="URL from which rendered pages grab jQuery")
     optparser.add_option("--node-dir",
                          dest="node_dir", metavar='DIR',
                          default='../catseye.tc/node',
         json.dump(transform_dates(data), file, encoding='utf-8',
                   default=unicode)
     convert_chrysoberyl_data(data)
-    r = Renderer(data, options.template_dirs, options.node_dir,
-                 jquery_url=options.jquery_url)
+    r = Renderer(data, options.template_dirs, options.node_dir)
     r.render_chrysoberyl_data()
 
 

File src/chrysoberyl/renderer.py

     """Object which renders Chrysoberyl data as HTML pages.
 
     """
-    def __init__(self, data, template_dirs, output_dir,
-                 jquery_url=None):
+    def __init__(self, data, template_dirs, output_dir):
         self.data = data
         self.template_dirs = template_dirs.split(':')
         self.output_dir = output_dir
         self.jinja2_env = Environment(loader=Loader(self.template_dirs))
-        self.jquery_url = jquery_url
 
     def render(self, template, output_filename, context):
         """Low-level method to render a given template."""
         context['data'] = self.data
         context['key'] = key
         context['filekey'] = filekey
-        context['jquery_url'] = self.jquery_url
 
         # Context functions.  Being nested functions of render_node lets
         # them easily access (close over) the current node and its key.

File templates/base.html

     </p>
   </footer>
 
-  <script src="{{ jquery_url }}"></script>
+  <script src="http://code.jquery.com/jquery-1.8.1.min.js"></script>
   <script src="../contrib/bootstrap/js/bootstrap.min.js"></script>
   <script type="text/javascript" src="../scripts/chrysoberyl.js"></script>
   {% block extra_tail %}{% endblock extra_tail %}