Skip to content

Commit 0afdce1

Browse files
committed
Switch the website to use jekyll
Unfortunately, this means that the git repository is not directly deployable. But! We've been clever and come up with a solution: deploy.sh, which runs jekyll and htmlcompressor.jar and produces a deploy branch that can be checked out and served.
1 parent 60eec3f commit 0afdce1

14 files changed

+330
-346
lines changed

_config.yml

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
name: sql.mit.edu
2+
pygments: true
3+
include: ['assets']
4+
exclude: ['deploy.sh']

_includes/common-scripts.html

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<script src="/assets/js/jquery.js"></script>
2+
<script src="/assets/js/bootstrap.js"></script>
3+
<script src="/assets/js/holder/holder.js"></script>
4+
<script src="/assets/webathena/q.min.js"></script>
5+
<script src="/assets/webathena/sjcl.js"></script>
6+
<script src="/assets/webathena/winchan.js"></script>
7+
<script src="/assets/webathena/webathena.js"></script>
8+
<script src="/assets/webathena-sql/core.js"></script>

_includes/footer.html

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<!-- FOOTER -->
2+
<div class="container">
3+
<div class="navbar navbar-fixed-bottom footer">
4+
<div class="container">
5+
{% include footer_basic.html %}
6+
</div>
7+
</div>
8+
</div><!-- /.container -->

_includes/footer_basic.html

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<footer>
2+
<p class="pull-right"><a href="#">Back to top</a></p>
3+
<p>&copy; 2013 <a href="http://sipb.mit.edu/">MIT SIPB</a> &middot; <a href="#">Privacy</a> &middot; <a href="http://ist.mit.edu/athena/olh/rules">Rules of Use</a></p>
4+
</footer>

_includes/head.html

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<meta charset="utf-8">
2+
<title>{{ page.title }} &middot; sql.mit.edu</title>
3+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
4+
<meta name="description" content="MIT SIPB SQL Service for Athena">
5+
<meta name="author" content="MIT SIPB SQL Team">
6+
<link href="/assets/css/bootstrap.css" rel="stylesheet">
7+
<link href="/assets/css/bootstrap-responsive.css" rel="stylesheet">
8+
<link href="/assets/css/base.css" rel="stylesheet">
9+
<!-- HTML5 shim, for IE6-8 support of HTML5 elements -->
10+
<!--[if lt IE 9]>
11+
<script src="/assets/js/html5shiv.js"></script>
12+
<![endif]-->
13+
<link rel="shortcut icon" href="/assets/ico/favicon.png">

_includes/navbar.html

+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
<div class="navbar-wrapper">
2+
<div class="container">
3+
<div class="navbar navbar-inverse">
4+
<div class="navbar-inner">
5+
<button type="button" class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
6+
<span class="icon-bar"></span>
7+
<span class="icon-bar"></span>
8+
<span class="icon-bar"></span>
9+
</button>
10+
<a class="brand" href="/">{{ site.name }}</a>
11+
<div class="nav-collapse collapse">
12+
<ul class="nav">
13+
<li {{page.home}}><a href="/">Home</a></li>
14+
<li {{page.signup}}><a href="/signup">Sign up</a></li>
15+
<li {{page.contact}}><a href="/contact">Contact</a></li>
16+
<li {{page.about}}><a href="/about">About</a></li>
17+
<li {{page.donate}}><a href="/donate">Donate</a></li>
18+
<li {{page.join}}><a href="/join">Join us</a></li>
19+
</ul>
20+
<ul class="nav pull-right">
21+
<li class="dropdown" id="my-account" hidden>
22+
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
23+
My account
24+
<b class="caret"></b>
25+
</a>
26+
<ul class="dropdown-menu">
27+
<li><a href="#profile">Edit profile</a></li>
28+
<li><a href="#password">Change password</a></li>
29+
<li class="divider"></li>
30+
<li class="nav-header">Databases</li>
31+
<li><a href="#manage">Manage</a></li>
32+
<li><a href="https://sql.scripts.mit.edu/phpMyAdmin/">Edit data</a></li>
33+
<li class="divider"></li>
34+
<li class="nav-header">Session</li>
35+
<li><a href="#" id="log-out">Log out (currently <span id="sql-username"></span>)</a></li>
36+
</ul>
37+
</li>
38+
<li id="not-signed-in"><a href="#">not signed in</a></li>
39+
</ul>
40+
</div><!--/.nav-collapse -->
41+
</div><!-- /.navbar-inner -->
42+
</div><!-- /.navbar -->
43+
</div> <!-- /.container -->
44+
</div><!-- /.navbar-wrapper -->

