Skip to content

Commit

Permalink
Add templates and third_party Bootstrap and Font Awesome assets. (#1)
Browse files Browse the repository at this point in the history
  • Loading branch information
davidzchen authored May 3, 2017
1 parent 68a6ef8 commit 8c6e9f7
Show file tree
Hide file tree
Showing 77 changed files with 14,032 additions and 1 deletion.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/bazel-*
/.sass-cache
/production
*.swp
14 changes: 14 additions & 0 deletions 404.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
layout: default
permalink: /404.html
---

404 - Page not found
====================

<pre>
$ bazel build :what-you-were-looking-for
...............
<b><span style="color: red;">ERROR</span></b>: no such page ':what-you-were-looking-for': BUILD file not found on package path.
<b><span style="color: green;">INFO</span></b>: Elapsed time: 0.567s
</pre>
73 changes: 73 additions & 0 deletions BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
load("@bazel_tools//tools/build_defs/pkg:pkg.bzl", "pkg_tar")

filegroup(
name = "jekyll-srcs",
srcs = glob(
["**/*"],
exclude = [
".git/**",
"bazel-*/**",
"BUILD",
"WORKSPACE",
"scripts/**",
"*.swp",
"LICENSE",
"CONTRIBUTING",
"production/**",
"README.md",
],
),
)

pkg_tar(
name = "jekyll-files",
files = [":jekyll-srcs"],
strip_prefix = ".",
)

pkg_tar(
name = "bootstrap-css",
files = ["//third_party/css/bootstrap:bootstrap_css"],
package_dir = "assets",
strip_prefix = "/third_party/css/bootstrap",
)

pkg_tar(
name = "bootstrap-images",
files = ["//third_party/css/bootstrap:bootstrap_images"],
package_dir = "assets",
strip_prefix = "/third_party/css/bootstrap",
)

pkg_tar(
name = "font-awesome-css",
files = ["//third_party/css/font_awesome:font_awesome_css"],
package_dir = "assets",
strip_prefix = "/third_party/css/font_awesome",
)

pkg_tar(
name = "font-awesome-font",
files = ["//third_party/css/font_awesome:font_awesome_font"],
package_dir = "assets",
strip_prefix = "/third_party/css/font_awesome",
)

pkg_tar(
name = "bootstrap-js",
files = ["//third_party/javascript/bootstrap:bootstrap_js"],
package_dir = "assets",
strip_prefix = "/third_party/javascript/bootstrap",
)

pkg_tar(
name = "jekyll-tree",
deps = [
":bootstrap-css",
":bootstrap-images",
":bootstrap-js",
":font-awesome-css",
":font-awesome-font",
":jekyll-files",
],
)
1 change: 1 addition & 0 deletions WORKSPACE
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
workspace(name = "build_bazel_blog")
10 changes: 10 additions & 0 deletions _config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
destination: production
markdown: redcarpet
paginate: 10
highlighter: pygments
sass:
sass_dir: _sass
gems: [jekyll-paginate]

main_site_url: https://www.bazel.build
docs_site_url: https://docs.bazel.build
20 changes: 20 additions & 0 deletions _includes/blog-sidebar.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<div class="col-lg-3">
<h2>Twitter</h2>
<p>For more frequent updates, follow us on Twitter.</p>
<p><a class="twitter-follow-button" href="https://twitter.com/bazelbuild" data-show-count="false" data-size="large">Follow @bazelbuild</a></p>
<h2>Discuss</h2>
<p>Join the discussion at our <a href="https://groups.google.com/forum/#!forum/bazel-discuss">mailing list</a>.</p>
<h2>Subscribe</h2>
<p>Subscribe to our blog via the <a href="/blog/feed.xml">RSS Feed</a> or via email:</p>
<div class="well">
<form action="https://feedburner.google.com/fb/a/mailverify" method="post" target="popupwindow" onsubmit="window.open('https://feedburner.google.com/fb/a/mailverify?uri=BazelBlog', 'popupwindow', 'scrollbars=yes,width=550,height=520');return true">
<div class="form-group">
<input type="text" class="form-control" name="email" placeholder="[email protected]">
</div>
<input type="hidden" value="BazelBlog" name="uri">
<input type="hidden" name="loc" value="en_US">
<button type="submit" class="btn btn-primary btn-block">Subscribe</button>
</form>
<p>Delivered by <a href="https://feedburner.google.com" target="_blank">FeedBurner</a></p>
</div>
</div>
6 changes: 6 additions & 0 deletions _includes/blog-twitter-js.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<!--
JavaScript used by the Follow @bazelbuild on Twitter button on the blog sidebar.
Code from: https://dev.twitter.com/web/follow-button
-->

<script>window.twttr=(function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],t=window.twttr||{};if(d.getElementById(id))return;js=d.createElement(s);js.id=id;js.src="https://platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);t._e=[];t.ready=function(f){t._e.push(f);};return t;}(document,"script","twitter-wjs"));</script>
48 changes: 48 additions & 0 deletions _includes/footer.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
<footer class="footer">
<div class="container">
<div class="row">
<div class="col-lg-12">
<p class="text-muted">&copy; 2015 Google</p>
</div>
</div>
</div>
</footer>

<!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
<!-- Include all compiled plugins (below), or include individual files as needed -->
<script src="/assets/js/bootstrap.min.js"></script>

<!-- Anchor JS -->
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/anchor-js/3.2.0/anchor.min.js"></script>
<script>
// Automatically add anchors and links to all header elements that don't already have them.
anchors.add();
</script>

<script>
var shiftWindow = function() {
if (location.hash.length !== 0) {
window.scrollBy(0, -50);
}
};
window.addEventListener("hashchange", shiftWindow);

$(document).ready(function() {
// Scroll to anchor of location hash, adjusted for fixed navbar.
window.setTimeout(function() {
shiftWindow();
}, 1);
});
</script>

<!-- Google Analytics tracking code -->
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');

ga('create', 'UA-61082125-1', 'auto');
ga('send', 'pageview');
</script>
39 changes: 39 additions & 0 deletions _includes/head.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>{{ page.title }} - Bazel Blog</title>

<script>
var current_url = window.location.href;
var http_url = new RegExp("^http://blog.bazel.build/");
if (http_url.test(current_url)) {
window.location.replace(current_url.replace(http_url, "https://blog.bazel.build/"));
}
</script>

<link rel="canonical" href="{{ page.url | replace:'index.html','' | prepend: site_root }}">

<!-- Webfont -->
<link href="//fonts.googleapis.com/css?family=RobotoDraft:300,400,500|Source+Code+Pro:400,500,700" rel="stylesheet">

<link rel="shortcut icon" type="image/png" href="/images/favicon.ico">

<!-- Bootstrap -->
<link href="/assets/css/bootstrap.min.css" rel="stylesheet">
<link href="/assets/css/font-awesome.min.css" rel="stylesheet">

<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->

<!-- Custom stylesheet -->
<link rel="stylesheet" type="text/css" href="/css/main.css" />

<!-- metadata -->
<meta name="og:title" content="{{ page.title }}"/>
<meta name="og:image" content="/images/bazel-og-image.png"/>
</head>
48 changes: 48 additions & 0 deletions _includes/header.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
<nav id="common-nav" class="navbar navbar-inverse navbar-fixed-top">
<div class="container">
<!-- Brand and toggle get grouped for better mobile display -->
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="{{ site.main_site_url }}">
<img src="/images/bazel-navbar.png" height="30px">
</a>
</div>

<!-- Collect the nav links, forms, and other content for toggling -->
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav navbar-right">
<li><a href="https://github.com/bazelbuild/bazel">GitHub</a></li>
</ul>
<form class="navbar-form navbar-right" action="/search.html" id="cse-search-box">
<div class="form-group">
<input type="hidden" name="cx" value="012346921571893344015:xv_nfgpzbu4">
<input type="hidden" name="cof" value="FORID:10">
<input type="hidden" name="ie" value="UTF-8">
<input type="search" name="q" class="form-control input-sm" placeholder="Search">
</div>
</form>
<ul class="nav navbar-nav navbar-right">
<li{% if page.nav == "docs" %} class="active"{% endif %}>
<a href="{{ site.docs_site_url }}/install.html">Docs</a>
</li>
<li{% if page.nav == "contribute" %} class="active"{% endif %}>
<a href="{{ site.main_site_url }}/contributing.html">Contribute!</a>
</li>
<li{% if page.nav == "faq" %} class="active"{% endif %}>
<a href="{{ site.main_site_url }}/faq.html">FAQ</a></li>
<li{% if page.nav == "blog" %} class="active"{% endif %}>
<a href="/">Blog</a>
</li>
<li><a href="http://stackoverflow.com/questions/tagged/bazel" class="nav-icon"><i class="fa fa-stack-overflow"></i></a></li>
<li><a href="https://groups.google.com/forum/#!forum/bazel-discuss" class="nav-icon"><i class="fa fa-envelope"></i></a></li>
<li><a href="https://twitter.com/bazelbuild" class="nav-icon"><i class="fa fa-twitter"></i></a></li>
</ul>
</div><!-- /.navbar-collapse -->
</div><!-- /.container-fluid -->
</nav>

58 changes: 58 additions & 0 deletions _layouts/blog.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
---
nav: blog
---

<!DOCTYPE html>
<html lang="en" itemscope itemtype="https://schema.org/WebPage">
{% include head.html %}
<body>
{% include header.html %}

<div class="page-title-bar">
<div class="container">
<h1>Bazel Blog</h1>
</div>
</div>

<div class="container vpad">
<div class="row">
<div class="col-lg-9">
{{ content }}

<nav aria-label="...">
<ul class="pager">
{% if paginator.previous_page %}
<li class="previous">
<a href="{{ paginator.previous_page_path }}">
<span aria-hidden="true">&larr;</span> Newer
</a>
</li>
{% else %}
<li class="previous disabled">
<a href="#"><span aria-hidden="true">&larr;</span> Newer</a>
</li>
{% endif %}

{% if paginator.next_page %}
<li class="next">
<a href="{{ paginator.next_page_path }}">
Older <span aria-hidden="true">&rarr;</span>
</a>
</li>
{% else %}
<li class="next disabled">
<a href="#">Older <span aria-hidden="true">&rarr;</span></a>
</li>
{% endif %}
</ul>
</nav>
</div>
{% include blog-sidebar.html %}
</div>
</div>

{% include footer.html %}
{% include blog-twitter-js.html %}
</body>
</html>

21 changes: 21 additions & 0 deletions _layouts/default.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<!DOCTYPE html>
<html lang="en" itemscope itemtype="https://schema.org/WebPage">
{% include head.html %}
<body>
{% include header.html %}

{% if page.title %}
<div class="page-title-bar">
<div class="container">
<h1>{{ page.title }}</h1>
</div>
</div>
{% endif %}

<div class="container">
{{ content }}
</div>

{% include footer.html %}
</body>
</html>
Loading

0 comments on commit 8c6e9f7

Please sign in to comment.