Skip to content

Commit

Permalink
Refactor the website to make use of the baseof
Browse files Browse the repository at this point in the history
This fixes: #296
  • Loading branch information
hellais committed Feb 6, 2020
1 parent 27e930d commit 0ec93c8
Show file tree
Hide file tree
Showing 16 changed files with 214 additions and 325 deletions.
4 changes: 3 additions & 1 deletion content/get-involved/run.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# Thematic OONI Probe testing
---
title: Thematic OONI Probe testing
---

Social media, news websites, and VPNs often get blocked during political events (such as elections or protests) around the world.

Expand Down
161 changes: 161 additions & 0 deletions layouts/_default/baseof.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,161 @@
<!DOCTYPE html>
{{ $basePrefix := .Scratch.Get "basePrefix" }}
<html lang="en">
<head>
<meta charset="utf-8"/>
<meta name='viewport' content='initial-scale=1.0, width=device-width'/>
{{ if .RSSLink }}
<link href="{{ .RSSLink }}" rel="feed" type="application/rss+xml" title="{{ .Site.Title }}" />
{{ end }}
<title>{{if .IsHome}}{{ $.Site.Title }}{{else}}{{.Title}} | OONI {{end}}</title>

<link rel="canonical" href="https://ooni.org/" />
<meta name='description' content="Open Observatory of Network Interference (OONI). A free software, global observation network for detecting censorship, surveillance and traffic manipulation on the internet" />
<meta name='og:title' property='og:title' content='OONI - Open Observatory of Network Interference' />
<meta property="og:description" content="Open Observatory of Network Interference (OONI). A free software, global observation network for detecting censorship, surveillance and traffic manipulation on the internet" />
<meta property='og:type' content='website' />
{{ if eq .Lang "ar" }}<link rel="stylesheet" href="/css/rtl.css">{{ end }}

<link rel="stylesheet" href="/fonts/fonts.css"/>

{{ $bootstrapReboot := resources.Get "vendor/bootstrap-reboot.css" }}
{{ $bootstrapGrid := resources.Get "vendor/bootstrap-grid.css" }}
{{ $bootstrap := slice $bootstrapReboot $bootstrapGrid | resources.Concat "css/bootstrap.css" | resources.Minify | resources.Fingerprint }}

<link rel="stylesheet" href="{{ $bootstrap.Permalink }}">
<link rel="stylesheet" href="/css/master.css"/>
<link rel="stylesheet" href="/css/event.css"/>
<link rel="stylesheet" href="/css/highlight-default.min.css">
<link rel="icon" type="image/png" href="/images/favicon.png"/>
<script src="/js/highlight.min.js"></script>
<script src="/js/zepto.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/ooni-run/dist/widgets.js"></script>
<script>hljs.initHighlightingOnLoad();</script>
<!-- Piwik -->

<!-- Matomo -->
<script type="text/javascript">
var _paq = window._paq || [];
/* tracker methods like "setCustomDimension" should be called before "trackPageView" */
_paq.push(['trackPageView']);
_paq.push(['enableLinkTracking']);
(function() {
var u="//matomo.ooni.org/";
_paq.push(['setTrackerUrl', u+'matomo.php']);
_paq.push(['setSiteId', '1']);
var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
g.type='text/javascript'; g.async=true; g.defer=true; g.src=u+'matomo.js'; s.parentNode.insertBefore(g,s);
})();
</script>
<!-- End Matomo Code -->
</head>
<body>

{{ block "navbar" . }}

{{ $selectedMenu := split .URL "/" }}
<nav class="container">
<div class="col-4">
<a href="/">
<img class="logo" src="/images/ooni-header-mascot.png" width="25" height="25"/>
<img class="wordmark" src="/images/wordmark.png" alt="OONI" height="14" width="53"/>
</a>
</div>
<div class="col-8">
<div class="nav-menu">
<a href="/about/"
{{ if in $selectedMenu "about" }}
class="active"
{{end}}
>About</a>
<a href="/install/"
{{ if in $selectedMenu "install" }}
class="active"
{{end}}
>Install</a>
<a href="/nettest/"
{{ if in $selectedMenu "nettest" }}
class="active"
{{end}}
>Tests</a>
<a href="/data/"
{{ if in $selectedMenu "data" }}
class="active"
{{end}}
>Data</a>
<a href="/get-involved/"
{{ if in $selectedMenu "get-involved" }}
class="active"
{{end}}
>Get Involved</a>
<a href="/reports/"
{{ if in $selectedMenu "reports" }}
class="active"
{{end}}
>Reports</a>
<a href="/post/"
{{ if in $selectedMenu "post" }}
class="active"
{{end}}
>Blog</a>
</div>
</div>
</nav>
{{ end }}

{{ block "main" . }}
<!-- The part of the page that begins to differ between templates -->
{{ end }}

