diff --git a/website/themes/beastie/layouts/_default/list.ics b/website/themes/beastie/layouts/_default/list.ics index abe43c5c00..f6adf934ca 100644 --- a/website/themes/beastie/layouts/_default/list.ics +++ b/website/themes/beastie/layouts/_default/list.ics @@ -1,15 +1,15 @@ BEGIN:VCALENDAR VERSION:2.0 PRODID:-//FreeBSD//events calendar//EN CALSCALE:GREGORIAN -METHOD:PUBLISH{{ $data := index .Site.Data .Sites.First.Language.Lang }}{{ $eventsData := $data }}{{ with $eventsData }}{{ range (sort .events "year" "desc") }}{{ range (sort .events "startDate" "desc") }} +METHOD:PUBLISH{{ $data := index .Site.Data .Sites.Default.Language.Lang }}{{ $eventsData := $data }}{{ with $eventsData }}{{ range (sort .events "year" "desc") }}{{ range (sort .events "startDate" "desc") }} BEGIN:VEVENT UID:{{ .id }} SUMMARY:{{ .name }} URL;VALUE=URI:{{ .url }} LOCATION:{{ .site }}, {{ .city }}, {{ .country }} DTSTART;VALUE=DATE:{{ dateFormat "20060102" .startDate }} DTEND;VALUE=DATE:{{ dateFormat "20060102" .endDate }} DESCRIPTION:{{ .description }} END:VEVENT{{ end }}{{ end }}{{ end }} END:VCALENDAR diff --git a/website/themes/beastie/layouts/events/list.html b/website/themes/beastie/layouts/events/list.html index 6d729b3328..97faff7303 100644 --- a/website/themes/beastie/layouts/events/list.html +++ b/website/themes/beastie/layouts/events/list.html @@ -1,269 +1,269 @@ {{ define "main" }}
{{ partial "sidenav.html" (dict "sidenavType" .Params.sidenav "data" .Site.Data "language" $.Site.Language.Lang ) }}

{{ .Title }}

{{- .Content -}} {{ $eventsPath := (printf "data/%s/events/events%s.toml" $.Language.Lang (dateFormat "2006" now)) }} {{ $eventsData := "" }} {{ if (fileExists $eventsPath) -}} {{ $data := index .Site.Data $.Language.Lang }} {{ $eventsData = $data }} {{ else }} - {{ $dataDefaultLanguage := index .Site.Data .Sites.First.Language.Lang }} + {{ $dataDefaultLanguage := index .Site.Data .Sites.Default.Language.Lang }} {{ $eventsData = $dataDefaultLanguage }} {{ end }} {{ $countriesCodes := slice }} {{ $countriesCodesTimes := newScratch }} {{ with $eventsData }} {{ range (sort .events "year" "desc") }} {{ range .events }} {{ if .countryCode }} {{ $countriesCodes = $countriesCodes | append .countryCode }} {{ if $countriesCodesTimes.Get .countryCode }} {{ $countriesCodesTimes.Add .countryCode 1 }} {{ else }} {{ $countriesCodesTimes.Set .countryCode 1 }} {{ end }} {{ end }} {{ end }} {{ end }} {{ end }} {{ $countriesCodes = $countriesCodes | uniq }} {{ $countriesTimes := slice }} {{ range $element := $countriesCodes }} {{ $countriesTimes = $countriesTimes | append ($countriesCodesTimes.Get .) }} {{ end }} {{ $eventsImageUrl := (printf "https://chart.googleapis.com/chart?cht=t&chs=400x200&chtm=world&chco=ffffff,ffbe38,600000&chf=bg,s,4D89F9&chd=t:%s&chld=%s" (delimit $countriesTimes ",") (delimit $countriesCodes "")) }} events map {{ $eventsCounter := 0 }} {{ if isset .Params "year" }} {{ else }} {{ $yearsMonthsCP := slice }} {{ with $eventsData }} {{ range first 3 (sort .events "year" "desc") }} {{ range (sort .events "startDate" "asc") }} {{ if ge (dateFormat "20060102" .endDate) (dateFormat "20060102" now) }} {{ $yearsMonthsCP = $yearsMonthsCP | append (dateFormat "2006-1" .endDate) }} {{ end }} {{ end }} {{ end }} {{ end }} {{ $yearsMonthsPast := slice }} {{ with $eventsData }} {{ range first 3 (sort .events "year" "desc") }} {{ range (sort .events "startDate" "asc") }} {{ if lt (dateFormat "20060102" .endDate) (dateFormat "20060102" now) }} {{ $yearsMonthsPast = $yearsMonthsPast | append (dateFormat "2006-1" .endDate) }} {{ end }} {{ end }} {{ end }} {{ end }} {{ $yearsMonthsCP = $yearsMonthsCP | uniq }} {{ $yearsMonthsPast = $yearsMonthsPast | uniq }} {{ $maxYear := now.Year }} {{ $maxYear = add $maxYear 1}} {{ $minYear := now.Year }} {{ $minYear = sub $minYear 2}}

