Skip to content

Commit

Permalink
Local testing no longer requires gulp; fix header navigation
Browse files Browse the repository at this point in the history
Goal: make iteration faster by removing the gulp bundle & copy &
copyback steps.

There are four ways to load the pages:

1. On gh-pages (http://aimacode.github.io/aima-javascript/)
2. Locally (http://localhost/), from a webserver running in ./build/
3. Locally (http://localhost/), from a webserver running in ./
4. Locally (file:/// urls), without a webserver

Prior to this change, (1) and (2) worked. This change makes (3)
and (4) also work. The header.html file worked only for (2) and not
for (1) which is the most important of these. With this change, all
four work.

gulp bundle was being used only to build "main.js", which loaded
Bootstrap JS, Bootstrap CSS, and a site-wide CSS. It is not doing
anything to the local html or js files.

- Changed Bootstrap to load the same way we load JQuery and Two.JS:
  through a CDN. The CDN copy will be cached across sites.
- Replaced the gulp-built main.js with a version that loads
  Bootstrap from the CDN.
- Loaded the site-wide CSS directly from each page.
- Moved common script to load header.html into main.js.
- Moved the footer html to main.js. This will make it easier
  for us to modify the footer across pages.
- Switched jquery from 1.10.2 to 1.12.4 to match Bootstrap 3's
  recommended version
- Fixed typos (Stuart Russell's name, chapter titles)
- Removed extra styles.css file (there were two and we were using only one)
- Removed src/index.js as it was used to minify our own copy of
  Bootstrap and is no longer needed to load Bootstrap from CDN
- Removed header.html from the home page, since the home page already
  has the chapters listed below the title. Also, there isn't a simple
  way to make header.html work in all the different use cases and also
  work on the home page.
- Removed the large site header from the chapter pages, to better
  distinguish the home page from the chapter pages.
- Updated gulpfile to match all these changes. There is no longer a
  "gulp bundle" or "gulp copyback"; gulp is only needed for deploying
  to gh-pages.
  • Loading branch information
redblobgames committed May 1, 2017
1 parent 5e4354e commit 6542592
Show file tree
Hide file tree
Showing 34 changed files with 143 additions and 502 deletions.
15 changes: 3 additions & 12 deletions 1-Introduction/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,11 @@
<html lang="en">
<head>
<title>1 Introduction</title>
<script src="http://code.jquery.com/jquery-1.10.2.js"></script>
<link rel="stylesheet" href="../styles.css">
<script src="http://code.jquery.com/jquery-1.12.4.js"></script>
<script type="text/javascript" src="../main.js"></script>
<script>
$(function(){
$('header').load("../header.html");
});
</script>
</head>
<body>
<header>

</header>

<div class="row">
<div class="col-sm-6 col-md-offset-3" id="content">
Expand All @@ -22,8 +15,6 @@ <h2>Introduction</h2>
<p> Placeholder text </p>
</div>
</div>
<footer class="container-fluid text-center">
<img src="http://aima.cs.berkeley.edu/aima_logo.png">
</footer>

</body>
</html>
21 changes: 3 additions & 18 deletions 10-Classical-Planning/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,33 +2,18 @@
<html lang="en">
<head>
<title>10 Classical Planning </title>
<script src="http://code.jquery.com/jquery-1.10.2.js"></script>
<link rel="stylesheet" href="../styles.css">
<script src="http://code.jquery.com/jquery-1.12.4.js"></script>
<script type="text/javascript" src="../main.js"></script>

<script>
$(function(){
$('header').load("../header.html");
});
</script>
</head>
<body>

<header>

</header>

<div class="row">
<div class="col-sm-6 col-md-offset-3" id="content">
<h1>Classical Planning</h1>
<p>TODO</p>


</div>
</div>

<footer class="container-fluid text-center">
<img src="http://aima.cs.berkeley.edu/aima_logo.png"></img>
</footer>


</body>
</html>
17 changes: 2 additions & 15 deletions 11-Planning-And-Acting-In-The-Real-World/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,11 @@
<html lang="en">
<head>
<title>11 Planning and Acting in The Real World </title>
<script src="http://code.jquery.com/jquery-1.10.2.js"></script>
<link rel="stylesheet" href="../styles.css">
<script src="http://code.jquery.com/jquery-1.12.4.js"></script>
<script type="text/javascript" src="../main.js"></script>

<script>
$(function(){
$('header').load("../header.html");
});
</script>
</head>
<body>

<header>

</header>

<div class="row">
<div class="col-sm-6 col-md-offset-3" id="content">
Expand All @@ -26,9 +17,5 @@ <h1>Planning and Acting in The Real World</h1>
</div>
</div>

<footer class="container-fluid text-center">
<img src="http://aima.cs.berkeley.edu/aima_logo.png"></img>
</footer>

</body>
</html>
17 changes: 2 additions & 15 deletions 12-Knowledge-Representation/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,12 @@
<html lang="en">
<head>
<title>12 Knowledge Representation </title>
<script src="http://code.jquery.com/jquery-1.10.2.js"></script>
<link rel="stylesheet" href="../styles.css">
<script src="http://code.jquery.com/jquery-1.12.4.js"></script>
<script type="text/javascript" src="../main.js"></script>

<script>
$(function(){
$('header').load("../header.html");
});
</script>
</head>
<body>

<header>

</header>

<div class="row">
<div class="col-sm-6 col-md-offset-3" id="content">
<h1>Knowledge Representation</h1>
Expand All @@ -26,9 +17,5 @@ <h1>Knowledge Representation</h1>
</div>
</div>

<footer class="container-fluid text-center">
<img src="http://aima.cs.berkeley.edu/aima_logo.png"></img>
</footer>

</body>
</html>
17 changes: 2 additions & 15 deletions 13-Quantifying-Uncertainity/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,11 @@
<html lang="en">
<head>
<title>13 Quantifying Uncertainity</title>
<script src="http://code.jquery.com/jquery-1.10.2.js"></script>
<link rel="stylesheet" href="../styles.css">
<script src="http://code.jquery.com/jquery-1.12.4.js"></script>
<script type="text/javascript" src="../main.js"></script>

<script>
$(function(){
$('header').load("../header.html");
});
</script>
</head>
<body>

<header>

</header>

<div class="row">
<div class="col-sm-6 col-md-offset-3" id="content">
Expand All @@ -26,9 +17,5 @@ <h1>Quantifying Uncertainity</h1>
</div>
</div>

<footer class="container-fluid text-center">
<img src="http://aima.cs.berkeley.edu/aima_logo.png"></img>
</footer>

</body>
</html>
17 changes: 2 additions & 15 deletions 14-Probabilistic-Reasoning/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,12 @@
<html lang="en">
<head>
<title>14 Probabilistic Reasoning</title>
<script src="http://code.jquery.com/jquery-1.10.2.js"></script>
<link rel="stylesheet" href="../styles.css">
<script src="http://code.jquery.com/jquery-1.12.4.js"></script>
<script type="text/javascript" src="../main.js"></script>

<script>
$(function(){
$('header').load("../header.html");
});
</script>
</head>
<body>

<header>

</header>

<div class="row">
<div class="col-sm-6 col-md-offset-3" id="content">
<h1>Probabilistic Reasoning</h1>
Expand All @@ -26,9 +17,5 @@ <h1>Probabilistic Reasoning</h1>
</div>
</div>

<footer class="container-fluid text-center">
<img src="http://aima.cs.berkeley.edu/aima_logo.png"></img>
</footer>

</body>
</html>
17 changes: 2 additions & 15 deletions 15-Probabilistic-Reasoning-Over-Time/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,12 @@
<html lang="en">
<head>
<title>15 Probabilistic Reasoning Over Time</title>
<script src="http://code.jquery.com/jquery-1.10.2.js"></script>
<link rel="stylesheet" href="../styles.css">
<script src="http://code.jquery.com/jquery-1.12.4.js"></script>
<script type="text/javascript" src="../main.js"></script>

<script>
$(function(){
$('header').load("../header.html");
});
</script>
</head>
<body>

<header>

</header>

<div class="row">
<div class="col-sm-6 col-md-offset-3" id="content">
<h1>Probabilistic Reasoning Over Time</h1>
Expand All @@ -26,9 +17,5 @@ <h1>Probabilistic Reasoning Over Time</h1>
</div>
</div>

<footer class="container-fluid text-center">
<img src="http://aima.cs.berkeley.edu/aima_logo.png"></img>
</footer>

</body>
</html>
17 changes: 2 additions & 15 deletions 16-Making-Simple-Decisions/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,12 @@
<html lang="en">
<head>
<title>16 Making Simple Decisions</title>
<script src="http://code.jquery.com/jquery-1.10.2.js"></script>
<link rel="stylesheet" href="../styles.css">
<script src="http://code.jquery.com/jquery-1.12.4.js"></script>
<script type="text/javascript" src="../main.js"></script>

<script>
$(function(){
$('header').load("../header.html");
});
</script>
</head>
<body>

<header>

</header>

<div class="row">
<div class="col-sm-6 col-md-offset-3" id="content">
<h1>Making Simple Decisions</h1>
Expand All @@ -26,9 +17,5 @@ <h1>Making Simple Decisions</h1>
</div>
</div>

<footer class="container-fluid text-center">
<img src="http://aima.cs.berkeley.edu/aima_logo.png"></img>
</footer>

</body>
</html>
17 changes: 2 additions & 15 deletions 17-Making-Complex-Decisions/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,12 @@
<html lang="en">
<head>
<title>17 Making Complex Decisions</title>
<script src="http://code.jquery.com/jquery-1.10.2.js"></script>
<link rel="stylesheet" href="../styles.css">
<script src="http://code.jquery.com/jquery-1.12.4.js"></script>
<script type="text/javascript" src="../main.js"></script>

<script>
$(function(){
$('header').load("../header.html");
});
</script>
</head>
<body>

<header>

</header>

<div class="row">
<div class="col-sm-6 col-md-offset-3" id="content">
<h1>Making Complex Decisions</h1>
Expand All @@ -26,9 +17,5 @@ <h1>Making Complex Decisions</h1>
</div>
</div>

<footer class="container-fluid text-center">
<img src="http://aima.cs.berkeley.edu/aima_logo.png"></img>
</footer>

</body>
</html>
17 changes: 2 additions & 15 deletions 18-Learning-From-Examples/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,13 @@
<html lang="en">
<head>
<title>18 Learning From Examples</title>
<script src="http://code.jquery.com/jquery-1.10.2.js"></script>
<link rel="stylesheet" href="../styles.css">
<script src="http://code.jquery.com/jquery-1.12.4.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/two.js/0.6.0/two.min.js"></script>
<script type="text/javascript" src="../main.js"></script>

<script>
$(function(){
$('header').load("../header.html");
});
</script>
</head>
<body>

<header>

</header>

<div class="row">
<div class="col-sm-6 col-md-offset-3" id="content">
<h1>Learning From Examples</h1>
Expand All @@ -27,9 +18,5 @@ <h1>Learning From Examples</h1>
</div>
</div>

<footer class="container-fluid text-center">
<img src="http://aima.cs.berkeley.edu/aima_logo.png"></img>
</footer>

</body>
</html>
17 changes: 2 additions & 15 deletions 19-Knowledge-In-Learning/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,12 @@
<html lang="en">
<head>
<title>19 Knowledge in Learning</title>
<script src="http://code.jquery.com/jquery-1.10.2.js"></script>
<link rel="stylesheet" href="../styles.css">
<script src="http://code.jquery.com/jquery-1.12.4.js"></script>
<script type="text/javascript" src="../main.js"></script>

<script>
$(function(){
$('header').load("../header.html");
});
</script>
</head>
<body>

<header>

</header>

<div class="row">
<div class="col-sm-6 col-md-offset-3" id="content">
<h1>Knowledge in Learning</h1>
Expand All @@ -26,9 +17,5 @@ <h1>Knowledge in Learning</h1>
</div>
</div>

<footer class="container-fluid text-center">
<img src="http://aima.cs.berkeley.edu/aima_logo.png"></img>
</footer>

</body>
</html>
Loading

0 comments on commit 6542592

Please sign in to comment.