{{ block "footer" . }}
<footer class="p-4">
<div class="container">
<div class="row">
<div class="col-4">
<div class="pb-2">
<img src="/images/OONI-HorizontalMonochromeInverted.svg" height="32px"/>
</div>
<div class="pb-4">Global community measuring internet censorship around the world.</div>
<div class="">
<div>© 2020 Open Observatory of Network Interference (OONI)</div>
<div class="">
<a href="https://github.com/ooni/license">Content available under a Creative Commons license.</a>
</div>
</div>

</div>

<div class="col-8">
<div class="row">
<div class="col">
<div class="footer-section-title">About</div>
<div class="footer-item"><a href="/about/">OONI</a></div>
<div class="footer-item"><a href="/about/data-policy/">Data Policy</a></div>
<div class="footer-item"><a class="" href="https://github.com/ooni/license/tree/master/data">Data License</a></div>
<div class="footer-item"><a class="" href="/about/#contact">Contact</a></div>
</div>

<div class="col">
<div class="footer-section-title">OONI Probe</div>
<div class="footer-item"><a href="https://ooni.io/install/">Install</a></div>
<div class="footer-item"><a href="https://ooni.io/nettest/">Tests</a></div>
<div class="footer-item"><a href="https://github.com/ooni">Source code</a></div>
<div class="footer-item"><a href="https://api.ooni.io/">API</a></div>
</div>
<div class="col">
<div class="footer-section-title">Updates</div>
<div class="footer-item"><a href="/post/">Blog</a></div>
<div class="footer-item"><a href="https://twitter.com/OpenObservatory">Twitter</a></div>
<div class="footer-item"><a href="https://lists.torproject.org/cgi-bin/mailman/listinfo/ooni-talk">Mailing list</a></div>
<div class="footer-item"><a href="https://ooni.slack.org/">Slack</a></div>
</div>
</div>

</div>
</div>
</div>
</footer>
{{ end }}

</body>
</html>
18 changes: 2 additions & 16 deletions layouts/_default/single.html
Original file line number Diff line number Diff line change
@@ -1,18 +1,5 @@
{{ partial "head.html" }}

{{ define "main" }}
<div class="container">
<nav>
<div class="col-4">
<a href="/">
<img class="logo" src="/images/ooni-header-mascot.png" width="25" height="25"/>
<img class="wordmark" src="/images/wordmark.png" alt="OONI" height="14" width="53"/>
</a>
</div>
<div class="col-8">
{{ partial "nav.html" }}
</div>
</nav>

<main class="col content">
{{ if .Title }}
<h1 class="article-title">{{ .Title }}</h1>
Expand All @@ -24,5 +11,4 @@ <h1 class="article-title">{{ .Title }}</h1>
{{ .Content }}
</main>
</div>

{{ partial "footer.html" . }}
{{ end }}
39 changes: 28 additions & 11 deletions layouts/index.html
Original file line number Diff line number Diff line change
@@ -1,17 +1,34 @@
{{ partial "head.html" . }}
<body class="homepage">
{{ define "navbar" }}
<nav class="container">
<div class="col-3">
</div>
<div class="col-9">
<div class="nav-menu">
<a href="/about/"
>About</a>
<a href="/install/"
>Install</a>
<a href="/nettest/"
>Tests</a>
<a href="/data/"
>Data</a>
<a href="/get-involved/"
>Get Involved</a>
<a href="/reports/"
>Reports</a>
<a href="/post/"
>Blog</a>
</div>
</div>
</nav>
{{ end }}
{{ define "main" }}
<div class="homepage">

<a href="https://github.com/ooni">
<img class="fork-me" style="position: absolute; top: 0; left: 0; border: 0;" src="/images/forkme_left_gray_6d6d6d.png" alt="Fork me on GitHub"/>
</a>
<div class="container">
<nav>
<div class="col-3"></div>
<div class="col-9">
{{ partial "nav.html" }}
</div>
</nav>

<header>
<div class="row">
<div class="col-3 mt-5">
Expand Down Expand Up @@ -218,5 +235,5 @@ <h2>Friends and Sponsors</h2>
</div>
</div>
</div>

{{ partial "footer.html" . }}
</div>
{{ end }}
23 changes: 4 additions & 19 deletions layouts/nettest/single.html
Original file line number Diff line number Diff line change
@@ -1,21 +1,6 @@
{{ .Scratch.Set "basePrefix" "../../" }}
{{ partial "head.html" . }}

<body class="article">
{{ define "main" }}
<div class="article">
<div class="container">

<nav>
<div class="col-4">
<a href="/">
<img class="logo" src="/images/ooni-header-mascot.png" width="25" height="25"/>
<img class="wordmark" src="/images/wordmark.png" alt="OONI" height="14" width="53"/>
</a>
</div>
<div class="col-8">
{{ partial "nav.html" . }}
</div>
</nav>

<div class="row">
<div class="col-4 toc">
<a href="/nettest/">
Expand All @@ -29,5 +14,5 @@
</div>
</div>

</body>
</html>
</div>
{{ end }}
50 changes: 0 additions & 50 deletions layouts/partials/footer.html

This file was deleted.

52 changes: 0 additions & 52 deletions layouts/partials/head.html

This file was deleted.

Loading

0 comments on commit 0ec93c8

Please sign in to comment.