diff --git a/jargon.txt b/jargon.txt index 02b5a954173..1a2fee84912 100644 --- a/jargon.txt +++ b/jargon.txt @@ -136,6 +136,7 @@ lang Larsson Latvia latvia +lcase leadBy Lectorate len @@ -193,6 +194,7 @@ pathlib pdf PDFs pe +peertube PeerTube peru ph diff --git a/templates/fediverse-statistics.html b/templates/fediverse-statistics.html index 04b26ad92c4..53ebef99cc2 100644 --- a/templates/fediverse-statistics.html +++ b/templates/fediverse-statistics.html @@ -1,4 +1,3 @@ - {{ template "layout" . }} {{ define "title" }}Fediverse Statistics - Govdirectory{{ end }} @@ -129,7 +128,7 @@

Platform popularity

Coverage by country

-

The table below shows which countries have government organizations using the Fediverse, along with the number of organizations and Fediverse accounts per country.

+

The table below shows which countries have government organizations using the Fediverse, along with the number of organizations and Fediverse accounts per country. The numbers link to the country in question filtered down to its organizations on the Fediverse.

@@ -137,10 +136,12 @@

Coverage by country

- + {{- range . -}} {{- $country_fediverse_count := 0 -}} {{- $country_org_count := 0 -}} + {{- /* the Fediverse platforms of the country as a comma separated list for the platform keyword of the country page search */ -}} + {{- $country_platforms := "" -}} {{- $country := .safeName.String -}} {{- $orgs := query (join "" "generators/" $country ".rq") -}} {{- range $orgs -}} @@ -150,6 +151,15 @@

Coverage by country

{{- if eq .isFediverse.String "true" -}} {{- $has_fediverse = true -}} {{- $country_fediverse_count = add1 $country_fediverse_count -}} + {{- /* platform names are normalized the way the search does it, "PeerTube" becomes "peertube" */ -}} + {{- $platform := lcase (re_replace .platformLabel.String "[^A-Za-z0-9]" "") -}} + {{- if not (contains (printf ",%s," $country_platforms) (printf ",%s," $platform)) -}} + {{- if $country_platforms -}} + {{- $country_platforms = printf "%s,%s" $country_platforms $platform -}} + {{- else -}} + {{- $country_platforms = $platform -}} + {{- end -}} + {{- end -}} {{- end -}} {{- end -}} {{- if $has_fediverse -}} @@ -157,10 +167,12 @@

Coverage by country

{{- end -}} {{- end -}} {{- if gt $country_org_count 0 -}} - + {{- $filtered_country_url := printf "../../%s/?query=platform:%s" $country $country_platforms -}} + + - - + + {{- end -}} {{- end -}}
Contains Organizations Accounts
{{ .name }}
{{ .name }} {{ .description }}{{ $country_org_count }}{{ $country_fediverse_count }}{{ $country_org_count }}{{ $country_fediverse_count }}