Skip to content

Commit e4efe74

Browse files
Merge pull request #317 from si1k/newsletter-icon
2 parents 8bfdb19 + d265d02 commit e4efe74

File tree

7 files changed

+38
-1
lines changed

7 files changed

+38
-1
lines changed

components/Footer.tsx

Lines changed: 12 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 { FaEnvelopeOpenText } from '@react-icons/all-files/fa/FaEnvelopeOpenText'
67
import { FaYoutube } from '@react-icons/all-files/fa/FaYoutube'
78
import { IoSunnyOutline } from '@react-icons/all-files/io5/IoSunnyOutline'
89
import { IoMoonSharp } from '@react-icons/all-files/io5/IoMoonSharp'
@@ -97,6 +98,17 @@ export const FooterImpl: React.FC = () => {
9798
</a>
9899
)}
99100

101+
{config.newsletter && (
102+
<a
103+
className={styles.newsletter}
104+
href={`${config.newsletter}`}
105+
title={`Newsletter ${config.author}`}
106+
target='_blank'
107+
rel='noopener noreferrer'
108+
>
109+
<FaEnvelopeOpenText />
110+
)}
111+
100112
{config.youtube && (
101113
<a
102114
className={styles.youtube}

components/PageSocial.module.css

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,13 @@
114114
border-color: #00ab6c;
115115
}
116116

117+
.newsletter .actionBgPane {
118+
background: #777777;
119+
}
120+
.newsletter:hover {
121+
border-color: #777777;
122+
}
123+
117124
.email .actionBgPane {
118125
background: #777;
119126
}

components/PageSocial.tsx

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,17 @@ const socialLinks: SocialLink[] = [
4646
)
4747
},
4848

49+
config.newsletter && {
50+
name: 'newsletter',
51+
href: `${config.newsletter}`,
52+
title: `Newsletter ${config.author}`,
53+
icon: (
54+
<svg xmlns='http://www.w3.org/2000/svg' viewBox="0 0 24 24">
55+
<path d="M12 .64L8.23 3H5V5L2.97 6.29C2.39 6.64 2 7.27 2 8V18C2 19.11 2.9 20 4 20H20C21.11 20 22 19.11 22 18V8C22 7.27 21.61 6.64 21.03 6.29L19 5V3H15.77M7 5H17V9.88L12 13L7 9.88M8 6V7.5H16V6M5 7.38V8.63L4 8M19 7.38L20 8L19 8.63M8 8.5V10H16V8.5Z" />
56+
</svg>
57+
)
58+
},
59+
4960
config.youtube && {
5061
name: 'youtube',
5162
href: `https://www.youtube.com/${config.youtube}`,

components/styles.module.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,10 @@
109109
color: #0077b5;
110110
}
111111

112+
.newsletter:hover {
113+
color: #777777;
114+
}
115+
112116
.comments {
113117
width: 100%;
114118
margin-top: 2em;

lib/config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ export const twitter: string | null = getSiteConfig('twitter', null)
5858
export const github: string | null = getSiteConfig('github', null)
5959
export const youtube: string | null = getSiteConfig('youtube', null)
6060
export const linkedin: string | null = getSiteConfig('linkedin', null)
61+
export const newsletter: string | null = getSiteConfig('newsletter', null)
6162
export const zhihu: string | null = getSiteConfig('zhihu', null)
6263

6364
// default notion values for site-wide consistency (optional; may be overridden on a per-page basis)

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+
newsletter?: string
1617
youtube?: string
1718
zhihu?: string
1819

site.config.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ export default siteConfig({
2020
twitter: 'transitive_bs',
2121
github: 'transitive-bullshit',
2222
linkedin: 'fisch2',
23-
// youtube: '#', //use custom channel name or `channel/UCGbXXXXXXXXXXXXXXXXXXXXXX`
23+
// newsletter: '#', // optional newsletter URL
24+
// youtube: '#', // optional youtube channel name or `channel/UCGbXXXXXXXXXXXXXXXXXXXXXX`
2425

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

0 commit comments

Comments
 (0)