{{ i18n "currentEvents" }}

{{ range $year := seq $minYear $maxYear }} {{ range $month := seq 1 12 }} {{ $yearMonth := (printf "%d-%d" $year $month) }} {{ if in $yearsMonthsCP $yearMonth }}

{{ i18n $month }} {{ $year }}

{{ with $eventsData }} {{ end }} {{ end }} {{ end }} {{ end }}

{{ i18n "pastEvents" }}

{{ range $year := seq now.Year $minYear }} {{ range $month := seq 12 1 }} {{ $yearMonth := (printf "%d-%d" $year $month) }} {{ if in $yearsMonthsPast $yearMonth }}

{{ i18n $month }} {{ $year }}

{{ with $eventsData }} {{ end }} {{ end }} {{ end }} {{ end }} {{ end }} {{ if isset .Params "year" }} {{ $year := .Params.year }} {{ $eventsYear := (printf "events%d" $year) }} {{ $eventsSelectedYear := index $eventsData.events $eventsYear }} {{ $yearsMonthsSelected := slice }} {{ with $eventsSelectedYear }} {{ range (sort .events "startDate" "asc") }} {{ $yearsMonthsSelected = $yearsMonthsSelected | append (dateFormat "2006-1" .endDate) }} {{ end }} {{ end }} {{ $yearsMonthsSelected = $yearsMonthsSelected | uniq }}

{{ i18n "pastEvents" }}

{{ range $month := seq 12 1 }} {{ $yearMonth := (printf "%d-%d" $year $month) }} {{ if in $yearsMonthsSelected $yearMonth }}

{{ i18n $month }} {{ $year }}

{{ with $eventsSelectedYear }} {{ end }} {{ end }} {{ end }} {{ end }}

Events from past years:

{{ if .GitInfo }}

{{ i18n "last-modified" }}: {{ .GitInfo.AuthorDate | time.Format ":date_long" }} {{ i18n "by" }} {{ .GitInfo.AuthorName }}

{{ end }}
{{ end }} diff --git a/website/themes/beastie/layouts/events/list.ics b/website/themes/beastie/layouts/events/list.ics index abe43c5c00..f6adf934ca 100644 --- a/website/themes/beastie/layouts/events/list.ics +++ b/website/themes/beastie/layouts/events/list.ics @@ -1,15 +1,15 @@ BEGIN:VCALENDAR VERSION:2.0 PRODID:-//FreeBSD//events calendar//EN CALSCALE:GREGORIAN -METHOD:PUBLISH{{ $data := index .Site.Data .Sites.First.Language.Lang }}{{ $eventsData := $data }}{{ with $eventsData }}{{ range (sort .events "year" "desc") }}{{ range (sort .events "startDate" "desc") }} +METHOD:PUBLISH{{ $data := index .Site.Data .Sites.Default.Language.Lang }}{{ $eventsData := $data }}{{ with $eventsData }}{{ range (sort .events "year" "desc") }}{{ range (sort .events "startDate" "desc") }} BEGIN:VEVENT UID:{{ .id }} SUMMARY:{{ .name }} URL;VALUE=URI:{{ .url }} LOCATION:{{ .site }}, {{ .city }}, {{ .country }} DTSTART;VALUE=DATE:{{ dateFormat "20060102" .startDate }} DTEND;VALUE=DATE:{{ dateFormat "20060102" .endDate }} DESCRIPTION:{{ .description }} END:VEVENT{{ end }}{{ end }}{{ end }} END:VCALENDAR diff --git a/website/themes/beastie/layouts/events/single.html b/website/themes/beastie/layouts/events/single.html index dc702fe43a..542de502f2 100644 --- a/website/themes/beastie/layouts/events/single.html +++ b/website/themes/beastie/layouts/events/single.html @@ -1,269 +1,269 @@ {{ define "main" }}
{{ partial "sidenav.html" (dict "sidenavType" .Params.sidenav "data" .Site.Data "language" $.Site.Language.Lang ) }}

{{ .Title }}

