@@ -1047,12 +1047,13 @@ def render_message(log_type, message_json, timestamp):
10471047});
10481048"""
10491049
1050- # JavaScript to fix relative URLs when served via gistpreview.github.io
1051- # Fixes issue #26: Pagination links broken on gistpreview .github.io
1050+ # JavaScript to fix relative URLs when served via gisthost.github.io or gistpreview.github.io
1051+ # Fixes issue #26: Pagination links broken on gisthost .github.io
10521052GIST_PREVIEW_JS = r"""
10531053(function() {
1054- if (window.location.hostname !== 'gistpreview.github.io') return;
1055- // URL format: https://gistpreview.github.io/?GIST_ID/filename.html
1054+ var hostname = window.location.hostname;
1055+ if (hostname !== 'gisthost.github.io' && hostname !== 'gistpreview.github.io') return;
1056+ // URL format: https://gisthost.github.io/?GIST_ID/filename.html
10561057 var match = window.location.search.match(/^\?([^/]+)/);
10571058 if (!match) return;
10581059 var gistId = match[1];
@@ -1114,7 +1115,7 @@ def render_message(log_type, message_json, timestamp):
11141115 startObserving();
11151116
11161117 // Handle fragment navigation after dynamic content loads
1117- // gistpreview.github.io loads content dynamically, so the browser's
1118+ // gisthost.github.io/ gistpreview.github.io loads content dynamically, so the browser's
11181119 // native fragment navigation fails because the element doesn't exist yet
11191120 function scrollToFragment() {
11201121 var hash = window.location.hash;
@@ -1402,7 +1403,7 @@ def cli():
14021403@click .option (
14031404 "--gist" ,
14041405 is_flag = True ,
1405- help = "Upload to GitHub Gist and output a gistpreview .github.io URL." ,
1406+ help = "Upload to GitHub Gist and output a gisthost .github.io URL." ,
14061407)
14071408@click .option (
14081409 "--json" ,
@@ -1490,7 +1491,7 @@ def local_cmd(output, output_auto, repo, gist, include_json, open_browser, limit
14901491 inject_gist_preview_js (output )
14911492 click .echo ("Creating GitHub gist..." )
14921493 gist_id , gist_url = create_gist (output )
1493- preview_url = f"https://gistpreview .github.io/?{ gist_id } /index.html"
1494+ preview_url = f"https://gisthost .github.io/?{ gist_id } /index.html"
14941495 click .echo (f"Gist: { gist_url } " )
14951496 click .echo (f"Preview: { preview_url } " )
14961497
@@ -1559,7 +1560,7 @@ def fetch_url_to_tempfile(url):
15591560@click .option (
15601561 "--gist" ,
15611562 is_flag = True ,
1562- help = "Upload to GitHub Gist and output a gistpreview .github.io URL." ,
1563+ help = "Upload to GitHub Gist and output a gisthost .github.io URL." ,
15631564)
15641565@click .option (
15651566 "--json" ,
@@ -1621,7 +1622,7 @@ def json_cmd(json_file, output, output_auto, repo, gist, include_json, open_brow
16211622 inject_gist_preview_js (output )
16221623 click .echo ("Creating GitHub gist..." )
16231624 gist_id , gist_url = create_gist (output )
1624- preview_url = f"https://gistpreview .github.io/?{ gist_id } /index.html"
1625+ preview_url = f"https://gisthost .github.io/?{ gist_id } /index.html"
16251626 click .echo (f"Gist: { gist_url } " )
16261627 click .echo (f"Preview: { preview_url } " )
16271628
@@ -1870,7 +1871,7 @@ def generate_html_from_session_data(session_data, output_dir, github_repo=None):
18701871@click .option (
18711872 "--gist" ,
18721873 is_flag = True ,
1873- help = "Upload to GitHub Gist and output a gistpreview .github.io URL." ,
1874+ help = "Upload to GitHub Gist and output a gisthost .github.io URL." ,
18741875)
18751876@click .option (
18761877 "--json" ,
@@ -1984,7 +1985,7 @@ def web_cmd(
19841985 inject_gist_preview_js (output )
19851986 click .echo ("Creating GitHub gist..." )
19861987 gist_id , gist_url = create_gist (output )
1987- preview_url = f"https://gistpreview .github.io/?{ gist_id } /index.html"
1988+ preview_url = f"https://gisthost .github.io/?{ gist_id } /index.html"
19881989 click .echo (f"Gist: { gist_url } " )
19891990 click .echo (f"Preview: { preview_url } " )
19901991
0 commit comments