-
-
Notifications
You must be signed in to change notification settings - Fork 194
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add support for friend link shortcode
- Add friend link shortcode template - Add friend link shortcode stylesheet - Add documentation for friend link shortcode - Add test page for friend link shortcode
- Loading branch information
1 parent
768a0f5
commit 997bb42
Showing
6 changed files
with
233 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,124 @@ | ||
$avatar-border-color: #f0f0f0; | ||
$avatar-border-color-dark: #363636; | ||
$avatar-border-color-black: #363636; | ||
|
||
$friend-link-background-color: #f8f8f8; | ||
$friend-link-background-color-dark: #252627; | ||
$friend-link-background-color-black: #111111; | ||
|
||
$friend-link-color: #2d96bd; | ||
$friend-link-color-dark: #a9a9b3; | ||
$friend-link-color-black: #d9d9d9; | ||
|
||
$friend-link-hover-color: #ef3982; | ||
$friend-link-hover-color-dark: #ffffff; | ||
$friend-link-hover-color-black: #ffffff; | ||
|
||
.friend-avatar { | ||
width: 56px; | ||
height: 56px; | ||
padding: 2px; | ||
margin-top: 14px; | ||
margin-left: 14px; | ||
border-radius: 50%; | ||
border: 1px solid $avatar-border-color; | ||
[theme=dark] & { | ||
border: 1px solid $avatar-border-color-dark; | ||
} | ||
[theme=black] & { | ||
border: 1px solid $avatar-border-color-black; | ||
} | ||
} | ||
|
||
.friend-link-div { | ||
height: 92px; | ||
margin-top: 10px; | ||
width: 48%; | ||
display: inline-block !important; | ||
border-radius: 5px; | ||
background: $friend-link-background-color; | ||
[theme=dark] & { | ||
background: $friend-link-background-color-dark; | ||
} | ||
[theme=black] & { | ||
background: $friend-link-background-color-black; | ||
} | ||
-webkit-transition: transform 0.4s ease; | ||
-moz-transition: transform 0.4s ease; | ||
-o-transition: transform 0.4s ease; | ||
transition: transform 0.4s ease; | ||
&:hover { | ||
transform: scale(1.01); | ||
} | ||
} | ||
|
||
.friend-link-avatar { | ||
width: 92px; | ||
float: left; | ||
} | ||
|
||
.friend-link-avatar { | ||
margin-right: 2px; | ||
} | ||
|
||
.friend-link-info { | ||
margin-top: 18px; | ||
margin-right: 18px; | ||
color: $friend-link-color; | ||
[theme=dark] & { | ||
color: $friend-link-color-dark; | ||
} | ||
[theme=black] & { | ||
color: $friend-link-color-black; | ||
} | ||
&:hover { | ||
color: $friend-link-hover-color; | ||
[theme=dark] & { | ||
color: $friend-link-hover-color-dark; | ||
} | ||
[theme=black] & { | ||
color: $friend-link-hover-color-black; | ||
} | ||
} | ||
} | ||
|
||
.friend-name { | ||
text-overflow: ellipsis; | ||
overflow: hidden; | ||
white-space: nowrap; | ||
font-style: normal; | ||
|
||
} | ||
|
||
.friend-bio { | ||
text-overflow: ellipsis; | ||
overflow: hidden; | ||
white-space: nowrap; | ||
color: $global-font-secondary-color; | ||
[theme=dark] & { | ||
color: $global-font-secondary-color-dark; | ||
} | ||
[theme=black] & { | ||
color: $global-font-secondary-color-black; | ||
} | ||
} | ||
|
||
@media screen and (max-width: 600px) { | ||
.friend-bio { | ||
display: none; | ||
} | ||
.friend-link-avatar { | ||
width: 84px; | ||
margin: auto; | ||
} | ||
.friend-link-info { | ||
height: 100%; | ||
margin: auto; | ||
display: flex; | ||
align-items: center; | ||
justify-content: center; | ||
} | ||
.friend-name { | ||
font-size: 14px; | ||
} | ||
} |
21 changes: 21 additions & 0 deletions
21
exampleSite/content/posts/tests/friend-link-tests/index.en.md
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,21 @@ | ||
--- | ||
title: "Friend link test" | ||
subtitle: "" | ||
date: 2021-04-29T13:41:31+01:00 | ||
lastmod: 2021-04-29T13:41:31+01:00 | ||
draft: true | ||
author: "" | ||
authorLink: "" | ||
description: "" | ||
categories: [Tests] | ||
hiddenFromHomePage: false | ||
hiddenFromSearch: false | ||
--- | ||
|
||
<!--more--> | ||
|
||
{{< friend name="PCloud" url="https://github.com/HEIGE-PCloud/" avatar="https://avatars.githubusercontent.com/u/52968553?v=4" bio="This is PCloud~💤" >}} | ||
|
||
{{< friend name="PCloud" url="https://github.com/HEIGE-PCloud/" avatar="https://avatars.githubusercontent.com/u/52968553?v=4" bio="This is PCloud as well~" >}} | ||
|
||
{{< friend name="PCloud" url="https://github.com/HEIGE-PCloud/" avatar="https://avatars.githubusercontent.com/u/52968553?v=4" bio="Awwwwww, toooooooo many PCloud🤔" >}} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{{ if .IsNamedParams }} | ||
<a target="_blank" href={{ .Get "url" }} title={{ .Get "name" }} class="friend-link"> | ||
<div class="friend-link-div"> | ||
<div class="friend-link-avatar"> | ||
<img class="friend-avatar" src={{ .Get "avatar" }} /> | ||
</div> | ||
<div class="friend-link-info"> | ||
<i class="fas fa-user-circle fa-fw"></i> | ||
<i class="friend-name">{{ .Get "name" }}</i> | ||
<p class="friend-bio">{{ .Get "bio" }}</p> | ||
</div> | ||
</div> | ||
</a> | ||
{{ end }} |