Skip to content

Commit

Permalink
Split reports and blog sections
Browse files Browse the repository at this point in the history
  • Loading branch information
hellais committed Nov 16, 2019
1 parent bdcd374 commit 131dc23
Show file tree
Hide file tree
Showing 7 changed files with 60 additions and 20 deletions.
6 changes: 0 additions & 6 deletions content/data/content.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
---
aliases:
- /reports
- /reports/0.1/
---

## This URL is old

Raw ooniprobe measurements now live at:
Expand Down
1 change: 1 addition & 0 deletions content/reports/content.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

6 changes: 4 additions & 2 deletions layouts/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ <h2>Measure internet censorship</h2>
<div class="container">
<h2>Recent Reports</h2>
<hr />
{{ range first 5 (where (where .Site.Pages.ByDate.Reverse "Section" "post") "Kind" "page") }}
{{ range first 5 .Site.Taxonomies.categories.report }}
<div class="row">
<a class="report-link" href="{{ .RelPermalink }}">
<p class="title">{{ .Title }}</p>
Expand Down Expand Up @@ -72,14 +72,16 @@ <h2>Uncover evidence of internet censorship worldwide</h2>
<div class="container">
<h2>Recent News</h2>
<hr />
{{ range first 5 (where (where .Site.Pages.ByDate.Reverse "Section" "post") "Kind" "page") }}
{{ with .Site.Taxonomies.categories.blog }}
{{ range first 5 . }}
<div class="row">
<a class="report-link" href="{{ .RelPermalink }}">
<p class="title">{{ .Title }}</p>
<p class="date">{{ .Date.Format "2 Jan 2006" }}</p>
</a>
</div>
{{ end }}
{{ end }}
<a class="learn-more" href="/post/">View All</a>
</div>
</div>
Expand Down
20 changes: 13 additions & 7 deletions layouts/partials/nav.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,12 @@
<img src="/images/homepage/OONI-HorizontalMonochromeInverted.png" srcset="[email protected] 2x" alt="OONI logo" />
</a>
</div>
<div class="col-2">
<div class="col-4 nav-items">
<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"
Expand All @@ -33,12 +28,23 @@
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>

<a href="/install/"
{{ if in $selectedMenu "install" }}
class="active btn btn-small"
{{ else }}
class="btn btn-small"
{{end}}
>Install OONI Probe</a>
</div>
</div>
</nav>
4 changes: 3 additions & 1 deletion layouts/section/post.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
<div class="container">
<main class="col-3">
<h2>Blog posts</h2>
{{ range where .Data.Pages.ByDate.Reverse "Section" "post" }}
{{ with .Site.Taxonomies.categories.blog }}
{{ range . }}

<div class="row blog-summary">
<div>
Expand All @@ -22,6 +23,7 @@ <h2>Blog posts</h2>
</div>

{{ end }}
{{ end }}
</main>

</div>
Expand Down
30 changes: 30 additions & 0 deletions layouts/section/reports.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{{ .Scratch.Set "basePrefix" "../../" }}
{{ partial "head.html" . }}

{{ partial "nav.html" . }}
<div class="container">
<main class="col-3">
<h2>Research reports</h2>

{{ range .Site.Taxonomies.categories.report }}

<div class="row blog-summary">
<div>
<a href="{{ .RelPermalink }}" style="margin-bottom: 0">
<p class="title">{{ .Title }}</p>
</a>
<p class="byline" style="margin-bottom: 0">{{ .Date.Format "2 Jan 2006" }}</p>
{{ if .IsTranslated }}
<p>Translations: {{ range .Translations }}<a style="display: inline-block;margin-bottom: 0;padding-right: 10px" href="{{ .RelPermalink }}">{{ if eq .Lang "en" }}English{{ else if eq .Lang "pt" }}Portuguese{{ else if eq .Lang "fr" }}French{{ else if eq .Lang "es" }}Spanish{{ else if eq .Lang "ca" }}Catalan{{ else }}{{ .Lang }}{{ end }}</a>{{ end }}
</p>
{{ else }}
{{ end }}
</div>
</div>

{{ end }}
</main>

</div>

{{ partial "footer.html" . }}
13 changes: 9 additions & 4 deletions static/css/master.css
Original file line number Diff line number Diff line change
Expand Up @@ -478,19 +478,19 @@ td:last-child {
/* ================================================================== */
/* Navigation */

nav .col-2 {
nav .nav-items {
flex: 1 1;
}

nav .col-2 a {
nav .nav-items a {
color: white;
}

nav .col-2 a:hover {
nav .nav-items a:hover {
border-bottom: 2px solid white;
}

nav .col-2 a.active {
nav .nav-items a.active {
color: white;
border-bottom: 2px solid white;
}
Expand Down Expand Up @@ -1000,6 +1000,11 @@ pre span.lw {
color: #0588CB;
}

.btn-small {
font-size: 0.8em;
padding: 6px 5px;
}

/* Tests section */
p.test-intro {
margin-top: 1.6em;
Expand Down

0 comments on commit 131dc23

Please sign in to comment.