{{- .Content -}} {{ $eventsPath := (printf "data/%s/events/events%s.toml" $.Language.Lang (dateFormat "2006" now)) }} {{ $eventsData := "" }} {{ if (fileExists $eventsPath) -}} {{ $data := index .Site.Data $.Language.Lang }} {{ $eventsData = $data }} {{ else }} - {{ $dataDefaultLanguage := index .Site.Data .Sites.First.Language.Lang }} + {{ $dataDefaultLanguage := index .Site.Data .Sites.Default.Language.Lang }} {{ $eventsData = $dataDefaultLanguage }} {{ end }} {{ $countriesCodes := slice }} {{ $countriesCodesTimes := newScratch }} {{ with $eventsData }} {{ range (sort .events "year" "desc") }} {{ range .events }} {{ if .countryCode }} {{ $countriesCodes = $countriesCodes | append .countryCode }} {{ if $countriesCodesTimes.Get .countryCode }} {{ $countriesCodesTimes.Add .countryCode 1 }} {{ else }} {{ $countriesCodesTimes.Set .countryCode 1 }} {{ end }} {{ end }} {{ end }} {{ end }} {{ end }} {{ $countriesCodes = $countriesCodes | uniq }} {{ $countriesTimes := slice }} {{ range $element := $countriesCodes }} {{ $countriesTimes = $countriesTimes | append ($countriesCodesTimes.Get .) }} {{ end }} {{ $eventsImageUrl := (printf "https://chart.googleapis.com/chart?cht=t&chs=400x200&chtm=world&chco=ffffff,ffbe38,600000&chf=bg,s,4D89F9&chd=t:%s&chld=%s" (delimit $countriesTimes ",") (delimit $countriesCodes "")) }} events map {{ $eventsCounter := 0 }} {{ if isset .Params "year" }} {{ else }} {{ $yearsMonthsCP := slice }} {{ with $eventsData }} {{ range first 3 (sort .events "year" "desc") }} {{ range (sort .events "startDate" "asc") }} {{ if ge (dateFormat "20060102" .endDate) (dateFormat "20060102" now) }} {{ $yearsMonthsCP = $yearsMonthsCP | append (dateFormat "2006-1" .endDate) }} {{ end }} {{ end }} {{ end }} {{ end }} {{ $yearsMonthsPast := slice }} {{ with $eventsData }} {{ range first 3 (sort .events "year" "desc") }} {{ range (sort .events "startDate" "asc") }} {{ if lt (dateFormat "20060102" .endDate) (dateFormat "20060102" now) }} {{ $yearsMonthsPast = $yearsMonthsPast | append (dateFormat "2006-1" .endDate) }} {{ end }} {{ end }} {{ end }} {{ end }} {{ $yearsMonthsCP = $yearsMonthsCP | uniq }} {{ $yearsMonthsPast = $yearsMonthsPast | uniq }} {{ $maxYear := now.Year }} {{ $maxYear = add $maxYear 1}} {{ $minYear := now.Year }} {{ $minYear = sub $minYear 2}}

{{ i18n "currentEvents" }}

{{ range $year := seq $minYear $maxYear }} {{ range $month := seq 1 12 }} {{ $yearMonth := (printf "%d-%d" $year $month) }} {{ if in $yearsMonthsCP $yearMonth }}

{{ i18n $month }} {{ $year }}

{{ with $eventsData }} {{ end }} {{ end }} {{ end }} {{ end }}

{{ i18n "pastEvents" }}

{{ range $year := seq now.Year $minYear }} {{ range $month := seq 12 1 }} {{ $yearMonth := (printf "%d-%d" $year $month) }} {{ if in $yearsMonthsPast $yearMonth }}

{{ i18n $month }} {{ $year }}

{{ with $eventsData }} {{ end }} {{ end }} {{ end }} {{ end }} {{ end }} {{ if isset .Params "year" }} {{ $year := .Params.year }} {{ $eventsYear := (printf "events%d" $year) }} {{ $eventsSelectedYear := index $eventsData.events $eventsYear }} {{ $yearsMonthsSelected := slice }} {{ with $eventsSelectedYear }} {{ range (sort .events "startDate" "asc") }} {{ $yearsMonthsSelected = $yearsMonthsSelected | append (dateFormat "2006-1" .endDate) }} {{ end }} {{ end }} {{ $yearsMonthsSelected = $yearsMonthsSelected | uniq }}

{{ i18n "pastEvents" }}

{{ range $month := seq 12 1 }} {{ $yearMonth := (printf "%d-%d" $year $month) }} {{ if in $yearsMonthsSelected $yearMonth }}

{{ i18n $month }} {{ $year }}

{{ with $eventsSelectedYear }} {{ end }} {{ end }} {{ end }} {{ end }}

Events from past years:

{{ if .GitInfo }}

