From 06c0f817dac8e35787f7ddc8090802bf6eee464a Mon Sep 17 00:00:00 2001 From: Athanasia Monika Mowinckel <14014329+drmowinckels@users.noreply.github.com> Date: Wed, 14 Feb 2024 11:21:53 +0100 Subject: [PATCH] highlight leadership & unify image size (#297) * highlight leadership & unify image size * prep translations * add alumni text * fix preview build to show images correctly * add notification about build fail * add notification about build fail --- .github/workflows/build.yaml | 38 +++++----- i18n/en.yaml | 9 +++ .../layouts/global-team/single.html | 74 ++++++++++++++----- 3 files changed, 82 insertions(+), 39 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 42142ef4d..a9de4b749 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -148,7 +148,7 @@ jobs: hugo \ -e development \ -d ${{ env.hugobd }} \ - -b https://${{ env.netalias }}-rladies-dev.netlify.app/ + -b https://${{ env.netalias }}--rladies-dev.netlify.app/ - name: Deploy Preview @@ -161,9 +161,21 @@ jobs: netlify deploy \ --alias ${{ env.netalias }} \ --dir=${{ env.hugobd }} - + + - uses: actions/github-script@v6 + name: "Notify about build failure" + if: ${{ failure() }} + with: + github-token: ${{ env.token }} + script: | + await github.rest.issues.createComment({ + issue_number: ${{ env.issue }}, + owner: 'rladies', + repo: '${{ env.repo_name }}', + body: 'Test build failed :sob: [Check out the build logs](https://github.com/rladies/rladies.github.io/actions/runs/${{ github.run_id }}). + }) + - uses: actions/github-script@v6 - if: ${{ (env.on_fork != true) && (github.event_name == 'workflow_dispatch' ) }} name: "Notify about build preview" with: github-token: ${{ env.token }} @@ -172,23 +184,9 @@ jobs: issue_number: ${{ env.issue }}, owner: 'rladies', repo: '${{ env.repo_name }}', - body: ':tada: The preview is built! [Check it out :eyes:](https://${{ env.netalias }}-rladies-dev.netlify.app)' + body: ':tada: The preview is built! [Check it out :eyes:](https://${{ env.netalias }}--rladies-dev.netlify.app)' }) - - notify: - runs-on: ubuntu-latest - if: ${{ failure() && (github.event_name == 'workflow_dispatch' ) }} - steps: - - name: Set env parameters - run: | + + - - name: Create repository dispatch event - env: - GITHUB_TOKEN: ${{ secrets.GLOBAL_GHA_PAT }} - run: | - gh api repos/${{ env.repo_name }}/dispatches \ - --input type=pr \ - --input pr_number=${{ env.issue }} \ - --input status=failed \ - --input conclusion=${{ github.event.workflow_run.conclusion }} diff --git a/i18n/en.yaml b/i18n/en.yaml index e21519988..0d455ebfa 100644 --- a/i18n/en.yaml +++ b/i18n/en.yaml @@ -50,6 +50,15 @@ city: "City" cities: "Cities" event: "Event" +# About Global Team ---- +leadership: 'Leadership' +global-team: 'Global Team' +alumni: 'Alumni' +alumni-text: | + R-Ladies is extremely thankful for all the hard work + and dedication of our past members and leaders. + We would not be where we are today without them. + # Other ---- social_media: "Social media" archive: 'Archive' diff --git a/themes/hugo-rladies/layouts/global-team/single.html b/themes/hugo-rladies/layouts/global-team/single.html index 4e0930ebb..5a4fbdee1 100644 --- a/themes/hugo-rladies/layouts/global-team/single.html +++ b/themes/hugo-rladies/layouts/global-team/single.html @@ -1,24 +1,68 @@ {{ define "main" }} -
{{ .Content }}
{{ $gt := $.Site.Data.global_team }} + {{ $.Scratch.Set "gt_roles" (slice) }} {{ range $gt.current }} {{ $.Scratch.Add "gt_roles" .role }} {{ end }} {{ $.Scratch.Set "gt_roles" ($.Scratch.Get "gt_roles" | uniq | sort) }} - + {{ $.Scratch.Set "leadership" (slice) }} + + {{ range $r_index, $r_name := ($.Scratch.Get "gt_roles" ) }} {{ $.Scratch.Set $r_name (slice) }} {{ range $idx, $value := $gt.current }} {{ $sect := intersect $value.role (slice $r_name) }} {{ if eq (len $sect) 1 }} {{ $.Scratch.Add $r_name .name }} + {{ if eq $r_name "Leadership" }} + {{ $.Scratch.Add "leadership" $idx }} + {{ end }} {{ end }} {{ end }} - {{ end }} + {{ end }} + + + {{ $.Scratch.Set "gtc" (slice) }} + {{ range $name, $_ := $gt.current }} + {{ $.Scratch.Add "gtc" $name }} + {{ end }} + + {{ $path := $.Site.GetPage "section" "global-team" }} + +{{ .Content }}
+ + +@@ -41,21 +84,13 @@ {{ . }} |
{{ i18n "alumni-text" }}