Skip to content

Commit

Permalink
Merge pull request #23 from nikoshell/main
Browse files Browse the repository at this point in the history
Add gravatar with example usage
  • Loading branch information
nikoshell authored Jun 20, 2024
2 parents 5a166bb + dea2224 commit 055e8b4
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 12 deletions.
Binary file added assets/avatars/Eternal.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed assets/avatars/nikoshell.png
Binary file not shown.
3 changes: 2 additions & 1 deletion data/members.toml
Original file line number Diff line number Diff line change
Expand Up @@ -120,12 +120,13 @@ name = "terjanq"

[[current]]
name = "Eternal"
tags = [ "pwn", "crypto" ]
tags = [ "pwn" ]
link = "https://eternal.red"

[[current]]
name = "nikoshell"
link = "https://github.com/nikoshell/"
gravatar = "3aecd7dd480bf54dd324d4ac2b3f4b094f12138b7fb38cf6118f2eadeb93d661"

[[current]]
name = "foxtrot_charlie"
Expand Down
26 changes: 15 additions & 11 deletions layouts/shortcodes/memberlist.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,23 @@
<ul class="member-list">
{{ range .Site.Data.members.current }}
<li>
{{ $avatar := printf "avatars/%s.png" .name }}
{{ $image := resources.Get $avatar }}
{{- if $image }}
{{ $image := $image.Process "fit 200x200" }}
{{- if .link }}
<a href="{{ .link }}">
<img class="avatar" src="{{ $image.RelPermalink }}" />
</a>
{{ else }}
{{- if .gravatar }}
<a href="{{ .link }}">
{{ $avatar := printf "https://gravatar.com/avatar/%s.jpg?s=142" .gravatar }}
{{ $image := resources.GetRemote $avatar}}
<img class="avatar" src="{{ $image.RelPermalink }}" />
{{ end -}}
</a>
{{ else }}
<img class="blank-avatar" src="/blank_avatar.png" alt="No avatar image" />
{{ $avatar := printf "avatars/%s.png" .name }}
{{ $image := resources.Get $avatar }}
{{- if $image }}
{{ $image := $image.Process "fit 200x200" }}
<a href="{{ .link }}">
<img class="avatar" src="{{ $image.RelPermalink }}" />
</a>
{{ else }}
<img class="blank-avatar" src="/blank_avatar.png" alt="No avatar image" />
{{end -}}
{{end -}}
<h4 class="member-name">
{{- if .link }}<a href="{{ .link }}"><u>{{ .name }}</u></a>{{ else }}{{ .name }}{{ end -}}
Expand Down

0 comments on commit 055e8b4

Please sign in to comment.