{{ i18n "last-modified" }}: {{ .GitInfo.AuthorDate | time.Format ":date_long" }} {{ i18n "by" }} {{ .GitInfo.AuthorName }}

{{ end }}
{{ end }} diff --git a/website/themes/beastie/layouts/news/list.html b/website/themes/beastie/layouts/news/list.html index a09ce25d88..3f86c505d4 100644 --- a/website/themes/beastie/layouts/news/list.html +++ b/website/themes/beastie/layouts/news/list.html @@ -1,84 +1,84 @@ {{ define "main" }}
{{ partial "sidenav.html" (dict "sidenavType" .Params.sidenav "data" .Site.Data "language" $.Site.Language.Lang ) }}

{{ .Title }}

{{- .Content -}} {{ if .Params.loadNews }} {{ $newsPath := (printf "data/%s/news/news.toml" $.Language.Lang) }} {{ $newsData := "" }} {{ if (fileExists $newsPath) -}} {{ $data := index .Site.Data $.Language.Lang }} {{ $newsData = $data.news }} {{ else }} - {{ $dataDefaultLanguage := index .Site.Data .Sites.First.Language.Lang }} + {{ $dataDefaultLanguage := index .Site.Data .Sites.Default.Language.Lang }} {{ $newsData = $dataDefaultLanguage.news }} {{ end }} {{ $yearsMonths := slice }} {{ with $newsData.news }} {{ range (sort .news "date" "desc") }} {{ $yearsMonths = $yearsMonths | append (dateFormat "2006-1" .date) }} {{ end }} {{ end }} {{ $yearsMonths = $yearsMonths | uniq }} {{ $newsDayCounter := 1 }} {{ $newsDayPrev := false }} {{ range $year := seq now.Year 2010 }} {{ range $month := seq 12 1 }} {{ $yearMonth := (printf "%d-%d" $year $month) }} {{ if in $yearsMonths $yearMonth }}

{{ i18n $month }} {{ $year }}

{{ end }} {{ end }} {{ end }} {{ end }} {{ if .GitInfo }}

{{ i18n "last-modified" }}: {{ .GitInfo.AuthorDate | time.Format ":date_long" }} {{ i18n "by" }} {{ .GitInfo.AuthorName }}

{{ end }}
{{ end }} diff --git a/website/themes/beastie/layouts/news/single.html b/website/themes/beastie/layouts/news/single.html index a09ce25d88..3f86c505d4 100644 --- a/website/themes/beastie/layouts/news/single.html +++ b/website/themes/beastie/layouts/news/single.html @@ -1,84 +1,84 @@ {{ define "main" }}
{{ partial "sidenav.html" (dict "sidenavType" .Params.sidenav "data" .Site.Data "language" $.Site.Language.Lang ) }}

{{ .Title }}

{{- .Content -}} {{ if .Params.loadNews }} {{ $newsPath := (printf "data/%s/news/news.toml" $.Language.Lang) }} {{ $newsData := "" }} {{ if (fileExists $newsPath) -}} {{ $data := index .Site.Data $.Language.Lang }} {{ $newsData = $data.news }} {{ else }} - {{ $dataDefaultLanguage := index .Site.Data .Sites.First.Language.Lang }} + {{ $dataDefaultLanguage := index .Site.Data .Sites.Default.Language.Lang }} {{ $newsData = $dataDefaultLanguage.news }} {{ end }} {{ $yearsMonths := slice }} {{ with $newsData.news }} {{ range (sort .news "date" "desc") }} {{ $yearsMonths = $yearsMonths | append (dateFormat "2006-1" .date) }} {{ end }} {{ end }} {{ $yearsMonths = $yearsMonths | uniq }} {{ $newsDayCounter := 1 }} {{ $newsDayPrev := false }} {{ range $year := seq now.Year 2010 }} {{ range $month := seq 12 1 }} {{ $yearMonth := (printf "%d-%d" $year $month) }} {{ if in $yearsMonths $yearMonth }}

{{ i18n $month }} {{ $year }}

{{ end }} {{ end }} {{ end }} {{ end }} {{ if .GitInfo }}

{{ i18n "last-modified" }}: {{ .GitInfo.AuthorDate | time.Format ":date_long" }} {{ i18n "by" }} {{ .GitInfo.AuthorName }}

