Skip to content

Commit f1c54f7

Browse files
author
Daniel Precioso, PhD
committed
Add new project categories for mathematics and machine learning, and update category assignment logic
1 parent 5c3d383 commit f1c54f7

2 files changed

Lines changed: 24 additions & 2 deletions

File tree

layouts/partials/components/project-category-tag-styles.html

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@
2727
.category-interview { background-color: #db2777; color: white; }
2828
.category-media { background-color: #ea580c; color: white; }
2929
.category-research { background-color: #0891b2; color: white; }
30-
.category-academic-research { background-color: #0891b2; color: white; }
30+
.category-mathematics { background-color: #0891b2; color: white; }
31+
.category-mathematical-physics { background-color: #0f766e; color: white; }
32+
.category-financial-mathematics { background-color: #0284c7; color: white; }
33+
.category-machine-learning { background-color: #2563eb; color: white; }
34+
.category-industry { background-color: #475569; color: white; }
3135
.category-outreach { background-color: #4338ca; color: white; }
3236
</style>

layouts/partials/functions/outreach-category-meta.html

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,22 @@
1919
{{- with .Params.category -}}
2020
{{- $category = . -}}
2121
{{- else -}}
22-
{{- $category = .CurrentSection.Title | default (humanize .Type) -}}
22+
{{- if eq .Type "research" -}}
23+
{{- $projectTitle := lower (printf "%v" .Title) -}}
24+
{{- if or (findRE "machine learning|artificial intelligence|data science|neural|deep learning" $projectTitle) (findRE "machine-learning|ai" $projectSlug) -}}
25+
{{- $category = "machine learning" -}}
26+
{{- else if or (findRE "financial|finance" $projectTitle) (findRE "financial" $projectSlug) -}}
27+
{{- $category = "financial mathematics" -}}
28+
{{- else if or (findRE "quantum|many-body|lie groups|mathematical physics|chaotic|dynamical|infotaxis" $projectTitle) (findRE "quantum|many-body|lie-groups|mathematical-physics|chaotic|dynamical|infotaxis" $projectSlug) -}}
29+
{{- $category = "mathematical physics" -}}
30+
{{- else -}}
31+
{{- $category = "mathematics" -}}
32+
{{- end -}}
33+
{{- else if eq .Type "industry" -}}
34+
{{- $category = "industry" -}}
35+
{{- else -}}
36+
{{- $category = humanize .Type -}}
37+
{{- end -}}
2338
{{- end -}}
2439
{{- end -}}
2540
{{- end -}}
@@ -48,6 +63,9 @@
4863
{{- end -}}
4964

5065
{{- $categoryValue := printf "%v" $category -}}
66+
{{- if eq (lower $categoryValue) "academic research" -}}
67+
{{- $categoryValue = "mathematics" -}}
68+
{{- end -}}
5169
{{- $categoryClass := print "category-" (lower (replace (replace $categoryValue "_" "-") " " "-")) -}}
5270
{{- $categoryLabel := title (replace (replace (replace $categoryValue "-" " ") "_" " ") "/" " ") -}}
5371

0 commit comments

Comments
 (0)