feat: add support for displaying organization logos (#3282)

Add `icon` option to `organizations` and `education` data structures in author profiles.

Use the standard icon feature to apply a custom brand icon e.g. `icon: 'brands/my_company' and place `my_company.svg` in your `assets/media/icons/brands/` folder.

Co-authored-by: Olaf Lipinski <5785856+olipinski@users.noreply.github.com>

Closes #3281
This commit is contained in:
Olaf Lipinski authored and GitHub committed 2025-10-21 22:20:10 +01:00
1 parent cdee5c8997
commit 8b7392b56d
3 files changed
+20 -6

No files matched your search

@@ -187,8 +187,12 @@
{{ range . }}
<div class="group h-full flex flex-col bg-gradient-to-br from-white/90 to-primary-50/30 dark:from-gray-800/90 dark:to-primary-900/20 rounded-xl p-6 shadow-md hover:shadow-xl transition-all duration-300 border border-transparent hover:border-primary-200 dark:hover:border-primary-800 backdrop-blur-md">
<div class="flex gap-4">
<div class="flex-shrink-0 w-12 h-12 bg-primary-600 rounded-full flex items-center justify-center shadow-md">
{{ partial "functions/get_icon" (dict "name" "academic-cap" "attributes" "class='w-6 h-6 text-white'") }}
<div class="flex-shrink-0 w-12 h-12 bg-white dark:bg-gray-800 ring-1 ring-gray-200 dark:ring-gray-700 rounded-full flex items-center justify-center shadow-md">
{{ if .icon }}
{{ partial "functions/get_icon" (dict "name" .icon "attributes" "class='w-6 h-6 text-primary-600 dark:text-primary-400'") }}
{{else}}
{{ partial "functions/get_icon" (dict "name" "academic-cap" "attributes" "class='w-6 h-6 text-primary-600 dark:text-primary-400'") }}
{{end}}
</div>
<div class="flex-1 flex-grow">
<p class="text-xl font-bold text-gray-900 dark:text-white group-hover:text-primary-600 dark:group-hover:text-primary-400 transition-colors">
@@ -33,7 +33,11 @@
{{ range $idx, $key := $person.work }}
<li class="mb-10 ms-6">
<span class="absolute flex items-center justify-center w-6 h-6 bg-primary-100 rounded-full -start-3 ring-8 ring-white dark:ring-gray-900 dark:bg-primary-900">
<svg xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 0 256 256" class="w-5 h-5 text-primary-800 dark:text-primary-300"><path d="M216,56H176V48a24,24,0,0,0-24-24H104A24,24,0,0,0,80,48v8H40A16,16,0,0,0,24,72V200a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V72A16,16,0,0,0,216,56ZM96,48a8,8,0,0,1,8-8h48a8,8,0,0,1,8,8v8H96ZM216,72v41.61A184,184,0,0,1,128,136a184.07,184.07,0,0,1-88-22.38V72Zm0,128H40V131.64A200.19,200.19,0,0,0,128,152a200.25,200.25,0,0,0,88-20.37V200ZM104,112a8,8,0,0,1,8-8h32a8,8,0,0,1,0,16H112A8,8,0,0,1,104,112Z"></path></svg>
{{ if .icon }}
{{ partial "functions/get_icon" (dict "name" .icon "attributes" "class='w-5 h-5'") }}
{{else}}
<svg xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 0 256 256" class="w-5 h-5 text-primary-800 dark:text-primary-300"><path d="M216,56H176V48a24,24,0,0,0-24-24H104A24,24,0,0,0,80,48v8H40A16,16,0,0,0,24,72V200a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V72A16,16,0,0,0,216,56ZM96,48a8,8,0,0,1,8-8h48a8,8,0,0,1,8,8v8H96ZM216,72v41.61A184,184,0,0,1,128,136a184.07,184.07,0,0,1-88-22.38V72Zm0,128H40V131.64A200.19,200.19,0,0,0,128,152a200.25,200.25,0,0,0,88-20.37V200ZM104,112a8,8,0,0,1,8-8h32a8,8,0,0,1,0,16H112A8,8,0,0,1,104,112Z"></path></svg>
{{end}}
</span>
<h3 class="flex items-center mb-1 text-lg font-semibold text-gray-900 dark:text-white">{{.position}}
<!-- <span class="bg-blue-100 text-blue-800 text-sm font-medium me-2 px-2.5 py-0.5 rounded dark:bg-blue-900 dark:text-blue-300 ms-3">Latest</span>-->
@@ -71,8 +75,11 @@
{{ range $idx, $key := $person.education }}
<li class="mb-10 ms-6">
<span class="absolute flex items-center justify-center w-6 h-6 bg-primary-100 rounded-full -start-3 ring-8 ring-white dark:ring-gray-900 dark:bg-primary-900">
{{ if .icon }}
{{ partial "functions/get_icon" (dict "name" .icon "attributes" "class='w-5 h-5 text-primary-800 dark:text-primary-300'") }}
{{else}}
<svg xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 0 256 256" class="w-5 h-5 text-primary-800 dark:text-primary-300"><path d="M251.76,88.94l-120-64a8,8,0,0,0-7.52,0l-120,64a8,8,0,0,0,0,14.12L32,117.87v48.42a15.91,15.91,0,0,0,4.06,10.65C49.16,191.53,78.51,216,128,216a130,130,0,0,0,48-8.76V240a8,8,0,0,0,16,0V199.51a115.63,115.63,0,0,0,27.94-22.57A15.91,15.91,0,0,0,224,166.29V117.87l27.76-14.81a8,8,0,0,0,0-14.12ZM128,200c-43.27,0-68.72-21.14-80-33.71V126.4l76.24,40.66a8,8,0,0,0,7.52,0L176,143.47v46.34C163.4,195.69,147.52,200,128,200Zm80-33.75a97.83,97.83,0,0,1-16,14.25V134.93l16-8.53ZM188,118.94l-.22-.13-56-29.87a8,8,0,0,0-7.52,14.12L171,128l-43,22.93L25,96,128,41.07,231,96Z"></path></svg>
</svg>
{{end}}
</span>
<h3 class="flex items-center mb-1 text-lg font-semibold text-gray-900 dark:text-white">{{.area}}
<!-- <span class="bg-blue-100 text-blue-800 text-sm font-medium me-2 px-2.5 py-0.5 rounded dark:bg-blue-900 dark:text-blue-300 ms-3">Latest</span>-->
@@ -56,6 +56,7 @@ interests:
education:
- area: PhD Computer Science (AI Focus)
institution: Stanford University
icon: ""
date_start: 2015-09-01
date_end: 2019-06-30
summary: |
@@ -65,6 +66,7 @@ education:
url: 'https://example.com/thesis.pdf'
- area: MS Computer Science
institution: Carnegie Mellon University
icon: ""
date_start: 2013-09-01
date_end: 2015-05-31
summary: |
@@ -73,6 +75,7 @@ education:
Specialized in machine learning and robotics.
- area: BS Computer Science
institution: MIT
icon: ""
date_start: 2009-09-01
date_end: 2013-05-31
summary: |
@@ -84,7 +87,7 @@ work:
- position: Senior AI Research Scientist
company_name: Meta AI
company_url: 'https://ai.meta.com/'
company_logo: ''
icon: ''
date_start: 2020-01-01
date_end: ''
summary: |2-
@@ -92,7 +95,7 @@ work:
- position: AI Research Intern
company_name: OpenAI
company_url: 'https://openai.com/'
company_logo: ''
icon: ''
date_start: 2019-06-01
date_end: 2019-12-31
summary: |