{{ end }}
{{ end }} diff --git a/website/themes/beastie/layouts/partials/commercial-consulting.html b/website/themes/beastie/layouts/partials/commercial-consulting.html index 8e62933fb9..5d959a5ef2 100644 --- a/website/themes/beastie/layouts/partials/commercial-consulting.html +++ b/website/themes/beastie/layouts/partials/commercial-consulting.html @@ -1,82 +1,82 @@ {{ $consultingVendorsPath := (printf "data/%s/vendors/consulting.toml" $.Language.Lang) }} {{ $consultingVendorsData := "" }} {{ if (fileExists $consultingVendorsPath) -}} {{ $data := index .Site.Data $.Language.Lang }} {{ $consultingVendorsData = $data.vendors }} {{ else }} - {{ $dataDefaultLanguage := index .Site.Data .Sites.First.Language.Lang }} + {{ $dataDefaultLanguage := index .Site.Data .Sites.Default.Language.Lang }} {{ $consultingVendorsData = $dataDefaultLanguage.vendors }} {{ end }} {{ with $consultingVendorsData.consulting }} {{ if $.Params.grouped }}

{{ i18n "africa" }}

{{ i18n "asia" }}

{{ i18n "australia" }}

{{ i18n "europe" }}

{{ i18n "newZealand" }}

{{ i18n "northAmerica" }}

{{ i18n "southAmerica" }}

{{ else }}
{{ range (sort .consulting "name" "asc") }}
{{ .name }}
{{ .description | safeHTML }}
{{ end }}
{{ end }} {{ end }} diff --git a/website/themes/beastie/layouts/partials/commercial-hardware.html b/website/themes/beastie/layouts/partials/commercial-hardware.html index 0b8f5b7bbf..3026998b59 100644 --- a/website/themes/beastie/layouts/partials/commercial-hardware.html +++ b/website/themes/beastie/layouts/partials/commercial-hardware.html @@ -1,24 +1,24 @@ {{ $hardwareVendorsPath := (printf "data/%s/vendors/hardware.toml" $.Language.Lang) }} {{ $hardwareVendorsData := "" }} {{ if (fileExists $hardwareVendorsPath) -}} {{ $data := index .Site.Data $.Language.Lang }} {{ $hardwareVendorsData = $data.vendors }} {{ else }} - {{ $dataDefaultLanguage := index .Site.Data .Sites.First.Language.Lang }} + {{ $dataDefaultLanguage := index .Site.Data .Sites.Default.Language.Lang }} {{ $hardwareVendorsData = $dataDefaultLanguage.vendors }} {{ end }} {{ with $hardwareVendorsData.hardware }}
{{ range (sort .hardware "name" "asc") }}
{{ .name }}
{{ .description | safeHTML }}
{{ end }}
{{ end }} diff --git a/website/themes/beastie/layouts/partials/commercial-isp.html b/website/themes/beastie/layouts/partials/commercial-isp.html index 68d0a2ae86..8aaaf074af 100644 --- a/website/themes/beastie/layouts/partials/commercial-isp.html +++ b/website/themes/beastie/layouts/partials/commercial-isp.html @@ -1,23 +1,23 @@ {{ $ispVendorsPath := (printf "data/%s/vendors/isp.toml" $.Language.Lang) }} {{ $ispVendorsData := "" }} {{ if (fileExists $ispVendorsPath) -}} {{ $data := index .Site.Data $.Language.Lang }} {{ $ispVendorsData = $data.vendors }} {{ else }} - {{ $dataDefaultLanguage := index .Site.Data .Sites.First.Language.Lang }} + {{ $dataDefaultLanguage := index .Site.Data .Sites.Default.Language.Lang }} {{ $ispVendorsData = $dataDefaultLanguage.vendors }} {{ end }} {{ with $ispVendorsData.isp }}
{{ range (sort .isp "name" "asc") }}
{{ .name }}
{{ .description | safeHTML }}
{{ end }}
{{ end }} diff --git a/website/themes/beastie/layouts/partials/commercial-misc.html b/website/themes/beastie/layouts/partials/commercial-misc.html index 0fc6931a9a..32423ad919 100644 --- a/website/themes/beastie/layouts/partials/commercial-misc.html +++ b/website/themes/beastie/layouts/partials/commercial-misc.html @@ -1,24 +1,24 @@ {{ $miscVendorsPath := (printf "data/%s/vendors/misc.toml" $.Language.Lang) }} {{ $miscVendorsData := "" }} {{ if (fileExists $miscVendorsPath) -}} {{ $data := index .Site.Data $.Language.Lang }} {{ $miscVendorsData = $data.vendors }} {{ else }} - {{ $dataDefaultLanguage := index .Site.Data .Sites.First.Language.Lang }} + {{ $dataDefaultLanguage := index .Site.Data .Sites.Default.Language.Lang }} {{ $miscVendorsData = $dataDefaultLanguage.vendors }} {{ end }} {{ with $miscVendorsData.misc }}
{{ range (sort .misc "name" "asc") }}
{{ .name }}
{{ .description | safeHTML }}
{{ end }}
{{ end }} diff --git a/website/themes/beastie/layouts/partials/commercial-software.html b/website/themes/beastie/layouts/partials/commercial-software.html index f7b3807a94..c596ba87d8 100644 --- a/website/themes/beastie/layouts/partials/commercial-software.html +++ b/website/themes/beastie/layouts/partials/commercial-software.html @@ -1,98 +1,98 @@ {{ $softwareVendorsPath := (printf "data/%s/vendors/software.toml" $.Language.Lang) }} {{ $softwareVendorsData := "" }} {{ if (fileExists $softwareVendorsPath) -}} {{ $data := index .Site.Data $.Language.Lang }} {{ $softwareVendorsData = $data.vendors }} {{ else }} - {{ $dataDefaultLanguage := index .Site.Data .Sites.First.Language.Lang }} + {{ $dataDefaultLanguage := index .Site.Data .Sites.Default.Language.Lang }} {{ $softwareVendorsData = $dataDefaultLanguage.vendors }} {{ end }} {{ with $softwareVendorsData.software }} {{ if $.Params.grouped }}

