File tree 5 files changed +23
-0
lines changed
5 files changed +23
-0
lines changed Original file line number Diff line number Diff line change
1
+ // Build.js is going to need to be moved here via your deployment scripts
2
+ // This will allow developers to import IDOM the Django way
Original file line number Diff line number Diff line change
1
+ <!-- The importable IDOM JS -->
2
+ < script src ="{% static 'js/idom.js' %} " crossorigin ="anonymous "> </ script >
Original file line number Diff line number Diff line change
1
+ <!-- Allows for making the IDOM root object the Django way
2
+ Developers will often opt not to use this,
3
+ but having this makes getting started a little bit easier to explain -->
4
+ < div id ="{{ html_id }} "> </ div >
Original file line number Diff line number Diff line change
1
+ from django import template
2
+ from django .urls import reverse
3
+
4
+
5
+ register = template .Library ()
6
+
7
+ # Template tag that renders the IDOM scripts
8
+ @register .inclusion_tag ("idom/head_content.html" )
9
+ def idom_scripts ():
10
+ pass
11
+
12
+ # Template tag that renders an empty idom root object
13
+ @register .inclusion_tag ("idom/root.html" )
14
+ def idom_root (html_id ):
15
+ return {"html_id" : html_id }
You can’t perform that action at this time.
0 commit comments