Skip to content

Commit

Permalink
Separate blog posts from research reports
Browse files Browse the repository at this point in the history
  • Loading branch information
hellais committed Feb 6, 2020
1 parent befb88c commit 27e930d
Show file tree
Hide file tree
Showing 5 changed files with 71 additions and 5 deletions.
Empty file added content/reports/content.md
Empty file.
24 changes: 21 additions & 3 deletions layouts/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -88,19 +88,37 @@ <h2 class="overlined">How OONI Works</h2>
</div>


<div class="container"> <!-- Container Wrap till the end -->
<div class="container">
<div class="row pad-below">
<div class="col-3">
<h2 class="overlined">Research Reports</h2>
</div>
<div class="col-9 blog-summary">
{{ range first 5 .Site.Taxonomies.categories.report }}
<a href="{{ .RelPermalink }}">
<p class="title">{{ .Title }}</p>
<p class="byline">{{ .Date.Format "2 Jan 2006" }}</p>
</a>
{{ end }}
<a class="read-more" href="/post/">View all</a>
</div>
</div>


<div class="row pad-below">
<div class="col-3">
<h2 class="overlined">Blog Posts</h2>
</div>
<div class="col-9 blog-summary">
{{ range first 5 (where (where .Site.Pages.ByDate.Reverse "Section" "post") "Kind" "page") }}
{{ with .Site.Taxonomies.categories.blog }}
{{ range first 5 . }}
<a href="{{ .RelPermalink }}">
<p class="title">{{ .Title }}</p>
<p class="byline">{{ .Date.Format "2 Jan 2006" }}</p>
</a>
{{ end }}
<a class="read-more" href="/post/">Read More</a>
{{ end }}
<a class="read-more" href="/post/">View all</a>
</div>
</div>

Expand Down
5 changes: 5 additions & 0 deletions layouts/partials/nav.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@
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"
Expand Down
6 changes: 4 additions & 2 deletions layouts/section/post.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,10 @@
</div>
</nav>

<h1>Blog posts</h1>
<main class="col">
<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 @@ -34,6 +35,7 @@ <h2>Blog posts</h2>
</div>

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

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

<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>

<h1>Research reports</h1>
<main class="col">
{{ 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" . }}

0 comments on commit 27e930d

Please sign in to comment.