{{ i18n "databases" }}

{{ i18n "developmentTools" }}

{{ i18n "ecommerce" }}

{{ i18n "email" }}

{{ i18n "misc" }}

{{ i18n "network" }}

{{ i18n "scientific" }}

{{ i18n "security" }}

{{ i18n "isp" }}

{{ else }}
{{ range (sort .software "name" "asc") }}
{{ .name }}
{{ .description | safeHTML }}
{{ end }}
{{ end }} {{ end }} diff --git a/website/themes/beastie/layouts/partials/events.html b/website/themes/beastie/layouts/partials/events.html index 1d55d0d6d3..79148da802 100644 --- a/website/themes/beastie/layouts/partials/events.html +++ b/website/themes/beastie/layouts/partials/events.html @@ -1,32 +1,32 @@ {{ $eventsPath := (printf "data/%s/events/events.toml" $.Language.Lang (dateFormat "2006" now)) }} {{ $eventsData := "" }} {{ if (fileExists $eventsPath) -}} {{ $data := index .Site.Data $.Language.Lang }} {{ $eventsData = $data }} {{ else }} - {{ $dataDefaultLanguage := index .Site.Data .Sites.First.Language.Lang }} + {{ $dataDefaultLanguage := index .Site.Data .Sites.Default.Language.Lang }} {{ $eventsData = $dataDefaultLanguage }} {{ end }} {{ with $eventsData }} {{ $eventsCounter := 0 }} {{ range (sort .events "year" "asc") }} {{ if le $eventsCounter 6 }} {{ range (sort .events "startDate" "asc") }} {{ if ge (dateFormat "20060102" .endDate) (dateFormat "20060102" now) }}

{{ dateFormat "2006-01-02" .startDate }} - {{ dateFormat "2006-01-02" .endDate }}
{{ .name }}
{{ if or (.city) (.country) }}({{end}}{{ if .city }}{{ .city }},{{ end }} {{ if .country }}{{ .country }}{{ end }}{{ if or (.city) (.country) }}){{end}}

{{ $eventsCounter = add $eventsCounter 1 }} {{ end }} {{ end }} {{ end }} {{ end }} {{ end }} diff --git a/website/themes/beastie/layouts/partials/news.html b/website/themes/beastie/layouts/partials/news.html index 23b22fbaa7..ce1052fe45 100644 --- a/website/themes/beastie/layouts/partials/news.html +++ b/website/themes/beastie/layouts/partials/news.html @@ -1,43 +1,43 @@ {{ $newsPath := (printf "data/%s/news/news.toml" $.Language.Lang) }} {{ $newsData := "" }} {{ if (fileExists $newsPath) -}} {{ $data := index .Site.Data $.Language.Lang }} {{ $newsData = $data.news }} {{ else }} - {{ $dataDefaultLanguage := index .Site.Data .Sites.First.Language.Lang }} + {{ $dataDefaultLanguage := index .Site.Data .Sites.Default.Language.Lang }} {{ $newsData = $dataDefaultLanguage.news }} {{ end }} {{ with $newsData.news }} {{ $newsCounter := 0 }} {{ $newsDayCounter := 1 }} {{ $newsDayPrev := false }} {{ range (sort .news "date" "desc") }} {{ if lt $newsCounter 6 }} {{ $newsDayCur := dateFormat "2006-01-02" .date }} {{ if eq $newsDayCur $newsDayPrev }} {{ $newsDayCounter = add $newsDayCounter 1 }} {{ else }} {{ $newsDayCounter = 1 }} {{ end }}