_layouts/carousel.html

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
{% include head.html %}
5+
<link href="assets/css/jumbo-carousel.css" rel="stylesheet">
6+
</head>
7+
<body>
8+
{% include navbar.html %}
9+
{{ content }}
10+
<div class="container">
11+
{% include footer_basic.html %}
12+
</div>
13+
<!-- Placed at the end of the document so the pages load faster -->
14+
{% include common-scripts.html %}
15+
<script>
16+
document.getElementById("not-signed-in").addEventListener("click", function (e) {
17+
e.preventDefault();
18+
getTicket().then(function(session) {
19+
updateLoginControls();
20+
});
21+
});
22+
document.getElementById("log-out").addEventListener("click", function (e) {
23+
e.preventDefault();
24+
destroyCachedTicket();
25+
updateLoginControls();
26+
});
27+
updateLoginControls();
28+
</script>
29+
</body>
30+
</html>

_layouts/default.html

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
{% include head.html %}
5+
{{ page.extra_head }}
6+
</head>
7+
<body>
8+
{% include navbar.html %}
9+
<div class="container clear-navbar">
10+
{{ content }}
11+
</div><!-- /.container -->
12+
{% include footer.html %}
13+
<!-- Placed at the end of the document so the pages load faster -->
14+
{% include common-scripts.html %}
15+
<script>
16+
document.getElementById("not-signed-in").addEventListener("click", function (e) {
17+
e.preventDefault();
18+
getTicket().then(function(session) {
19+
updateLoginControls();
20+
});
21+
});
22+
document.getElementById("log-out").addEventListener("click", function (e) {
23+
e.preventDefault();
24+
destroyCachedTicket();
25+
updateLoginControls();
26+
});
27+
updateLoginControls();
28+
</script>
29+
</body>
30+
</html>

_layouts/post.html

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
layout: default
3+
---
4+
<h2>{{ page.title }}</h2>
5+
<p class="meta">{{ page.date | date_to_string }}</p>
6+
7+
<div class="post">
8+
{{ content }}
9+
</div>

_posts/.empty

Whitespace-only changes.

deploy.sh

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
#!/bin/bash
2+
set -e
3+
4+
# First, ensure that the working copy and index is clean
5+
if [ -n "$(git status --porcelain)" ]; then
6+
echo "You have uncommitted changes; aborting" >&2
7+
exit 1
8+
fi
9+
10+
# Use jekyll to perform the build, but allow the user to specify the
11+
# path, if needed. Similarly, set a path to the htmlcompressor
12+
JEKYLL=${JEKYLL-jekyll}
13+
HTMLCOMPRESSOR=${HTMLCOMPRESSOR-htmlcompressor.jar}
14+
15+
# Build the site
16+
$JEKYLL build
17+
# Compress the HTML files
18+
java -jar $HTMLCOMPRESSOR --type html --recursive _site --output _site2/
19+
# Move the compressed HTML files into place
20+
cp -Rf _site2/ _site/
21+
rm -rf _site2/
22+
23+
# Perform the git operations
24+
PLACEHOLDER=$(git rev-parse --symbolic HEAD)
25+
git add -f _site
26+
TREE=$(git write-tree --prefix=_site/)
27+
COMMIT=$(date | git commit-tree $TREE -p deploy)
28+
git update-ref refs/heads/deploy $COMMIT
29+
git checkout -f $PLACEHOLDER

0 commit comments

Comments
 (0)