Skip to content

Commit

Permalink
fix: more sensible project title setup (resolves #719) (#733)
Browse files Browse the repository at this point in the history
  • Loading branch information
greatislander authored Sep 28, 2023
1 parent a4b5073 commit ea33d60
Show file tree
Hide file tree
Showing 27 changed files with 24 additions and 46 deletions.
13 changes: 8 additions & 5 deletions src/_includes/layouts/project.njk
Original file line number Diff line number Diff line change
Expand Up @@ -9,26 +9,29 @@
{% block content %}
{% include 'partials/components/page-header.njk' %}
<article>
{% set articleTitle = title %}
{% set title = projectName %}
{% if parentTitle %}

{% set parentPages = collections.all | eleventyNavigationBreadcrumb(articleTitle) %}
{% set parentPages = collections.all | eleventyNavigationBreadcrumb(title) %}

<div class="back-to-parent">
{% if parentPages.length > 1 %}
{% set parent = parentPages[parentPages.length - 1] %}
<a href="{{ parent.url }}">{% include "svg/previous.svg" %} Back to {{ parent.title | safe }}</a>
{% endif %}
</div>

{% endif %}

<div class="content">
<div class="wrapper">
<h2>{{ articleTitle | safe }}</h2>
{% if parentTitle %}
<h2>{{ title | safe }}</h2>
{% endif %}
{{ content | safe }}
</div>
</div>

{% set navPages = collections.all | eleventyNavigation(articleTitle) %}
{% set navPages = collections.all | eleventyNavigation(title) %}

<nav class="nav--secondary" aria-labelledby="child-pages-heading">
{%- if navPages.length %}
Expand Down
6 changes: 3 additions & 3 deletions src/_includes/layouts/projects.njk
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@
{% else %}
<img class="thumbnail" src="/assets/images/project-placeholder.svg" role="presentation" alt="" />
{% endif %}
<h3>{{ project.data.projectName }}{{ " (" + project.data.shortName + ")" if project.data.shortName }}</h3>
<h3>{{ project.data.title }}{{ " (" + project.data.shortName + ")" if project.data.shortName }}</h3>
{% if project.data.content %}
{% set fullDescription = project.data.description + " [More about " + project.data.projectName + "](" + project.url + ")" %}
{% set fullDescription = project.data.description + " [More about " + project.data.title + "](" + project.url + ")" %}
{{ fullDescription | markdown | safe }}
{% else %}
{{ project.data.description | markdown | safe }}
{% endif %}
{% if project.data.link %}
<p class="project__link"><a rel="external" href="{{ project.data.link }}">Go to: {{ project.data.shortName if project.data.shortName else project.data.projectName }} website</a></p>
<p class="project__link"><a rel="external" href="{{ project.data.link }}">Go to: {{ project.data.shortName if project.data.shortName else project.data.title }} website</a></p>
{% endif %}
</article>
{% endfor %}
Expand Down
4 changes: 1 addition & 3 deletions src/_includes/partials/components/page-header.njk
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,14 @@
{% endfor %}
</p>
{% endif %}
<h1>{{ title }}</h1>
{% if projectName %}
<h1>{{ parentTitle if parentTitle else title }}</h1>
{% set links = page.url | locale_links %}
{%- for link in links %}

<a href="{{ link.url }}" lang="{{ link.lang }}" hreflang="{{ link.lang }}">
{%- include 'svg/icon-translation.svg' -%}<span>{{ 'Read in English' if link.lang === 'en-CA' else 'Lire en français' }}</span>
</a>
{%- endfor -%}
{% endif %}
{% if intro %}
<div class="intro">{{ intro | markdown | safe }}</div>
{% endif %}
Expand Down
7 changes: 3 additions & 4 deletions src/admin/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -445,11 +445,10 @@ collections:
sortable_fields: [title, order]
fields:
- {label: Layout, name: layout, widget: hidden, default: layouts/project.njk, i18n: duplicate}
- {label: Project Name, name: projectName, widget: string, required: true, hint: "Suggestion: If this is a sub-page of a project, enter the name of the project here.", i18n: true}
- {label: Project Name for URL, name: slug, widget: string, required: false, hint: "By default, the project name will be converted to a URL-safe format and used in the URL. To override this, enter a project name for the URL consisting only of lower case letters, numbers and hyphens, e.g. 'sample-project'. This must be unique.", i18n: true}
- {label: Body Title, name: title, widget: string, required: true, hint: "The title that appears after the Project Name and before the Body content. Suggestion: use a descriptive title which includes keywords from the project.", i18n: true}
- {label: Project Title, name: title, widget: string, required: true, hint: "The title of the project page or subpage. If this is a sub-page, the project title will be set by the Parent Project field below.", i18n: true}
- {label: Project Title for URL, name: slug, widget: string, required: false, hint: "By default, the project name will be converted to a URL-safe format and used in the URL. To override this, enter a project name for the URL consisting only of lower case letters, numbers and hyphens, e.g. 'sample-project'. This must be unique.", i18n: true}
- {label: Project Short Name, name: shortName, widget: string, required: false, hint: Short name for the project used to generate text labels for project website links. This is not required for sub-pages of a project., i18n: true}
- {label: Parent Page, name: parentTitle, widget: relation, collection: projects, value_field: title, search_fields: [title], required: false, hint: This is required for sub-pages of a project to define the sub-page hierarchy., i18n: true}
- {label: Parent Project, name: parentTitle, widget: relation, collection: projects, value_field: title, search_fields: [title], required: false, hint: This is required for sub-pages of a project to indicate which project is the parent., i18n: true}
- {label: Order, name: order, widget: number, required: false, hint: Order in which the project should appear., i18n: duplicate}
- {label: Subpage Order, name: subPageOrder, widget: number, required: false, hint: "Hint: if using this, all sub-pages at the same level should have an order number specified. Leave blank to have sub-pages appear in alphabetical order.", i18n: duplicate}
- {label: Thumbnail Image, name: thumbnailImage, widget: image, required: false, hint: "Suggested size: 680x494px. Images not fitting this aspect ratio will appear stretched.", i18n: duplicate}
Expand Down
4 changes: 2 additions & 2 deletions src/admin/previews.js
Original file line number Diff line number Diff line change
Expand Up @@ -164,9 +164,9 @@ const Project = ({entry}) => (
<Preview
entry={entry}
path="layouts/project.njk"
context={({projectName, title, body}) => ({
context={({parentTitle, projectName, title, body}) => ({
previewMode: true,
projectName,
parentTitle,
title,
headerBgColor: "coral-500",
headerBorderColor: "coral-800",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
---
layout: layouts/project.njk
projectName: Accessible Canada - Accessible World
slug: acaw
title: Accessible Canada - Accessible World
shortName: ACAW
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
---
projectName: Centre on Inclusive Software for Learning
title: Centre on Inclusive Software for Learning
shortName: CISL
description: Optimizing K-12 educational experiences for the diverse needs of all students.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
---
projectName: Coding to Learn and Create
title: Coding to Learn and Create
shortName: false
description: >-
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
---
layout: layouts/project.njk
projectName: Communication Access within the Accessible Canada Act
title: Communication Access Reports
parentTitle: Communication Access within the Accessible Canada Act
---
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
---
projectName: Communication Access within the Accessible Canada Act
shortName: ""
order: 65
title: Communication Access within the Accessible Canada Act
Expand Down
2 changes: 0 additions & 2 deletions src/collections/projects/en-CA/community-led-codesign.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
---
projectName: Community-Led Co-design Kit
title: Community-Led Co-design Kit
permalink: /projects/community-led-codesign-kit/
shortName: false
description: >-
An open source toolkit for sharing knowledge about how to do co-design led by community members and organizations.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
---
projectName: Data Communities for Inclusion
title: Data Communities for Inclusion
shortName: DCI
description: Data Communities for Inclusion is a network of researchers, designers, and community organizers who are advocating for cooperatively-owned approaches to governing Artificial Intelligence and data technologies. Funded by the Canadian Institute for Advanced Research (CIFAR), the DCI project is creating a toolkit of open-access data infrastructure tools, inclusive design resources, case studies, and governance practices that are motivated by the successful work of the Self-Employed Women’s Association and other grassroots communities.
Expand Down
1 change: 0 additions & 1 deletion src/collections/projects/en-CA/ecocultural-mapping.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
---
projectName: Ecocultural Mapping Project
title: Ecocultural Mapping Project
permalink: /projects/ecocultural-mapping-project/
shortName: false
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
---
projectName: Flexible Learning for Open Education
title: Flexible Learning for Open Education
shortName: FLOE
description: |-
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
---
projectName: Future of Work and Disability
title: Future of Work and Disability
shortName: FWD
description: >-
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
---
projectName: "Future of Work: Equitable Digital Systems"
title: EDS
title: "Future of Work: Equitable Digital Systems"
shortName: EDS
slug: eds
description: Equitable Digital Systems focused on examining the accessibility of
Expand Down
1 change: 0 additions & 1 deletion src/collections/projects/en-CA/inclusive-cities.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
---
projectName: Inclusive Cities
title: Inclusive Cities
shortName: false
description: >-
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
---
projectName: Intelligent User Interfaces for Virtual Healthcare
title: Reducing barriers to virtual healthcare
title: Intelligent User Interfaces for Virtual Healthcare
description: Intelligent User Interfaces for Virtual Healthcare aims to reduce
barriers to accessing healthcare through inclusive guidelines for (virtual or
in-person) healthcare and an approach to personalization in these settings.
order: 100
thumbnailImage: ""
---
## Reducing barriers to virtual healthcare

During the pandemic response and recovery, many health units are moving to virtual care. With this transition there is a risk that vulnerable individuals and communities will be excluded which harms and poses risks for the excluded individuals. Inclusive Design Research Centre (IDRC) and the National Research Council (NRC) under the [Pandemic Response Challenge Program](https://nrc.canada.ca/en/research-development/research-collaboration/programs/pandemic-response-challenge-program) collaborated to:

1. create guidelines for virtual healthcare systems that are inclusive and address the diversity of human needs, including cognitive, age-related and cultural barriers.
Expand Down Expand Up @@ -117,4 +118,4 @@ In addition to the ideas and concepts presented in the Guide and Software Approa
## Funders

Funded by [Pandemic Response Challenge Program](https://nrc.canada.ca/en/research-development/research-collaboration/programs/pandemic-response-challenge-program)
![The logo of the Government of Canada.](/media/canada.png)
![The logo of the Government of Canada.](/media/canada.png)
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
---
projectName: Learning to Be Human Together
title: Learning to Be Human Together
shortName: Humanizing Learning
description: "This resource explores the importance of, and processes for,
Expand Down
1 change: 0 additions & 1 deletion src/collections/projects/en-CA/odd.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
---
layout: layouts/project.njk
projectName: Optimizing Diversity with Disability
title: Optimizing Diversity with Disability
description: The goal of ODD is to investigate bias in hiring algorithms using
non-disability specific and synthesized disability specific employment data.
Expand Down
1 change: 0 additions & 1 deletion src/collections/projects/en-CA/our-doors-are-open.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
---
projectName: Our Doors Are Open
title: Our Doors Are Open
description: >-
Our Doors Are Open offers faith communities creative ideas and guidance to
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
---
projectName: Platform Co-op Development Kit
title: Platform Co-op Development Kit
permalink: /projects/platform-coop-development-kit/
shortName: false
description: >-
Providing the tools and resources to start, grow and convert to platform
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
---
projectName: Social Justice Repair Kit
title: Social Justice Repair Kit
shortName: false
description: |-
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
---
projectName: The Accessibility Exchange
title: The Accessibility Exchange
shortName: TAE
description: Connecting the disability and Deaf communities and their supporters
Expand Down
1 change: 0 additions & 1 deletion src/collections/projects/en-CA/we-count.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
---
projectName: We Count
title: We Count
shortName: false
order: 11
Expand Down
1 change: 0 additions & 1 deletion src/collections/projects/en-CA/weavly.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
---
projectName: Weavly
title: Weavly
description: Weavly is a tool designed for everyone to learn about coding.
Explore activities and discover new ways to turn your ideas into reality and
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
---
layout: layouts/project.njk
projectName: Un Canada accessible - Un monde accessible
slug: acaw
slug: cama
title: Un Canada accessible - Un monde accessible
shortName: ACAW
shortName: CAMA
order: 10
thumbnailImage: /media/acaw_logo_white_07.png
thumbnailAltText: Le contour d’une demi-feuille d’érable blanche s’étend sur une
Expand Down

0 comments on commit ea33d60

Please sign in to comment.