Skip to content

Commit 34ee791

Browse files
committed
Merge branch 'support-linkedin-company-page-link' into merge-social-icon-refactoring
* support-linkedin-company-page-link: Enable LinkedIn links to company pages too
2 parents 8216b20 + 5c85b61 commit 34ee791

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

components/PageSocial.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import styles from './PageSocial.module.css'
77
import { FaGithub, FaInstagram, FaLinkedin, FaMastodon, FaReddit, FaTwitter, FaYoutube } from 'react-icons/fa'
88
import { FaXTwitter, FaGitlab, FaEnvelopeOpenText } from 'react-icons/fa6'
99
import { IoIosBug } from 'react-icons/io'
10+
import { getLinkedInURLFromInput } from '@/lib/social-helpers'
1011

1112
interface SocialLink {
1213
name: string
@@ -65,7 +66,7 @@ export const socialLinks: SocialLink[] = [
6566

6667
config.linkedin && {
6768
name: 'linkedin',
68-
href: `https://www.linkedin.com/in/${config.linkedin}`,
69+
href: getLinkedInURLFromInput(config.linkedin),
6970
title: `LinkedIn ${config.author}`,
7071
color: "#ffffff",
7172
background: "#0077b5",

lib/social-helpers.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
export function getLinkedInURLFromInput(userOrCompany: string): string {
2+
if (userOrCompany.startsWith('company/')) {
3+
return `https://www.linkedin.com/${userOrCompany}`
4+
}
5+
6+
return `https://www.linkedin.com/in/${userOrCompany}`
7+
}

site.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ export default siteConfig({
2424
github: 'transitive-bullshit',
2525
// gitlab: 'transitive-bullshit', // optional gitlab account
2626

27-
linkedin: 'fisch2',
27+
linkedin: 'fisch2', // For company pages use: 'company/microsoft' syntax
2828
// mastodon: '#', // optional mastodon profile URL, provides link verification
2929
// newsletter: '#', // optional newsletter URL
3030
// youtube: '#', // optional youtube channel name or `channel/UCGbXXXXXXXXXXXXXXXXXXXXXX`

0 commit comments

Comments
 (0)