From 9450c71d811e7772efa570149ad8bffba9b62884 Mon Sep 17 00:00:00 2001 From: Daniel Wagner-Hall Date: Mon, 2 Dec 2024 14:08:43 +0000 Subject: [PATCH 1/8] Add metadata about track types This needs styling, but puts the raw content in place. --- common-theme/layouts/partials/map-common.html | 8 ++++++++ common-theme/layouts/partials/map-taxonomy.html | 2 +- .../content/track_kinds/jobs-after-itp/_index.md | 7 +++++++ .../content/track_kinds/jobs-after-sdc/_index.md | 7 +++++++ org-cyf-tracks/content/track_kinds/self-study/_index.md | 4 ++++ 5 files changed, 27 insertions(+), 1 deletion(-) diff --git a/common-theme/layouts/partials/map-common.html b/common-theme/layouts/partials/map-common.html index d14b96ec8..21b0919ab 100644 --- a/common-theme/layouts/partials/map-common.html +++ b/common-theme/layouts/partials/map-common.html @@ -2,6 +2,7 @@ Expects a slice[dict] param containing an ordered list of dicts with the following keys, one per section in the map to render: * title (string) - The heading to display for the section. * values (slice[Page]) - A slice of Pages, one per page in the section which should be listed. +* metadata (slice[dict[string, string]]) - Ordered key-value pairs of extra metadata to display about the section. Each dict should contain a key named "name" and a key named "value". */}}
@@ -14,6 +15,13 @@

📍{{ $i }}: {{ $sectionTitle }}

