Skip to content

Commit

Permalink
feat: support person icon on default author settings
Browse files Browse the repository at this point in the history
  • Loading branch information
HEIGE-PCloud authored and Jatin794 committed Dec 19, 2024
1 parent 1100152 commit 614823f
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 61 deletions.
61 changes: 2 additions & 59 deletions assets/css/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -575,39 +575,23 @@ ul {
--tw-backdrop-sepia: ;
}

.tw-m-1 {
margin: 0.25rem;
}

.tw-m-4 {
margin: 1rem;
}

.tw-my-4 {
margin-top: 1rem;
margin-bottom: 1rem;
}

.tw-mr-1 {
margin-right: 0.25rem;
}

.tw-ml-4 {
margin-left: 1rem;
}

.tw-block {
display: block;
.tw-mr-1 {
margin-right: 0.25rem;
}

.tw-inline-block {
display: inline-block;
}

.tw-flex {
display: flex;
}

.tw-max-h-4 {
max-height: 1rem;
}
Expand All @@ -616,52 +600,11 @@ ul {
max-height: 2rem;
}

.tw-max-h-16 {
max-height: 4rem;
}

.tw-max-h-12 {
max-height: 3rem;
}

.tw-max-h-6 {
max-height: 1.5rem;
}

.tw-translate-y-1 {
--tw-translate-y: 0.25rem;
transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
}

.tw-translate-y-\[-1\] {
--tw-translate-y: -1;
transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
}

.tw-translate-y-\[-2\] {
--tw-translate-y: -2;
transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
}

.tw-translate-y-\[-3\] {
--tw-translate-y: -3;
transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
}

.tw-translate-y-\[-1px\] {
--tw-translate-y: -1px;
transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
}

.tw-translate-y-\[-2px\] {
--tw-translate-y: -2px;
transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
}

.tw-items-center {
align-items: center;
}

.tw-rounded-full {
border-radius: 9999px;
}
Expand Down
2 changes: 1 addition & 1 deletion exampleSite/config/_default/author.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ name = "PCloud"
email = "[email protected]"
link = "https://github.com/HEIGE-PCloud"
avatar = "/images/avatar.webp"
gravatarEmail = ""
gravatarEmail = "[email protected]"
11 changes: 10 additions & 1 deletion themes/DoIt/layouts/partials/meta/author.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,16 @@
{{- else -}}
{{- $author := .Params.author | default .Site.Author.name | default (T "author") -}}
{{- $link := .Params.authorlink | default .Site.Author.link | default .Site.Home.RelPermalink -}}
{{- $gravatar := 0 -}}
{{- with .Site.Author.gravataremail -}}
{{- $gravatar = md5 . | printf "https://www.gravatar.com/avatar/%v?s=240&d=mp" -}}
{{- end -}}
{{- $avatar := .Params.authoravatar | default .Site.Author.avatar | default $gravatar | default false -}}
{{- $options := dict "Class" "author" "Destination" $link "Title" "Author" "Rel" "author" "Content" $author -}}
{{- partial "plugin/icon.html" $icon -}}
{{- if $avatar -}}
<img src="{{ $avatar | absURL }}" alt="{{ $author }} avatar" class="tw-inline-block tw-max-h-4 tw-rounded-full tw-translate-y-[-2px] tw-mr-1">
{{- else -}}
{{- partial "plugin/icon.html" $icon -}}
{{- end -}}
{{- partial "plugin/link.html" $options -}}
{{- end -}}

0 comments on commit 614823f

Please sign in to comment.