Skip to content

Commit

Permalink
ENH: Remove location for PW 42
Browse files Browse the repository at this point in the history
  • Loading branch information
sjh26 authored Nov 19, 2024
1 parent 7812418 commit 4cb35f6
Show file tree
Hide file tree
Showing 7 changed files with 106 additions and 14 deletions.
10 changes: 0 additions & 10 deletions .github/ISSUE_TEMPLATE/project.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,16 +43,6 @@ body:
value: |
_If you are unable to find a category that is suitable for your project, or believe that a specific category is missing, please discuss it with the organizers._
- type: dropdown
attributes:
label: Presenter Location
description: Select whether the presenter will be In-person or Online.
options:
- In-person
- Online
validations:
required: true

- type: textarea
attributes:
label: Key Investigators
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/project-page-pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,6 @@ jobs:
--rawfile background "${{ runner.temp }}/background.md" '{
"title": $title,
"category": .category.text,
"presenter_location": .["presenter-location"].text,
"description": $description,
"objective": $objective,
"approach": $approach,
Expand Down
1 change: 0 additions & 1 deletion PW42_2025_GranCanaria/Projects/Template/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ permalink: /:path/

project_title: Write full project title here
category: Uncategorized
presenter_location: Online

key_investigators:
- name: Person Doe
Expand Down
1 change: 0 additions & 1 deletion PW42_2025_GranCanaria/Projects/Template/README.md.j2
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ permalink: /:path/

project_title: {{ title | to_yaml | regex_replace("\n$|\n\.\.\.\n$", "") }}
category: {{ category | regex_replace("\n$|\n\.\.\.\n$", "") }}
presenter_location: {{ presenter_location | regex_replace("\n$|\n\.\.\.\n$", "") }}

key_investigators:
{% for investigator in investigators %}
Expand Down
2 changes: 1 addition & 1 deletion PW42_2025_GranCanaria/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ The **Discord** application is used to communicate between team members and orga

To learn how to create or update project pages, please refer to the [contributing project pages](ContributingProjectPages.md) section.

{% include projects.md %}
{% include projects_noloc.md %}

## Registrants

Expand Down
78 changes: 78 additions & 0 deletions _includes/project_generate_category_noloc.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
<!-- _includes/project_generate_category.md
event_name ..........: {{ event_name }}
project_count .......: {{ project_count }}
requested_category ..: {{ requested_category }}
-->

{% for pw_page in site.pages %}

{% comment %}Extract page event name (e.g "PW39_2023_Montreal"){% endcomment %}
{% assign pw_page_event_name = pw_page.path | split: '/' | first %}

{% comment %}Only process page associated with the current event.{% endcomment %}
{% if pw_page_event_name != event_name %}
{% continue %}
{% endif %}

{% comment %}Extract page event type (e.g "Projects").{% endcomment %}
{% assign pw_page_type = pw_page.path | split: '/' | slice: 1 | first %}

{% comment %}Only process pages located in the "Projects" directory.{% endcomment %}
{% if pw_page_type != "Projects" %}
{% continue %}
{% endif %}

{% comment %}Extract page project name (e.g "SlicerVRInteraction").{% endcomment %}
{% assign project_name = pw_page.path | split: '/' | slice: 2 | first | downcase %}

{% comment %}Ignore "Template" and "README.md" file.{% endcomment %}
{% if project_name == "template" or project_name == "readme.md" %}
{% continue %}
{% endif %}

{% assign pw_page_category = pw_page.category | default:"Uncategorized" %}

{% comment %}Force all non-matching projects to Uncategorized.{% endcomment %}
{% unless page.project_categories contains pw_page_category %}
{% assign pw_page_category = "Uncategorized" %}
{% endunless %}

{% if pw_page_category != requested_category %}
{% continue %}
{% endif %}

{% assign project_count = project_count | plus: 1 %}

{% if page.project_categories contains pw_page_category %}

{% comment %}If if applies, add catergory header.{% endcomment %}
{% unless categories contains pw_page_category %}
{% capture categories %}
{{ categories }}
### {{ pw_page_category }}
{% endcapture %}
{% endunless %}

{% comment %}Append category entry.{% endcomment %}
{% capture categories %}
{{ categories }}
1. [{{ pw_page.project_title }}]({{ pw_page.url }}) (
{%- for investigator in pw_page.key_investigators -%}
{{ investigator.name }}{% unless forloop.last %}, {% endunless -%}
{%- endfor -%}
)
{% endcapture %}

{% else %}

{% capture uncategorized %}
{{ uncategorized }}
1. [{{ pw_page.project_title }}]({{ pw_page.url }}) (
{%- for investigator in pw_page.key_investigators -%}
{{ investigator.name }}{% unless forloop.last %}, {% endunless -%}
{%- endfor -%}
) (Category: {{pw_page.category}})
{% endcapture %}

{% endif %}
{% endfor %}
27 changes: 27 additions & 0 deletions _includes/projects_noloc.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<!-- Begin _includes/projects.md -->

{% comment %}Extract event name (e.g "PW39_2023_Montreal"). {% endcomment %}
{% assign event_name = page.path | split: '/' | first %}

{% assign project_count = 0 %}
{% assign categories = "" %}
{% assign uncategorized = "" %}

{% for requested_category in page.project_categories %}
{% include project_generate_category_noloc.md %}
{% endfor %}

{% assign requested_category = "Uncategorized" %}
{% include project_generate_category.md %}

_The {{ event_name }} event has a total of {{ project_count }} projects._

{{ categories }}

### Uncategorized

_This section lists projects that either have no category assigned, are assigned to the "Uncategorized" category, or are assigned to a different category than the ones listed above. If you are unable to find a category that is suitable for your project, or believe that a specific category is missing, please discuss it with the [organizers](#organizers)._

{{ uncategorized }}

<!-- End _includes/projects.md -->

0 comments on commit 4cb35f6

Please sign in to comment.