Skip to content

Commit

Permalink
about.avatar test
Browse files Browse the repository at this point in the history
  • Loading branch information
chemlord committed May 6, 2024
1 parent f42f32e commit 84ac58d
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 13 deletions.
2 changes: 1 addition & 1 deletion content/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ sections:
title: 'Hey There!'
subtitle: 'Welcome to my personal portfolio 👋'
text: |-
I'm Devraj Bagchi (you can call me Dev) and I'm a Biochemistry and Molecular Biology Honours student at Trent University. My academic interests lie deeply in Synthetic Organic Chemistry, specifically Carbonyl chemistry, which I explore both theoretically and through sample analysis via analytical instrumentation and data documentation critical for high-standard research.
I'm Devraj Bagchi and I'm a Biochemistry and Molecular Biology Honours student at Trent University. My academic interests lie deeply in Synthetic Organic Chemistry, specifically Carbonyl chemistry, which I explore both theoretically and through sample analysis via analytical instrumentation and data documentation critical for high-standard research.
As a hobby, I've also developed skills in front-end web development and UI design, learning languages such as Go, HTML, CSS, and Python, which I enjoy applying to create and manage my own academic portfolio.
Expand Down
35 changes: 23 additions & 12 deletions layouts/partials/blocks/about.avatar.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,39 +11,47 @@
{{ $author = .author }}
{{ else }}
{{ $author = $block.content.username }}
{{ end }}
{{end}}

{{ $person_page_path := (printf "/authors/%s" $author) }}
{{ $person_page := site.GetPage $person_page_path }}
{{ if not $person_page }}
{{ errorf "Could not find an author page at `%s`. Please check the value of `author` in your About widget and create an associated author page if one does not already exist. See https://docs.hugoblox.com/page-builder/#about " $person_page_path }}
{{ end }}
{{end}}
{{ $person := $person_page.Params }}
{{ $avatar := ($person_page.Resources.ByType "image").GetMatch "*avatar*" }}
{{ $avatar_shape := site.Params.features.avatar.shape | default "circle" }}

<div id="profile">

{{ if $avatar }}
<div class="avatar-wrapper">
{{ $avatar_image := $avatar.Fill "150x150 Center" }}
<img class="avatar {{if eq $avatar_shape "square"}}avatar-square{{else}}avatar-circle{{end}}"
src="{{ $avatar_image.RelPermalink }}" alt="{{$person_page.Title}}"
<img class="avatar {{if eq $avatar_shape "square"}}avatar-square{{else}}avatar-circle{{end}}" src="{{ $avatar_image.RelPermalink }}" alt="{{$person_page.Title}}"
width="{{ $avatar_image.Width }}" height="{{ $avatar_image.Height }}">
{{with $person.status.icon}}<span class="avatar-emoji">{{.|emojify}}</span>{{end}}
</div>
{{ end }}

<div class="portrait-title">
<h2><strong>{{ $person_page.Title }}</strong></h2> <!-- Bold the name -->

<h2>
{{- if $person.name_pronunciation -}}
<ruby>
<rb>{{ $person_page.Title }}</rb>
<rt>{{ $person.name_pronunciation }}</rt>
</ruby>
{{- else -}}
{{- $person_page.Title -}}
{{- end -}}
</h2>

{{ with $person.role }}<h3>{{ . | markdownify | emojify }}</h3>{{ end }}

{{ range $person.organizations }}
<h3>
{{ with .url }}<a href="{{ . }}" target="_blank" rel="noopener">{{ end }}
{{ if eq .name "Trent University" }} <!-- Highlight only if it's Trent University -->
<mark style="background-color: #184233; color: white;">{{ .name }}</mark>
{{ else }}
{{ .name }}
{{ end }}
<span>{{ .name }}</span>
{{ if .url }}</a>{{ end }}
</h3>
{{ end }}
Expand Down Expand Up @@ -76,7 +84,10 @@ <h3>

{{ with ($block.content.text | emojify | $page.RenderString) | default $person_page.Content }}
<div class="article-style pt-2 d-flex justify-content-center">
<div class="bio-text">{{ . }}</div>
<div class="bio-text">
{{ . }}
</div>
</div>
{{ end }}
</div>

</div>

0 comments on commit 84ac58d

Please sign in to comment.