-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: forbetra vising av forfattarinformasjon, innleggsmedium
- Loading branch information
1 parent
aa78bb5
commit 9292d1d
Showing
11 changed files
with
346 additions
and
100 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,9 @@ | ||
asimonian: | ||
name: Adaline Simonian | ||
bio: Adaline er grunnleggjaren av Ordbok API-prosjektet. Hen er ein full-stack utviklar og har ein lidenskap for språk og teknologi. | ||
picture: '/assets/img/avatars/asimonian.jpg' | ||
social: | ||
- title: GitHub | ||
url: https://github.com/adalinesimonian | ||
- title: Bluesky | ||
url: https://bsky.app/profile/adaline.bsky.social |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
<span | ||
class="d-inline-flex justify-center align-items-center ps-1 pe-2 py-1 mx-1 my-3" | ||
> | ||
<span class="me-2"> | ||
{%- include avatar.html author=include.author size="4em" -%} | ||
</span> | ||
<span class="d-flex flex-column align-items-start justify-content-center"> | ||
<span | ||
itemprop="author" | ||
itemscope | ||
itemtype="http://schema.org/Person" | ||
class="d-flex align-items-center mb-1 fw-bolder" | ||
><span class="p-author h-card" itemprop="name"> | ||
{{- site.data.authors[include.author].name | default: include.author -}} | ||
</span></span | ||
> | ||
<span class="text-deemphasize small mb-1"> | ||
{%- if site.data.authors[include.author].bio -%} | ||
<span itemprop="description">{{- site.data.authors[include.author].bio -}}</span> | ||
{%- endif -%} | ||
</span> | ||
|
||
{%- if site.data.authors[include.author].social -%} | ||
<span class="d-flex flex-row align-items-center justify-content-start"> | ||
{%- for social in site.data.authors[include.author].social -%} | ||
<a | ||
href="{{- social.url -}}" | ||
class="small me-2" | ||
itemprop="sameAs" | ||
target="_blank" | ||
rel="noopener" | ||
> | ||
{{- social.title -}} | ||
</a> | ||
{%- endfor -%} | ||
</span> | ||
{%- endif -%} | ||
</span> | ||
</span> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,31 @@ | ||
<style> | ||
.author-avatar, | ||
.author-avatar-placeholder { | ||
width: {{ include.size | default: "32px" }}; | ||
height: {{ include.size | default: "32px" }}; | ||
} | ||
|
||
.author-avatar { | ||
object-fit: cover; | ||
} | ||
|
||
.author-avatar-placeholder { | ||
line-height: {{ include.size | default: "32px" }}; | ||
text-align: center; | ||
color: white; | ||
background-color: #6c757d; | ||
border-radius: 50%; | ||
display: inline-block; | ||
} | ||
</style> | ||
|
||
{% assign size = include.size | default: '32px' %} | ||
{% assign pictureUrl = site.data.authors[include.author].picture %} | ||
{% if pictureUrl %} | ||
<img | ||
src="{{ pictureUrl }}" | ||
class="rounded-circle img-fluid author-avatar" | ||
class="rounded-circle object-fit-cover author-avatar" | ||
style="width: {{ size }}; height: {{ size }}" | ||
alt="{{ include.author }}'s avatar" | ||
> | ||
{% else %} | ||
<div | ||
class="rounded-circle bg-secondary d-inline-block author-avatar-placeholder" | ||
<span | ||
class="rounded-circle bg-secondary d-inline-flex justify-content-center align-items-center author-avatar" | ||
style="width: 1em; height: 1em; font-size: {{ size }}" | ||
> | ||
{% assign initials = include.author | split: ' ' | map: 'first' | join: '' %} | ||
{{ initials }} | ||
</div> | ||
{% assign name = site.data.authors[include.author].name | default: include.author %} | ||
{% assign initials = name | initials %} | ||
{% comment %} | ||
determine text size based on how many characters long the initials are | ||
the longer the initials, the smaller the font size | ||
2-character initials will have a font size of 0.5em | ||
|
||
y=-\frac{1}{8}x+0.75 | ||
|
||
where x is the number of characters in the initials | ||
{% endcomment %} | ||
{% assign fontSize = -0.125 | times: initials.size | plus: 0.75 %} | ||
<span class="text-center" style="font-size: {{ fontSize }}em"> | ||
{{ initials }} | ||
</span> | ||
</span> | ||
{% endif %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.