]> git.cworth.org Git - turbot-web/commitdiff
Expect all dependencies to be found from /
authorCarl Worth <cworth@cworth.org>
Wed, 12 Jan 2022 08:42:03 +0000 (00:42 -0800)
committerCarl Worth <cworth@cworth.org>
Wed, 12 Jan 2022 08:42:03 +0000 (00:42 -0800)
Specifically, the .css and .js files needed by the files being generated here.

By expecting these from '/' we can serve them statically from that
single location, even if all of the files we generate end up at some
lower-level directory (such as when we soon isolate the web pages for
each hunt from each other).

html_generator.py

index c16f033552cb80094befa995b04645fa1d612ba6..0950d6f4212db82f8b24a9874416dc992dfb6195 100644 (file)
@@ -131,7 +131,7 @@ def overview(puzzles, rounds):
      '  <meta charset="utf-8">\n',
      '  <meta name="viewport" content="width=device-width, initial-scale=1">\n',
      '\n',
-     '  <link rel="stylesheet" href="overview.css">\n',
+     '  <link rel="stylesheet" href="/overview.css">\n',
      '  <script type="text/javascript">\n',
      '    // Hide all elements with class="containerTab", except for the one that matches the clickable grid column\n',
      '    function openTab(tabName) {\n',
@@ -145,7 +145,7 @@ def overview(puzzles, rounds):
      '  </script>\n',
      '\n',
      '  <title>Hunt Overview</title>\n',
-     '  <script src="sorttable.js"></script>\n'
+     '  <script src="/sorttable.js"></script>\n'
      '</head>\n',
      '    <div class="sidenav">\n'
      '      <a href="index.html">Hunt Overview</a>'
@@ -219,9 +219,9 @@ def round_overview(rnd, puzzles):
         status = 'unsolved'
     start = ['<html>\n',
      '    <head>\n',
-     '        <link rel="stylesheet" href="individual.css">\n',
+     '        <link rel="stylesheet" href="/individual.css">\n',
      '        <title>Mystery Hunt 2022</title>\n',
-     '        <script src="sorttable.js"></script>\n',
+     '        <script src="/sorttable.js"></script>\n',
      '    </head>\n',
      '    <body class="{}">\n'.format(status),
      '        <h1><b>{}</b></h1>\n'.format(rnd),
@@ -305,7 +305,7 @@ def puzzle_overview(puzzle):
      '<head>\n',
      '    <meta charset="utf-8">\n',
      '    <meta name="viewport" content="width=device-width, initial-scale=1">\n',
-     '    <link rel="stylesheet" href="individual.css">\n',
+     '    <link rel="stylesheet" href="/individual.css">\n',
      '    <title>{}</title>\n'.format(name+meta),
      '    <p>{}</p>'.format(link(website + 'index.html', 'Hunt Overview')),
      '\n',
@@ -349,9 +349,9 @@ def puzzle_lists(puzzles, filt):
     unsolved_puzzles = [puzzle for puzzle in puzzles if puzzle['status'] != 'solved']
     start = ['<html>\n',
      '    <head>\n',
-     '        <link rel="stylesheet" href="overview.css">\n',
+     '        <link rel="stylesheet" href="/overview.css">\n',
      '        <title>Mystery Hunt 2022</title>\n',
-     '        <script src="sorttable.js"></script>\n',
+     '        <script src="/sorttable.js"></script>\n',
      '    </head>\n',
      '    <div class="sidenav">\n'
      '      <a href="index.html">Hunt Overview</a>'