@@ -117,17 +117,6 @@ <h1 class="lg:text-6xl">{{ .Title }}</h1>
117117 text-underline-offset : 3px ;
118118 }
119119
120- .project-category-tag {
121- padding : 0.33rem 0.72rem ;
122- border-radius : 9999px ;
123- font-size : 0.72rem ;
124- font-weight : 600 ;
125- text-transform : uppercase;
126- letter-spacing : 0.045em ;
127- box-shadow : 0 2px 8px rgba (2 , 6 , 23 , 0.24 );
128- white-space : nowrap;
129- }
130-
131120 .project-description {
132121 margin : 0 ;
133122 color : rgb (71 , 85 , 105 );
@@ -137,27 +126,10 @@ <h1 class="lg:text-6xl">{{ .Title }}</h1>
137126 .dark .project-description {
138127 color : rgb (203 , 213 , 225 );
139128 }
140-
141- .category-energy { background-color : # f59e0b ; color : white; }
142- .category-maritime { background-color : # 3b82f6 ; color : white; }
143- .category-marketing { background-color : # ec4899 ; color : white; }
144- .category-health { background-color : # 10b981 ; color : white; }
145- .category-transport { background-color : # 8b5cf6 ; color : white; }
146- .category-manufacturing { background-color : # f97316 ; color : white; }
147- .category-insurance { background-color : # 0ea5e9 ; color : white; }
148- .category-fintech { background-color : # 14b8a6 ; color : white; }
149- .category-legaltech { background-color : # 6366f1 ; color : white; }
150- .category-talk { background-color : # 2563eb ; color : white; }
151- .category-seminar { background-color : # 0f766e ; color : white; }
152- .category-workshop { background-color : # 4f46e5 ; color : white; }
153- .category-conference { background-color : # 7c3aed ; color : white; }
154- .category-interview { background-color : # db2777 ; color : white; }
155- .category-media { background-color : # ea580c ; color : white; }
156- .category-research { background-color : # 0891b2 ; color : white; }
157- .category-outreach { background-color : # 4338ca ; color : white; }
158- .category-default { background-color : # 6b7280 ; color : white; }
159129</ style >
160130
131+ {{ partial "components/project-category-tag-styles.html" . }}
132+
161133< div class ="flex flex-col items-center ">
162134 < div class ="flex-auto ">
163135 < div class ="sm:px-8 ">
@@ -169,44 +141,9 @@ <h1 class="lg:text-6xl">{{ .Title }}</h1>
169141 {{ range $paginator.Pages }}
170142 {{ $event := . }}
171143 {{ $description := $event.Params.summary | default $event.Params.abstract | default $event.Params.description }}
172- {{ $category := $event.Params.category }}
173-
174- {{ if not $category }}
175- {{ with $event.Params.projects }}
176- {{ $projectRef := printf "%v" (index . 0) }}
177- {{ $projectSlug := replaceRE "^.*/" "" $projectRef }}
178- {{ $projectPage := or ($event.Site.GetPage (printf "/industry/%s" $projectSlug)) ($event.Site.GetPage (printf "/research/%s" $projectSlug)) }}
179- {{ with $projectPage }}
180- {{ with .Params.category }}
181- {{ $category = . }}
182- {{ else }}
183- {{ $category = .CurrentSection.Title | default (humanize .Type) }}
184- {{ end }}
185- {{ end }}
186- {{ end }}
187- {{ end }}
188-
189- {{ if not $category }}
190- {{ if in $event.Params.tags "media" }}
191- {{ $category = "Media" }}
192- {{ else if in $event.Params.tags "interview" }}
193- {{ $category = "Interview" }}
194- {{ else if in $event.Params.tags "workshop" }}
195- {{ $category = "Workshop" }}
196- {{ else if in $event.Params.tags "seminar" }}
197- {{ $category = "Seminar" }}
198- {{ else if in $event.Params.tags "conference" }}
199- {{ $category = "Conference" }}
200- {{ else if in $event.Params.tags "talk" }}
201- {{ $category = "Talk" }}
202- {{ else if gt (len $event.Params.tags) 0 }}
203- {{ $category = title (index $event.Params.tags 0) }}
204- {{ else }}
205- {{ $category = "Outreach" }}
206- {{ end }}
207- {{ end }}
208-
209- {{ $categoryClass := print "category-" (lower (replace $category " " "-")) }}
144+ {{ $categoryMeta := partial "functions/outreach-category-meta.html" (dict "event" $event) }}
145+ {{ $categoryClass := index $categoryMeta "class" }}
146+ {{ $categoryLabel := index $categoryMeta "label" }}
210147 < article class ="project-row group ">
211148 < a href ="{{ $event.RelPermalink }} " class ="project-media ">
212149 < div class ="project-image-zoom ">
@@ -224,7 +161,6 @@ <h1 class="lg:text-6xl">{{ .Title }}</h1>
224161 < h3 class ="project-row-title ">
225162 < a href ="{{ $event.RelPermalink }} " class ="project-row-title-link "> {{ $event.Title }}</ a >
226163 </ h3 >
227- {{ $categoryLabel := title (replace (replace $category "-" " ") "_" " ") }}
228164 < span class ="project-category-tag category-default {{ $categoryClass }} "> {{ $categoryLabel }}</ span >
229165 </ div >
230166
0 commit comments