Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Blog links refresh #1436

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Empty file removed archetypes/event.md
Empty file.
47 changes: 34 additions & 13 deletions assets/css/master.css
Original file line number Diff line number Diff line change
Expand Up @@ -555,40 +555,61 @@ header .wordmark {
/* ================================================================== */
/* Blog */

.blog-summary {
.blog-title {
margin-bottom: 2rem;
}

.blog-summary a {
display: block;
color: inherit;
.blog-link {
margin-bottom: 2rem;
}

.blog-link-sm {
margin-bottom: 1rem;
}

.blog-summary p.title {
.blog-link-title {
display: block;
color: inherit;
margin-bottom: 0.2rem;
}

.blog-summary p.title-translation {
margin: 0;
padding: 0;
font-size: 0.8rem;
.blog-link-title:hover {
color: inherit;
}

.blog-link-translations {
margin-bottom: 2px;
font-size: 0.875rem;
}

.blog-summary p.title-translation a {
.blog-link-translations a {
text-decoration: none;
color: #0588cb;
}
.blog-summary p.title-translation a:hover {

.blog-link-translations a:hover {
text-decoration: underline;
}

.blog-link-translations a:first-child {
margin-left: 4px;
}

.blog-link-translations a:not(:last-child)::after {
display: inline-block;
content: '•';
color: #000;
margin: 0 4px;
}

h1.article-title {
margin-bottom: 0.2rem;
}

.byline {
color: #c1c1c1;
font-size: 0.8rem;
color: #757575;
font-size: 0.875rem;
margin-bottom: 0;
}

.byline .author::after {
Expand Down
22 changes: 13 additions & 9 deletions layouts/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,15 @@ <h1 class="article-title">{{ .Params.leadTitle }}</h1>
<div class="col-lg-3 col-md-12">
<h2 class="overlined">Research</h2>
</div>
<div class="col-lg-9 col-md-12 blog-summary">
<div class="col-lg-9 col-md-12">
{{ with .Site.Taxonomies.categories.report }}
{{ range first 5 . }}
<a href="{{ .RelPermalink }}">
<p class="title">{{ .Title }}</p>
<p class="byline">{{ .Date.Format "2 Jan 2006" }}</p>
</a>
<div class="blog-link-sm">
<a class="blog-link-title" href="{{ .RelPermalink }}">
{{ .Title }}
</a>
<p class="byline">{{ .Date.Format "2 Jan 2006" }}</p>
</div>
{{ end }}
{{ end }}
<a class="read-more" href="/reports/">View all</a>
Expand Down Expand Up @@ -84,13 +86,15 @@ <h2 class="overlined">Research</h2>
<div class="col-lg-3 col-md-12">
<h2 class="overlined">Blog</h2>
</div>
<div class="col-lg-9 col-md-12 blog-summary">
<div class="col-lg-9 col-md-12">
{{ with .Site.Taxonomies.categories.blog }}
{{ range first 5 . }}
<a href="{{ .RelPermalink }}">
<p class="title">{{ .Title }}</p>
<div class="blog-link-sm">
<a class="blog-link-title" href="{{ .RelPermalink }}">
{{ .Title }}
</a>
<p class="byline">{{ .Date.Format "2 Jan 2006" }}</p>
</a>
</div>
{{ end }}
{{ end }}
<a class="read-more" href="/blog/">View all</a>
Expand Down
21 changes: 21 additions & 0 deletions layouts/partials/language-titles.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{{ $languages := dict
"ar" "Arabic"
"ca" "Catalan"
"de" "German"
"en" "English"
"es" "Spanish"
"fa" "Persian"
"fr" "French"
"pt" "Portuguese"
"ru" "Russian"
"sw" "Swahili"
"tr" "Turkish"
"zh" "Chinese"
"vi" "Vietnamese"
}}

{{ with index $languages . }}
{{ . }}
{{ else }}
{{ . }}
{{ end }}
24 changes: 14 additions & 10 deletions layouts/section/blog.html
Original file line number Diff line number Diff line change
@@ -1,27 +1,31 @@
{{ define "main" }}

<div class="container">
<h1>{{ .Title }}</h1>
<h1 class="blog-title">{{ .Title }}</h1>
<main class="col">
{{ with .Site.Taxonomies.categories.blog }}
{{ range . }}
{{ range .Site.Taxonomies.categories.blog }}

<div class="row blog-summary">
<div class="row blog-link">
<div>
<a href="{{ .RelPermalink }}" style="margin-bottom: 0">
<p class="title">{{ .Title }}</p>
<a href="{{ .RelPermalink }}" class="blog-link-title">
{{ .Title }}
</a>
{{ if .IsTranslated }}
<p class="title-translations">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 class="blog-link-translations">Translations:
{{ range .Translations }}
<a href="{{ .RelPermalink }}">
{{ partial "language-titles.html" .Lang }}
</a>
{{ end }}
</p>
{{ else }}
{{ end }}
<p class="byline" style="margin-bottom: 0">{{ .Date.Format "2 Jan 2006" }}</p>
<p class="byline">{{ .Date.Format "2 Jan 2006" }}</p>
</div>
</div>

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

{{ end }}
{{ end }}
18 changes: 12 additions & 6 deletions layouts/section/post.html
Original file line number Diff line number Diff line change
@@ -1,20 +1,26 @@
{{ define "main" }}

<div class="container">
<h1>Research Reports & Blog Posts</h1>
<h1 class="blog-title">Research Reports & Blog Posts</h1>
<main class="col">
{{ range where .Data.Pages.ByDate.Reverse "Section" "post" }}

<div class="row blog-summary">
<div class="row blog-link">
<div>
<a href="{{ .RelPermalink }}" style="margin-bottom: 0">
<p class="title">{{ .Title }}</p>
<a href="{{ .RelPermalink }}" class="blog-link-title">
{{ .Title }}
</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 class="blog-link-translations">Translations:
{{ range .Translations }}
<a href="{{ .RelPermalink }}">
{{ partial "language-titles.html" .Lang }}
</a>
{{ end }}
</p>
{{ else }}
{{ end }}
<p class="byline">{{ .Date.Format "2 Jan 2006" }}</p>
</div>
</div>

Expand Down
20 changes: 12 additions & 8 deletions layouts/section/reports.html
Original file line number Diff line number Diff line change
@@ -1,27 +1,31 @@
{{ define "main" }}

<div class="container">
<h1>{{ .Title }}</h1>
<h1 class="blog-title">{{ .Title }}</h1>
<main class="col">
{{ range .Site.Taxonomies.categories.report }}

<div class="row blog-summary">
<div class="row blog-link">
<div>
<a href="{{ .RelPermalink }}" style="margin-bottom: 0">
<p class="title">{{ .Title }}</p>
<a href="{{ .RelPermalink }}" class="blog-link-title">
{{ .Title }}
</a>
{{ if .IsTranslated }}
<p class="title-translation">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 class="blog-link-translations">Translations:
{{ range .Translations }}
<a href="{{ .RelPermalink }}">
{{ partial "language-titles.html" .Lang }}
</a>
{{ end }}
</p>
{{ else }}
{{ end }}
<p class="byline" style="margin-bottom: 0">{{ .Date.Format "2 Jan 2006" }}</p>
<p class="byline">{{ .Date.Format "2 Jan 2006" }}</p>
</div>
</div>

{{ end }}
</main>

</div>

{{ end }}
{{ end }}