Skip to content

Commit

Permalink
Merge pull request transitive-bullshit#315 from si1k/youtube-icon
Browse files Browse the repository at this point in the history
  • Loading branch information
transitive-bullshit authored Jun 2, 2022
2 parents 5e684eb + 09b2f22 commit 8bfdb19
Show file tree
Hide file tree
Showing 7 changed files with 40 additions and 2 deletions.
13 changes: 13 additions & 0 deletions components/Footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { FaTwitter } from '@react-icons/all-files/fa/FaTwitter'
import { FaZhihu } from '@react-icons/all-files/fa/FaZhihu'
import { FaGithub } from '@react-icons/all-files/fa/FaGithub'
import { FaLinkedin } from '@react-icons/all-files/fa/FaLinkedin'
import { FaYoutube } from '@react-icons/all-files/fa/FaYoutube'
import { IoSunnyOutline } from '@react-icons/all-files/io5/IoSunnyOutline'
import { IoMoonSharp } from '@react-icons/all-files/io5/IoMoonSharp'

Expand Down Expand Up @@ -95,6 +96,18 @@ export const FooterImpl: React.FC = () => {
<FaLinkedin />
</a>
)}

{config.youtube && (
<a
className={styles.youtube}
href={`https://www.youtube.com/${config.youtube}`}
title={`YouTube ${config.author}`}
target='_blank'
rel='noopener noreferrer'
>
<FaYoutube />
</a>
)}
</div>
</footer>
)
Expand Down
7 changes: 7 additions & 0 deletions components/PageSocial.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,13 @@
border-color: #c9510c;
}

.youtube .actionBgPane {
background: #FF0000;
}
.youtube:hover {
border-color: #FF0000;
}

.medium .actionBgPane {
background: #00ab6c;
}
Expand Down
11 changes: 11 additions & 0 deletions components/PageSocial.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,17 @@ const socialLinks: SocialLink[] = [
<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' />
</svg>
)
},

config.youtube && {
name: 'youtube',
href: `https://www.youtube.com/${config.youtube}`,
title: `YouTube ${config.youtube}`,
icon: (
<svg xmlns='http://www.w3.org/2000/svg' viewBox="0 0 24 24">
<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" />
</svg>
)
}
].filter(Boolean)

Expand Down
4 changes: 4 additions & 0 deletions components/styles.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,10 @@
color: #c9510c;
}

.youtube:hover {
color: #ff0000;
}

.linkedin:hover {
color: #0077b5;
}
Expand Down
5 changes: 3 additions & 2 deletions lib/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ export const language: string = getSiteConfig('language', 'en')
// social accounts
export const twitter: string | null = getSiteConfig('twitter', null)
export const github: string | null = getSiteConfig('github', null)
export const youtube: string | null = getSiteConfig('youtube', null)
export const linkedin: string | null = getSiteConfig('linkedin', null)
export const zhihu: string | null = getSiteConfig('zhihu', null)

Expand Down Expand Up @@ -145,8 +146,8 @@ export const site: Site = {
export const fathomId = isDev ? null : process.env.NEXT_PUBLIC_FATHOM_ID
export const fathomConfig = fathomId
? {
excludedDomains: ['localhost', 'localhost:3000']
}
excludedDomains: ['localhost', 'localhost:3000']
}
: undefined

export const posthogId = process.env.NEXT_PUBLIC_POSTHOG_ID
Expand Down
1 change: 1 addition & 0 deletions lib/site-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ export interface SiteConfig {
twitter?: string
github?: string
linkedin?: string
youtube?: string
zhihu?: string

defaultPageIcon?: string | null
Expand Down
1 change: 1 addition & 0 deletions site.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ export default siteConfig({
twitter: 'transitive_bs',
github: 'transitive-bullshit',
linkedin: 'fisch2',
// youtube: '#', //use custom channel name or `channel/UCGbXXXXXXXXXXXXXXXXXXXXXX`

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

0 comments on commit 8bfdb19

Please sign in to comment.