aboutsummaryrefslogtreecommitdiffhomepage
path: root/site/_includes/head.html
blob: bfb266f3f26d874ec5bd4c808d6a31b3a9c72626 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
  <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</title>

    <script>
      var current_url = window.location.href;
      var bad_url = new RegExp("^https?://(bazelbuild.github.io/bazel|bazel.io)/");
      if (bad_url.test(current_url)) {
        window.location.replace(current_url.replace(bad_url, "https://bazel.build/"));
      }
      var http_url = new RegExp("^http://(www\.)?bazel.build/");
      if (http_url.test(current_url)) {
        window.location.replace(current_url.replace(http_url, "https://bazel.build/"));
      }
      // Do a shortcut so that be.bazel.build redirect to the build encyclopedia
      var be_url = new RegExp("^https?://be(\.bazel.build)?/?");
      if (be_url.test(current_url)) {
        window.location.replace(current_url.replace(be_url, "https://bazel.build/docs"));
      }
      var be_url = new RegExp("^https?://be(\.bazel.build)?/([a-zA-Z0-9_-]+)([/#](.*))?");
      if (be_url.test(current_url)) {
        window.location.replace(current_url.replace(be_url, "https://bazel.build/docs/be/$3.html#$5"));
      }
      // And a short to code reviews
      var cr_url = new RegExp("^https?://cr(\.bazel.build)?/([0-9]+)")
      if (cr_url.test(current_url)) {
        window.location.replace(current_url.replace(cr_url, "https://bazel-review.googlesource.com/c/$2"));
      }
      // Code review dashboard
      var cr_url = new RegExp("^https?://cr(\.bazel.build)?/?")
      if (cr_url.test(current_url)) {
        window.location.replace(current_url.replace(cr_url, "https://bazel-review.googlesource.com/"));
      }
    </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>