{{ dateFormat "2006-01-02" .date }}
{{ if .title }} {{ $title := replaceRE "" "" .title }} {{ $title = replaceRE "" "" $title }} {{ $title | safeHTML }} {{ else }} {{ $description := replaceRE "" "" .description }} {{ $description = replaceRE "" "" $description }} {{ $description | safeHTML }} {{ end }}

{{ $newsCounter = add $newsCounter 1 }} {{ $newsDayPrev = $newsDayCur }} {{ end }} {{ end }} {{ end }} diff --git a/website/themes/beastie/layouts/partials/press.html b/website/themes/beastie/layouts/partials/press.html index 3b3b4a79a2..d3bed55a6f 100644 --- a/website/themes/beastie/layouts/partials/press.html +++ b/website/themes/beastie/layouts/partials/press.html @@ -1,35 +1,35 @@ {{ $pressPath := (printf "data/%s/press/press.toml" $.Language.Lang) }} {{ $translatedPressEnabled := false }} {{ $pressData := "" }} {{ if $translatedPressEnabled -}} {{ $data := index .Site.Data $.Language.Lang }} {{ $pressData = $data.press }} {{ else }} - {{ $dataDefaultLanguage := index .Site.Data .Sites.First.Language.Lang }} + {{ $dataDefaultLanguage := index .Site.Data .Sites.Default.Language.Lang }} {{ $pressData = $dataDefaultLanguage.press }} {{ end }} {{ with $pressData.press }} {{ $pressCounter := 0 }} {{ $pressMonthCounter := 1 }} {{ $pressMonthPrev := false }} {{ range (sort .press "date" "desc") }} {{ if lt $pressCounter 5 }} {{ $pressMonthCur := dateFormat "2006-01" .date }} {{ if eq $pressMonthCur $pressMonthPrev }} {{ $pressMonthCounter = add $pressMonthCounter 1 }} {{ else }} {{ $pressMonthCounter = 1 }} {{ end }}

{{ dateFormat "2006-01" .date }}
{{ .name }}

{{ $pressCounter = add $pressCounter 1 }} {{ $pressMonthPrev = $pressMonthCur }} {{ end }} {{ end }} {{ end }} diff --git a/website/themes/beastie/layouts/press/list.html b/website/themes/beastie/layouts/press/list.html index ee9fc61001..d1d5772610 100644 --- a/website/themes/beastie/layouts/press/list.html +++ b/website/themes/beastie/layouts/press/list.html @@ -1,88 +1,88 @@ {{ define "main" }}
{{ partial "sidenav.html" (dict "sidenavType" .Params.sidenav "data" .Site.Data "language" $.Site.Language.Lang ) }}

{{ .Title }}

{{- .Content -}} {{ if .Params.loadPress }} {{ $pressPath := (printf "data/%s/press/press.toml" $.Language.Lang) }} {{ $pressData := "" }} {{ if (fileExists $pressPath) -}} {{ $data := index .Site.Data $.Language.Lang }} {{ $pressData = $data.press }} {{ else }} - {{ $dataDefaultLanguage := index .Site.Data .Sites.First.Language.Lang }} + {{ $dataDefaultLanguage := index .Site.Data .Sites.Default.Language.Lang }} {{ $pressData = $dataDefaultLanguage.press }} {{ end }} {{ $yearsMonths := slice }} {{ with $pressData.press }} {{ range (sort .press "date" "desc") }} {{ $yearsMonths = $yearsMonths | append (dateFormat "2006-1" .date) }} {{ end }} {{ end }} {{ $yearsMonths = $yearsMonths | uniq }} {{ $pressMonthCounter := 1 }} {{ $pressMonthPrev := false }} {{ range $year := seq now.Year 2010 }} {{ range $month := seq 12 1 }} {{ $yearMonth := (printf "%d-%d" $year $month) }} {{ if in $yearsMonths $yearMonth }}

{{ i18n $month }} {{ $year }}

{{ end }} {{ end }} {{ end }} {{ end }} {{ if .GitInfo }}

{{ i18n "last-modified" }}: {{ .GitInfo.AuthorDate | time.Format ":date_long" }} {{ i18n "by" }} {{ .GitInfo.AuthorName }}

{{ end }}
{{ end }} diff --git a/website/themes/beastie/layouts/press/single.html b/website/themes/beastie/layouts/press/single.html index ee9fc61001..d1d5772610 100644 --- a/website/themes/beastie/layouts/press/single.html +++ b/website/themes/beastie/layouts/press/single.html @@ -1,88 +1,88 @@ {{ define "main" }}
{{ partial "sidenav.html" (dict "sidenavType" .Params.sidenav "data" .Site.Data "language" $.Site.Language.Lang ) }}

