Skip to content

Commit 8bfdb19

Browse files
Merge pull request #315 from si1k/youtube-icon
2 parents 5e684eb + 09b2f22 commit 8bfdb19

File tree

7 files changed

+40
-2
lines changed

7 files changed

+40
-2
lines changed

components/Footer.tsx

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { FaTwitter } from '@react-icons/all-files/fa/FaTwitter'
33
import { FaZhihu } from '@react-icons/all-files/fa/FaZhihu'
44
import { FaGithub } from '@react-icons/all-files/fa/FaGithub'
55
import { FaLinkedin } from '@react-icons/all-files/fa/FaLinkedin'
6+
import { FaYoutube } from '@react-icons/all-files/fa/FaYoutube'
67
import { IoSunnyOutline } from '@react-icons/all-files/io5/IoSunnyOutline'
78
import { IoMoonSharp } from '@react-icons/all-files/io5/IoMoonSharp'
89

@@ -95,6 +96,18 @@ export const FooterImpl: React.FC = () => {
9596
<FaLinkedin />
9697
</a>
9798
)}
99+
100+
{config.youtube && (
101+
<a
102+
className={styles.youtube}
103+
href={`https://www.youtube.com/${config.youtube}`}
104+
title={`YouTube ${config.author}`}
105+
target='_blank'
106+
rel='noopener noreferrer'
107+
>
108+
<FaYoutube />
109+
</a>
110+
)}
98111
</div>
99112
</footer>
100113
)

components/PageSocial.module.css

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,13 @@
100100
border-color: #c9510c;
101101
}
102102

103+
.youtube .actionBgPane {
104+
background: #FF0000;
105+
}
106+
.youtube:hover {
107+
border-color: #FF0000;
108+
}
109+
103110
.medium .actionBgPane {
104111
background: #00ab6c;
105112
}

components/PageSocial.tsx

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,17 @@ const socialLinks: SocialLink[] = [
4444
<path d='M6.5 21.5h-5v-13h5v13zM4 6.5C2.5 6.5 1.5 5.3 1.5 4s1-2.4 2.5-2.4c1.6 0 2.5 1 2.6 2.5 0 1.4-1 2.5-2.6 2.5zm11.5 6c-1 0-2 1-2 2v7h-5v-13h5V10s1.6-1.5 4-1.5c3 0 5 2.2 5 6.3v6.7h-5v-7c0-1-1-2-2-2z' />
4545
</svg>
4646
)
47+
},
48+
49+
config.youtube && {
50+
name: 'youtube',
51+
href: `https://www.youtube.com/${config.youtube}`,
52+
title: `YouTube ${config.youtube}`,
53+
icon: (
54+
<svg xmlns='http://www.w3.org/2000/svg' viewBox="0 0 24 24">
55+
<path d="M10,15L15.19,12L10,9V15M21.56,7.17C21.69,7.64 21.78,8.27 21.84,9.07C21.91,9.87 21.94,10.56 21.94,11.16L22,12C22,14.19 21.84,15.8 21.56,16.83C21.31,17.73 20.73,18.31 19.83,18.56C19.36,18.69 18.5,18.78 17.18,18.84C15.88,18.91 14.69,18.94 13.59,18.94L12,19C7.81,19 5.2,18.84 4.17,18.56C3.27,18.31 2.69,17.73 2.44,16.83C2.31,16.36 2.22,15.73 2.16,14.93C2.09,14.13 2.06,13.44 2.06,12.84L2,12C2,9.81 2.16,8.2 2.44,7.17C2.69,6.27 3.27,5.69 4.17,5.44C4.64,5.31 5.5,5.22 6.82,5.16C8.12,5.09 9.31,5.06 10.41,5.06L12,5C16.19,5 18.8,5.16 19.83,5.44C20.73,5.69 21.31,6.27 21.56,7.17Z" />
56+
</svg>
57+
)
4758
}
4859
].filter(Boolean)
4960

components/styles.module.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,10 @@
101101
color: #c9510c;
102102
}
103103

104+
.youtube:hover {
105+
color: #ff0000;
106+
}
107+
104108
.linkedin:hover {
105109
color: #0077b5;
106110
}

lib/config.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ export const language: string = getSiteConfig('language', 'en')
5656
// social accounts
5757
export const twitter: string | null = getSiteConfig('twitter', null)
5858
export const github: string | null = getSiteConfig('github', null)
59+
export const youtube: string | null = getSiteConfig('youtube', null)
5960
export const linkedin: string | null = getSiteConfig('linkedin', null)
6061
export const zhihu: string | null = getSiteConfig('zhihu', null)
6162

@@ -145,8 +146,8 @@ export const site: Site = {
145146
export const fathomId = isDev ? null : process.env.NEXT_PUBLIC_FATHOM_ID
146147
export const fathomConfig = fathomId
147148
? {
148-
excludedDomains: ['localhost', 'localhost:3000']
149-
}
149+
excludedDomains: ['localhost', 'localhost:3000']
150+
}
150151
: undefined
151152

152153
export const posthogId = process.env.NEXT_PUBLIC_POSTHOG_ID

lib/site-config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ export interface SiteConfig {
1313
twitter?: string
1414
github?: string
1515
linkedin?: string
16+
youtube?: string
1617
zhihu?: string
1718

1819
defaultPageIcon?: string | null

site.config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ export default siteConfig({
2020
twitter: 'transitive_bs',
2121
github: 'transitive-bullshit',
2222
linkedin: 'fisch2',
23+
// youtube: '#', //use custom channel name or `channel/UCGbXXXXXXXXXXXXXXXXXXXXXX`
2324

2425
// default notion icon and cover images for site-wide consistency (optional)
2526
// page-specific values will override these site-wide defaults

0 commit comments

Comments
 (0)