+ {{ if index $section "metadata" }} +
+ {{ range $metadatum := index $section "metadata" }} +
{{ index $metadatum "name" }}
{{ index $metadatum "value" }}
+ {{ end }} +
+ {{ end }}
    {{/* Check if a menu for the current map section exists */}} {{ if $sectionValues }} diff --git a/common-theme/layouts/partials/map-taxonomy.html b/common-theme/layouts/partials/map-taxonomy.html index decfe8ceb..c8847d2f0 100644 --- a/common-theme/layouts/partials/map-taxonomy.html +++ b/common-theme/layouts/partials/map-taxonomy.html @@ -11,7 +11,7 @@ {{ $termTitle := $termPage.Title }} {{ $values := index (index site.Taxonomies $taxonomy_to_map) $termID }} - {{ $section := dict "title" $termTitle "values" $values }} + {{ $section := dict "title" $termTitle "values" $values "metadata" $termPage.Params.details }} {{ $sections = append $section $sections }} {{ end }} diff --git a/org-cyf-tracks/content/track_kinds/jobs-after-itp/_index.md b/org-cyf-tracks/content/track_kinds/jobs-after-itp/_index.md index 998bd08e8..7d2ac77aa 100644 --- a/org-cyf-tracks/content/track_kinds/jobs-after-itp/_index.md +++ b/org-cyf-tracks/content/track_kinds/jobs-after-itp/_index.md @@ -1,4 +1,11 @@ +++ title = "Jobs after ITP" weight = 2 +description = "These are course materials targeting specific jobs." +[[details]] +name = "When" +value = "When a job requiring one of these tracks is available, CYF will announce when the track will run." +[[details]] +name = "Who" +value = "You must have completed the Introduction to Programming course, be enrolled as a trainee, and want the job it's targeting. If you are planning to do the Software Development Course, you probably want to prepare for the Piscine and SDC rather than taking one of these tracks." +++ diff --git a/org-cyf-tracks/content/track_kinds/jobs-after-sdc/_index.md b/org-cyf-tracks/content/track_kinds/jobs-after-sdc/_index.md index 0559014e1..64cb24495 100644 --- a/org-cyf-tracks/content/track_kinds/jobs-after-sdc/_index.md +++ b/org-cyf-tracks/content/track_kinds/jobs-after-sdc/_index.md @@ -1,4 +1,11 @@ +++ title = "Jobs after SDC" weight = 3 +description = "These are course materials targeting specific jobs." +[[details]] +name = "When" +value = "When a job requiring one of these tracks is available, CYF will announce when the track will run." +[[details]] +name = "Who" +value = "You must have completed the Software Development Course, be enrolled as a trainee, and want the job it's targeting." +++ diff --git a/org-cyf-tracks/content/track_kinds/self-study/_index.md b/org-cyf-tracks/content/track_kinds/self-study/_index.md index 14db613ed..2bb3ee208 100644 --- a/org-cyf-tracks/content/track_kinds/self-study/_index.md +++ b/org-cyf-tracks/content/track_kinds/self-study/_index.md @@ -1,4 +1,8 @@ +++ title = "Self-study" weight = 1 +description = "These are are course materials introducing topics which you can study on your own or in a group. They are not targeted at specific jobs, but can help broaden your knowledge." +[[details]] +name = "When" +value = "You can study these tracks any time. They list what you need to know before starting." +++ From 544754c77f19e551df647ac78fb6ba3ae863e304 Mon Sep 17 00:00:00 2001 From: Sally McGrath Date: Wed, 4 Dec 2024 11:08:15 +0000 Subject: [PATCH 2/8] tweak view --- .../assets/styles/04-components/chip.scss | 4 +++- .../assets/styles/04-components/map.scss | 15 ++++++++++++--- .../assets/styles/04-components/terms.scss | 7 +++++++ common-theme/layouts/_default/term.html | 16 ++++++++++++++-- common-theme/layouts/partials/block/link.html | 2 +- 5 files changed, 37 insertions(+), 7 deletions(-) create mode 100644 common-theme/assets/styles/04-components/terms.scss diff --git a/common-theme/assets/styles/04-components/chip.scss b/common-theme/assets/styles/04-components/chip.scss index b8eb40265..54d69b3f4 100644 --- a/common-theme/assets/styles/04-components/chip.scss +++ b/common-theme/assets/styles/04-components/chip.scss @@ -14,7 +14,9 @@ } &__icon { font-size: var(--theme-type-size--2); - clip-path: circle(); + &--circle { + clip: circle(); + } } @include on-event() { .c-chip__title { diff --git a/common-theme/assets/styles/04-components/map.scss b/common-theme/assets/styles/04-components/map.scss index ae306cc89..b9c5e0705 100644 --- a/common-theme/assets/styles/04-components/map.scss +++ b/common-theme/assets/styles/04-components/map.scss @@ -26,7 +26,8 @@ left: 0; } - &__stop { + &__stop, + &__header { position: relative; z-index: var(--layer); @media (min-width: $c-max) { @@ -34,12 +35,20 @@ calc(var(--theme-spacing--container) / 3) - var(--theme-spacing--gutter) ); } + + // when this header has details + > summary { + list-style: "🙋🏾"; + list-style-position: inside; + } + &[open] > summary { + list-style: "💁🏾"; + list-style-position: inside; + } } &__title { color: var(--theme-color--brand); - position: absolute; - z-index: 2; transform: translate3d( calc(-1 * var(--theme-spacing--3)), calc(-1 * var(--theme-spacing--5)), diff --git a/common-theme/assets/styles/04-components/terms.scss b/common-theme/assets/styles/04-components/terms.scss new file mode 100644 index 000000000..5866b1167 --- /dev/null +++ b/common-theme/assets/styles/04-components/terms.scss @@ -0,0 +1,7 @@ +.c-terms { + max-width: var(--theme-spacing--linelength); + dt { + font-weight: 600; + color: var(--theme-color--brand); + } +} diff --git a/common-theme/layouts/_default/term.html b/common-theme/layouts/_default/term.html index c41eb61c1..600812e55 100644 --- a/common-theme/layouts/_default/term.html +++ b/common-theme/layouts/_default/term.html @@ -3,11 +3,21 @@ {{ partial "page-header.html" . }}
    -

    📛 This is a term definition page

    + {{ if .Page.Params.When }} +
    +
    When
    +
    {{ .Page.Params.When }}
    + {{ if .Page.Params.Eligibility }} +
    Who
    +
    {{ .Page.Params.Eligibility }}
    + {{ end }} +
    + {{ end}} + {{ .Content }} {{ with .Pages }}
    -

    Citations

    +

    🏷️ Tagged

      {{ range sort . "Title"}}
    • @@ -17,6 +27,8 @@

      Citations

    • {{ end }}
    +
    +
    📛 This is a term definition page
    {{ end }}
    diff --git a/common-theme/layouts/partials/block/link.html b/common-theme/layouts/partials/block/link.html index e7a9e7f51..0986280a2 100644 --- a/common-theme/layouts/partials/block/link.html +++ b/common-theme/layouts/partials/block/link.html @@ -13,7 +13,7 @@ {{ $blockData.name }} + class="c-chip__icon c-chip__icon--circle" /> {{ end }}

    {{ $blockData.name }}

    {{ with $blockData.caption }} From 0cdda430fdd8661406af4422a13e0b17091f3b66 Mon Sep 17 00:00:00 2001 From: Sally McGrath Date: Wed, 4 Dec 2024 11:08:45 +0000 Subject: [PATCH 3/8] pop text in a block --- .../layouts/partials/taxonomy-map.html | 51 +++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 common-theme/layouts/partials/taxonomy-map.html diff --git a/common-theme/layouts/partials/taxonomy-map.html b/common-theme/layouts/partials/taxonomy-map.html new file mode 100644 index 000000000..06c96ba6e --- /dev/null +++ b/common-theme/layouts/partials/taxonomy-map.html @@ -0,0 +1,51 @@ +
    +

    👉🏾

    +
    + + {{ $taxonomy_to_map := .Params.taxonomy_to_map }} + + {{/* You can't ask for a taxonomy to be sorted by weight, so we need to get weights and iterate ourselves - see https://discourse.gohugo.io/t/list-custom-taxonomy-terms-in-a-specific-order-not-alphabetical/18145/5 */}} + {{ $trackKinds := $.Site.GetPage (printf "/%s" $taxonomy_to_map) }} + {{ range $trackKindPage := $trackKinds.Pages.ByWeight }} + {{ $trackKindTermName := $trackKindPage.Name }} + {{ $trackKindTitle := $trackKindPage.Params.Title }} + {{ $tracks := index (index site.Taxonomies $taxonomy_to_map) $trackKindTermName }} +
    +
    + +

    + {{ $trackKindTitle }} +

    +
    +

    + {{ $trackKindPage.Params.Description }} +

    +
    +
    When
    +
    {{ $trackKindPage.Params.When }}
    + {{ if $trackKindPage.Params.Eligibility }} +
    Who
    +
    {{ $trackKindPage.Params.Eligibility }}
    + {{ end }} +
    +
    +
      + {{/* Check if a menu for the current map section exists */}} + {{ if $tracks }} + {{/* Range over the items in the menu */}} + {{ range $iterator, $module := $tracks }} +
    1. + {{ partial "card.html" $module.Page }} +
    2. + {{ end }} + {{ else }} +
    3. No items found for {{ $trackKindTitle }}
    4. + {{ end }} +
    +
    + {{ end }} +
    From 459830e8abee7d46c69055689de656c89449086a Mon Sep 17 00:00:00 2001 From: Sally McGrath Date: Wed, 4 Dec 2024 11:58:43 +0000 Subject: [PATCH 4/8] probably only want details from taxonomy maps? --- .../assets/styles/04-components/map.scss | 2 + common-theme/layouts/_default/term.html | 18 ++-- common-theme/layouts/partials/map-common.html | 82 +++++++++++-------- .../layouts/partials/map-taxonomy.html | 2 +- .../layouts/partials/taxonomy-map.html | 51 ------------ 5 files changed, 57 insertions(+), 98 deletions(-) delete mode 100644 common-theme/layouts/partials/taxonomy-map.html diff --git a/common-theme/assets/styles/04-components/map.scss b/common-theme/assets/styles/04-components/map.scss index b9c5e0705..9d91c6bb7 100644 --- a/common-theme/assets/styles/04-components/map.scss +++ b/common-theme/assets/styles/04-components/map.scss @@ -40,6 +40,7 @@ > summary { list-style: "🙋🏾"; list-style-position: inside; + padding-left: var(--theme-spacing--3); } &[open] > summary { list-style: "💁🏾"; @@ -49,6 +50,7 @@ &__title { color: var(--theme-color--brand); + margin-bottom: calc(-1 * var(--theme-spacing--4)); transform: translate3d( calc(-1 * var(--theme-spacing--3)), calc(-1 * var(--theme-spacing--5)), diff --git a/common-theme/layouts/_default/term.html b/common-theme/layouts/_default/term.html index 600812e55..008cf3609 100644 --- a/common-theme/layouts/_default/term.html +++ b/common-theme/layouts/_default/term.html @@ -3,16 +3,13 @@ {{ partial "page-header.html" . }}
    - {{ if .Page.Params.When }} -
    -
    When
    -
    {{ .Page.Params.When }}
    - {{ if .Page.Params.Eligibility }} -
    Who
    -
    {{ .Page.Params.Eligibility }}
    - {{ end }} -
    - {{ end}} + {{ with .Page.Params.details }} +
    + {{ range $metadatum := index . }} +
    {{ index $metadatum "name" }}
    {{ index $metadatum "value" }}
    + {{ end }} +
    + {{ end }} {{ .Content }} {{ with .Pages }} @@ -25,6 +22,7 @@

    🏷️ Tagged

    {{ .Params.emoji |default "🧩"}} {{ .Title }} {{ with .Permalink }}{{end}} + {{ end }}
    diff --git a/common-theme/layouts/partials/map-common.html b/common-theme/layouts/partials/map-common.html index 21b0919ab..52f65ee2d 100644 --- a/common-theme/layouts/partials/map-common.html +++ b/common-theme/layouts/partials/map-common.html @@ -1,42 +1,52 @@ -{{/* -Expects a slice[dict] param containing an ordered list of dicts with the following keys, one per section in the map to render: -* title (string) - The heading to display for the section. -* values (slice[Page]) - A slice of Pages, one per page in the section which should be listed. -* metadata (slice[dict[string, string]]) - Ordered key-value pairs of extra metadata to display about the section. Each dict should contain a key named "name" and a key named "value". +{{/* Expects a slice[dict] param containing an ordered list of dicts with the following keys, one per section in the map to render: + * title (string) - The heading to display for the section. + * values (slice[Page]) - A slice of Pages, one per page in the section which should be listed. + * metadata (slice[dict[string, string]]) - Ordered key-value pairs of extra metadata to display about the section. Each dict should contain a key named "name" and a key named "value". */}} +
    -

    👉🏾

    -{{ range $i, $section := index . "sections" }} - {{ $sectionTitle := index $section "title" }} - {{ $sectionValues := index $section "values" }} -
    -

    - 📍{{ $i }}: - {{ $sectionTitle }} -

    - {{ if index $section "metadata" }} -
    - {{ range $metadatum := index $section "metadata" }} -
    {{ index $metadatum "name" }}
    {{ index $metadatum "value" }}
    - {{ end }} -
    - {{ end }} -
      - {{/* Check if a menu for the current map section exists */}} - {{ if $sectionValues }} - {{/* Range over the items in the menu */}} - {{ range $iterator, $module := $sectionValues }} -
    1. - {{ partial "card.html" $module }} -
    2. - {{ end }} +

      👉🏾

      + {{ range $i, $section := index . "sections" }} + {{ $sectionTitle := index $section "title" }} + {{ $sectionTermPageLink := index $section "termPageLink" }} + {{ $sectionValues := index $section "values" }} +
      + {{ if $sectionTermPageLink }} +
      + +

      + {{ $sectionTitle }} +

      +
      +
      + {{ range $metadatum := index $section "metadata" }} +
      {{ index $metadatum "name" }}
      +
      {{ index $metadatum "value" }}
      + {{ end }} +
      +
      {{ else }} -
    3. No items found for {{ $sectionTitle }}
    4. +

      + 📍{{ $i }}: + {{ $sectionTitle }} +

      {{ end }} -
    -
    -{{ end }} +
      + {{/* Check if a menu for the current map section exists */}} + {{ if $sectionValues }} + {{/* Range over the items in the menu */}} + {{ range $iterator, $module := $sectionValues }} +
    1. + {{ partial "card.html" $module }} +
    2. + {{ end }} + {{ else }} +
    3. No items found for {{ $sectionTitle }}
    4. + {{ end }} +
    + + {{ end }}
    diff --git a/common-theme/layouts/partials/map-taxonomy.html b/common-theme/layouts/partials/map-taxonomy.html index c8847d2f0..0cd6e9430 100644 --- a/common-theme/layouts/partials/map-taxonomy.html +++ b/common-theme/layouts/partials/map-taxonomy.html @@ -11,7 +11,7 @@ {{ $termTitle := $termPage.Title }} {{ $values := index (index site.Taxonomies $taxonomy_to_map) $termID }} - {{ $section := dict "title" $termTitle "values" $values "metadata" $termPage.Params.details }} + {{ $section := dict "title" $termTitle "termPageLink" $termPage.RelPermalink "values" $values "metadata" $termPage.Params.details }} {{ $sections = append $section $sections }} {{ end }} diff --git a/common-theme/layouts/partials/taxonomy-map.html b/common-theme/layouts/partials/taxonomy-map.html deleted file mode 100644 index 06c96ba6e..000000000 --- a/common-theme/layouts/partials/taxonomy-map.html +++ /dev/null @@ -1,51 +0,0 @@ -
    -

    👉🏾

    -
    - - {{ $taxonomy_to_map := .Params.taxonomy_to_map }} - - {{/* You can't ask for a taxonomy to be sorted by weight, so we need to get weights and iterate ourselves - see https://discourse.gohugo.io/t/list-custom-taxonomy-terms-in-a-specific-order-not-alphabetical/18145/5 */}} - {{ $trackKinds := $.Site.GetPage (printf "/%s" $taxonomy_to_map) }} - {{ range $trackKindPage := $trackKinds.Pages.ByWeight }} - {{ $trackKindTermName := $trackKindPage.Name }} - {{ $trackKindTitle := $trackKindPage.Params.Title }} - {{ $tracks := index (index site.Taxonomies $taxonomy_to_map) $trackKindTermName }} -
    -
    - -

    - {{ $trackKindTitle }} -

    -
    -

    - {{ $trackKindPage.Params.Description }} -

    -
    -
    When
    -
    {{ $trackKindPage.Params.When }}
    - {{ if $trackKindPage.Params.Eligibility }} -
    Who
    -
    {{ $trackKindPage.Params.Eligibility }}
    - {{ end }} -
    -
    -
      - {{/* Check if a menu for the current map section exists */}} - {{ if $tracks }} - {{/* Range over the items in the menu */}} - {{ range $iterator, $module := $tracks }} -
    1. - {{ partial "card.html" $module.Page }} -
    2. - {{ end }} - {{ else }} -
    3. No items found for {{ $trackKindTitle }}
    4. - {{ end }} -
    -
    - {{ end }} -
    From 180db79c6d07daa7c378e48751a542264687695a Mon Sep 17 00:00:00 2001 From: Sally McGrath Date: Wed, 4 Dec 2024 13:27:28 +0000 Subject: [PATCH 5/8] twiddle marker a little --- .../assets/styles/03-elements/misc-phrasing.scss | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/common-theme/assets/styles/03-elements/misc-phrasing.scss b/common-theme/assets/styles/03-elements/misc-phrasing.scss index 63840450b..a034fa40a 100644 --- a/common-theme/assets/styles/03-elements/misc-phrasing.scss +++ b/common-theme/assets/styles/03-elements/misc-phrasing.scss @@ -52,9 +52,16 @@ summary > * { display: inline-block; margin: 0; } -summary::marker { - color: var(--theme-color--accent); - font-size: var(--theme-type-size--3); +details { + summary::marker { + color: var(--theme-color--accent); + font-size: var(--theme-type-size--3); + transition: all 0.5s cubic-bezier(0.4, 2.08, 0.55, 0.44); + } + &:hover summary::marker { + color: var(--theme-color--pop); + font-size: calc(2px + var(--theme-type-size--3)); + } } hr { border: 0; From c12d980822e6ebc0b4b310cebc90b5d971016545 Mon Sep 17 00:00:00 2001 From: Sally McGrath Date: Wed, 4 Dec 2024 14:54:04 +0000 Subject: [PATCH 6/8] triangle --- common-theme/assets/styles/04-components/map.scss | 2 -- 1 file changed, 2 deletions(-) diff --git a/common-theme/assets/styles/04-components/map.scss b/common-theme/assets/styles/04-components/map.scss index 9d91c6bb7..84dc0b4a0 100644 --- a/common-theme/assets/styles/04-components/map.scss +++ b/common-theme/assets/styles/04-components/map.scss @@ -38,12 +38,10 @@ // when this header has details > summary { - list-style: "🙋🏾"; list-style-position: inside; padding-left: var(--theme-spacing--3); } &[open] > summary { - list-style: "💁🏾"; list-style-position: inside; } } From 68b3f20d6e62f98200cdaec6aac7160382684cf8 Mon Sep 17 00:00:00 2001 From: Sally McGrath Date: Wed, 4 Dec 2024 16:45:53 +0000 Subject: [PATCH 7/8] brain splat on where the term tracks could come from so let's do this for now --- common-theme/layouts/_default/term.html | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/common-theme/layouts/_default/term.html b/common-theme/layouts/_default/term.html index 008cf3609..cc7cfdd44 100644 --- a/common-theme/layouts/_default/term.html +++ b/common-theme/layouts/_default/term.html @@ -14,7 +14,7 @@ {{ .Content }} {{ with .Pages }}
    -

    🏷️ Tagged

    +

    🏷️ Members

      {{ range sort . "Title"}}
    • @@ -25,8 +25,6 @@

      🏷️ Tagged

      {{ end }}
    -
    -
    📛 This is a term definition page
    {{ end }}
    From 24445888617fa6cc518d8e3c3aa3edf893cb81c6 Mon Sep 17 00:00:00 2001 From: Daniel Wagner-Hall Date: Wed, 4 Dec 2024 16:55:47 +0000 Subject: [PATCH 8/8] Add specific term for members --- common-theme/layouts/_default/term.html | 3 ++- org-cyf-tracks/content/track_kinds/_index.md | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 org-cyf-tracks/content/track_kinds/_index.md diff --git a/common-theme/layouts/_default/term.html b/common-theme/layouts/_default/term.html index cc7cfdd44..b44a38f5b 100644 --- a/common-theme/layouts/_default/term.html +++ b/common-theme/layouts/_default/term.html @@ -14,7 +14,8 @@ {{ .Content }} {{ with .Pages }}