Skip to content

Commit 85a8db0

Browse files
committed
get first name from author name
1 parent 909b698 commit 85a8db0

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

src/components/Footer.astro

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ import { getLatestCommitInfo } from '@/libs/git';
88
import { shortDate } from '@/utils/datetime';
99
import { limitString, trimHttpProtocol } from '@/utils/strings';
1010
11-
const { SITE_URL, AUTHOR_EMAIL, AUTHOR_GITHUB, AUTHOR_LINKEDIN, REPO_URL } = CONFIG_CLIENT;
11+
const { SITE_URL, AUTHOR_EMAIL, AUTHOR_GITHUB, AUTHOR_LINKEDIN, AUTHOR_NAME, REPO_URL } =
12+
CONFIG_CLIENT;
1213
const domain = trimHttpProtocol(SITE_URL);
1314
const messageLength = 15 as const;
1415
@@ -19,6 +20,8 @@ const commitUrl = `${REPO_URL}/commit/${fullHash}`;
1920
const shortDateStr = shortDate(new Date(time));
2021
const trimmedMessage = limitString(message, messageLength);
2122
23+
const firstName = AUTHOR_NAME.split(' ')[0];
24+
2225
// footer is full width for border, div has max-w
2326
---
2427

@@ -46,7 +49,7 @@ const trimmedMessage = limitString(message, messageLength);
4649
<li>
4750
<Link
4851
href={`mailto:${AUTHOR_EMAIL}`}
49-
title="Nemanja's email"
52+
title={`${firstName}'s email`}
5053
target="_blank"
5154
rel="me noreferrer noopener"
5255
class="flex items-center gap-2 text-base xs:text-lg"
@@ -61,7 +64,7 @@ const trimmedMessage = limitString(message, messageLength);
6164
href={AUTHOR_GITHUB}
6265
target="_blank"
6366
rel="me noreferrer noopener"
64-
title="@nemanjam on Github"
67+
title={`${firstName} on Github`}
6568
class="flex items-center gap-2 text-base xs:text-lg"
6669
variant="nav"
6770
>
@@ -74,7 +77,7 @@ const trimmedMessage = limitString(message, messageLength);
7477
href={AUTHOR_LINKEDIN}
7578
target="_blank"
7679
rel="me noreferrer noopener"
77-
title="Nemanja on LinkedIn"
80+
title={`${firstName} on LinkedIn`}
7881
class="flex items-center gap-2 text-base xs:text-lg"
7982
variant="nav"
8083
>

0 commit comments

Comments
 (0)