Skip to content

Commit 2988774

Browse files
committed
add slides path to publishing root for speaker notes
RevealJS speaker notes loads the url that RevealJS is running on in an iframe and adds a query string to it. this was resulting in a url like publishing-root/?param-list, which caused the speaker notes to not load previews properly. using publishing-root/index.html fixes the problem
1 parent 98a462f commit 2988774

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

publishing.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@
2424

2525
CODE_DIR = os.path.dirname(os.path.realpath(__file__))
2626

27+
SLIDES_PATH = '/index.html'
28+
2729

2830
def update_static_publish_folder():
2931
"""
@@ -36,7 +38,7 @@ def update_static_publish_folder():
3638
shutil.rmtree("/var/new-www")
3739
os.mkdir("/var/new-www")
3840
shutil.copytree(os.path.join(CODE_DIR, "static"), "/var/new-www/static")
39-
shutil.copy2("/var/new-www/static/slides.html", "/var/new-www/index.html")
41+
shutil.copy2("/var/new-www/static/slides.html", "/var/new-www" + SLIDES_PATH)
4042
if os.path.exists("/var/www"):
4143
os.rename("/var/www", "/var/old-www")
4244
os.rename("/var/new-www", "/var/www")
@@ -59,4 +61,4 @@ def publish(session_id):
5961
session_ctx = bridge_cap.getSessionContext(session_id).wait().context.cast_as(hack_session.HackSessionContext)
6062
public_id = session_ctx.getPublicId().wait()
6163
publishing_root = public_id.autoUrl
62-
return publishing_root
64+
return publishing_root + SLIDES_PATH

0 commit comments

Comments
 (0)