{{ .Title }}

{{- .Content -}} {{ if .Params.loadPress }} {{ $pressPath := (printf "data/%s/press/press.toml" $.Language.Lang) }} {{ $pressData := "" }} {{ if (fileExists $pressPath) -}} {{ $data := index .Site.Data $.Language.Lang }} {{ $pressData = $data.press }} {{ else }} - {{ $dataDefaultLanguage := index .Site.Data .Sites.First.Language.Lang }} + {{ $dataDefaultLanguage := index .Site.Data .Sites.Default.Language.Lang }} {{ $pressData = $dataDefaultLanguage.press }} {{ end }} {{ $yearsMonths := slice }} {{ with $pressData.press }} {{ range (sort .press "date" "desc") }} {{ $yearsMonths = $yearsMonths | append (dateFormat "2006-1" .date) }} {{ end }} {{ end }} {{ $yearsMonths = $yearsMonths | uniq }} {{ $pressMonthCounter := 1 }} {{ $pressMonthPrev := false }} {{ range $year := seq now.Year 2010 }} {{ range $month := seq 12 1 }} {{ $yearMonth := (printf "%d-%d" $year $month) }} {{ if in $yearsMonths $yearMonth }}

{{ i18n $month }} {{ $year }}

{{ end }} {{ end }} {{ end }} {{ end }} {{ if .GitInfo }}

{{ i18n "last-modified" }}: {{ .GitInfo.AuthorDate | time.Format ":date_long" }} {{ i18n "by" }} {{ .GitInfo.AuthorName }}

{{ end }}
{{ end }} diff --git a/website/themes/beastie/layouts/shortcodes/get-event-last-year-info.html b/website/themes/beastie/layouts/shortcodes/get-event-last-year-info.html index 16e4092a24..14d2e8683a 100644 --- a/website/themes/beastie/layouts/shortcodes/get-event-last-year-info.html +++ b/website/themes/beastie/layouts/shortcodes/get-event-last-year-info.html @@ -1,32 +1,32 @@ {{ $param := (.Get 0) }} -{{ $eventsData := index .Page.Site.Data .Page.Sites.First.Language.Lang }} +{{ $eventsData := index .Page.Site.Data .Page.Sites.Default.Language.Lang }} {{ $lastYear := sub (int (now.Format "2006")) 1 }} {{ $countriesCodes := slice }} {{ $eventsCounter := 0 }} {{ with $eventsData }} {{ range (sort .events "year" "desc") }} {{ if eq (int .year) $lastYear }} {{ range .events }} {{ $eventsCounter = add $eventsCounter 1 }} {{ if .countryCode }} {{ $countriesCodes = $countriesCodes | append .countryCode }} {{ end }} {{ end }} {{ end }} {{ end }} {{ end }} {{ $countriesCodes = $countriesCodes | uniq }} {{ if eq $param "countries" }} {{ len $countriesCodes }} {{ end }} {{ if eq $param "events" }} {{ $eventsCounter }} {{ end }} diff --git a/website/themes/beastie/layouts/shortcodes/get-usergroups-info.html b/website/themes/beastie/layouts/shortcodes/get-usergroups-info.html index 9a09c475b0..b041e9b1c0 100644 --- a/website/themes/beastie/layouts/shortcodes/get-usergroups-info.html +++ b/website/themes/beastie/layouts/shortcodes/get-usergroups-info.html @@ -1,31 +1,31 @@ {{ $param := (.Get 0) }} -{{ $usergroupsData := index .Page.Site.Data .Page.Sites.First.Language.Lang }} +{{ $usergroupsData := index .Page.Site.Data .Page.Sites.Default.Language.Lang }} {{ $usergroupsCodes := slice }} {{ $usergroupsCodesTimes := newScratch }} {{ $usergroupsCounter := 0 }} {{ with $usergroupsData.usergroups.usergroups }} {{ range . }} {{ range . }} {{ if .countryCode }} {{ $usergroupsCodes = $usergroupsCodes | append .countryCode }} {{ end }} {{ $usergroupsCounter = add $usergroupsCounter 1 }} {{ end }} {{ end }} {{ end }} {{ $usergroupsCodes = $usergroupsCodes | uniq }} {{ if eq $param "countries" }} {{ len $usergroupsCodes }} {{ end }} {{ if eq $param "usergroups" }} {{ $usergroupsCounter }} {{ end }}