File tree 1 file changed +11
-2
lines changed
1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -81,7 +81,7 @@ def run(self):
81
81
self ._ensure_compiled ()
82
82
83
83
page = self .options .get ('page' , '' )
84
- iframe_url = '/' + self .html_dir + '/index.html?' + page
84
+ iframe_url = _doc_root () + self .html_dir + '/index.html?' + page
85
85
result = []
86
86
if 'popup' in self .modes :
87
87
result .append (Button (
@@ -172,13 +172,22 @@ def _create_index(self):
172
172
with open (target_file , 'wt' ) as out :
173
173
out .write ('<!DOCTYPE html>\n ' )
174
174
out .write ('<html>\n <head>\n ' )
175
- out .write ('<base href="/%s /">\n ' % self .html_dir )
175
+ out .write ('<base href="%s%s /">\n ' % ( _doc_root (), self .html_dir ) )
176
176
out .write ('<title>%s</title>\n ' % self .app_name )
177
177
out .write ('</head>\n <body>\n ' )
178
178
out .write ('<script src="main.dart.js"></script>\n ' )
179
179
out .write ('</body>\n </html>\n ' )
180
180
181
181
182
+ def _doc_root ():
183
+ root = os .environ .get ('PUBLISH_PATH' , '' )
184
+ if not root .startswith ('/' ):
185
+ root = '/' + root
186
+ if not root .endswith ('/' ):
187
+ root = root + '/'
188
+ return root
189
+
190
+
182
191
# ------------------------------------------------------------------------------
183
192
# Nodes
184
193
# ------------------------------------------------------------------------------
You can’t perform that action at this time.
0 commit comments