Skip to content
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
12 changes: 8 additions & 4 deletions config/_default/menu.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,21 +41,25 @@ main:
url: /activities/events/
weight: 1
parent: activities
- identifier: chapters
url: /chapters/
weight: 2
parent: activities
- identifier: mentoring
url: /activities/mentoring/
weight: 2
weight: 3
parent: activities
- identifier: coordinated
url: /activities/gt-coordinated/
weight: 3
weight: 4
parent: activities
- identifier: rladies-blogs
url: /activities/rladies-blogs
weight: 4
weight: 5
parent: activities
- identifier: press
url: /press
weight: 5
weight: 6
parent: activities

- identifier: blog
Expand Down
35 changes: 35 additions & 0 deletions content/activities/chapters/_content.gotmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{{ range $key, $dirArray := site.Data.directory }}

{{ $pageContent := "" }}

{{ $imageURLScratch := newScratch }}

{{ $localPhotoFound := false }}
{{ with $dirArray.photo }}
{{ with .url }}
{{ $imgResource := resources.GetMatch . }}
{{ if $imgResource }}
{{ $processedImage := $imgResource.Fill "300x300" }}
{{ $imageURLScratch.Set "img" $processedImage.Permalink }}
{{ $localPhotoFound = true }}
{{ end }}
{{ end }}
{{ end }}

{{ if not $localPhotoFound }}
{{ $gravatarHash := md5 $dirArray.name }}
{{ $imageURLScratch.Set "img" (printf "https://www.gravatar.com/avatar/%s?s=300&d=identicon" $gravatarHash) }}
{{ end }}

{{ $speakerParams := $dirArray | merge (dict "image" ($imageURLScratch.Get "img") "directory_id" $key) }}

{{ $page := dict
"content" (dict "mediaType" "text/markdown" "value" $pageContent)
"kind" "page"
"path" $key
"title" $dirArray.name
"params" $speakerParams
}}

{{ $.AddPage $page }}
{{ end }}
21 changes: 21 additions & 0 deletions content/chapters/_content.gotmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@

{{ range $key, $chapterDataArray := site.Data.chapters }}
{{ $chapterObj := "" }}

{{ if (and (reflect.IsSlice $chapterDataArray) (gt (len $chapterDataArray) 0)) }}
{{ $chapterObj = index $chapterDataArray 0 }}
{{ else }}
{{ errorf "Chapter data for key '%s' in data/chapters/ is not a non-empty array. Please check its JSON structure." $key }}
{{ end }}


{{ $page := dict
"content" (dict "mediaType" "text/markdown" "value" "")
"kind" "page"
"path" (printf "%s" $chapterObj.urlname)
"title" (printf "R-Ladies %s" $chapterObj.city)
"params" $chapterObj
}}

{{ $.AddPage $page }}
{{ end }}
5 changes: 5 additions & 0 deletions content/chapters/_index.en.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
title: "Chapters"
---

If you are interested in starting an R-Ladies meetup group in your city, or would like more information about starting a meetup group, reach out at chapters[at]rladies[dot]org
5 changes: 5 additions & 0 deletions content/chapters/_index.es.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
title: "Capítulos"
---

Si tienes interés en fundar un grupo de R-Ladies en tu ciudad o quieres más información sobre cómo hacer para comenzar uno, nos puedes contactar en chapters[at]rladies[dot]org
4 changes: 2 additions & 2 deletions data/chapter_stats.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"chapters": 225,
"countries": 65
"chapters": 381,
"countries": 90
}
Loading