Skip to content

Commit e0e12a9

Browse files
committed
Adding newsletter icon
1 parent 5e684eb commit e0e12a9

File tree

7 files changed

+38
-0
lines changed

7 files changed

+38
-0
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 { FaEnvelopeOpenText } from '@react-icons/all-files/fa/FaEnvelopeOpenText'
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.newsletter && (
101+
<a
102+
className={styles.newsletter}
103+
href={`${config.newsletter}`}
104+
title={`Newsletter ${config.author}`}
105+
target='_blank'
106+
rel='noopener noreferrer'
107+
>
108+
<FaEnvelopeOpenText />
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
@@ -107,6 +107,13 @@
107107
border-color: #00ab6c;
108108
}
109109

110+
.newsletter .actionBgPane {
111+
background: #777777;
112+
}
113+
.newsletter:hover {
114+
border-color: #777777;
115+
}
116+
110117
.email .actionBgPane {
111118
background: #777;
112119
}

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.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+
)
4758
}
4859
].filter(Boolean)
4960

components/styles.module.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,10 @@
105105
color: #0077b5;
106106
}
107107

108+
.newsletter:hover {
109+
color: #777777;
110+
}
111+
108112
.comments {
109113
width: 100%;
110114
margin-top: 2em;

lib/config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ export const language: string = getSiteConfig('language', 'en')
5757
export const twitter: string | null = getSiteConfig('twitter', null)
5858
export const github: string | null = getSiteConfig('github', null)
5959
export const linkedin: string | null = getSiteConfig('linkedin', null)
60+
export const newsletter: string | null = getSiteConfig('newsletter', null)
6061
export const zhihu: string | null = getSiteConfig('zhihu', null)
6162

6263
// 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
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+
newsletter: '#', //Use full newsletter URL
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)