feat(blog): add support for LinkedIn profile links for post authors#2254
feat(blog): add support for LinkedIn profile links for post authors#2254vivekyadav-3 wants to merge 4 commits intojson-schema-org:mainfrom
Conversation
|
Hi @vivekyadav-3! Thanks a lot for your contribution! I noticed that the following required information is missing or incomplete: kind of change description Please update the PR description to include this information. You can find placeholders in the PR template for these items. Thanks a lot! |
There was a problem hiding this comment.
Pull request overview
This pull request aims to add LinkedIn profile link support for blog post authors in response to issue #1398. The implementation adds a "LinkedIn" link alongside existing Twitter links in the author bio section of blog posts. Additionally, the PR includes unrelated changes to migrate from img to Next.js Image component in the pro-help page.
Changes:
- Added LinkedIn link support in blog post author bio sections with conditional rendering
- Restructured author bio layout to accommodate multiple social links (Twitter and LinkedIn)
- Migrated
imgelements to Next.jsImagecomponent in the pro-help page (unrelated to LinkedIn feature)
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| pages/blog/posts/[slug].page.tsx | Adds LinkedIn link rendering for blog post authors with layout restructuring to display Twitter and LinkedIn links side-by-side |
| pages/overview/pro-help/index.page.tsx | Migrates from HTML img to Next.js Image component for contractor avatars (unrelated to LinkedIn feature) |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
pages/blog/posts/[slug].page.tsx
Outdated
| {author.linkedin && ( | ||
| <a | ||
| className='text-blue-700 hover:underline' | ||
| href={author.linkedin} | ||
| target="_blank" | ||
| rel="noopener noreferrer" | ||
| > | ||
There was a problem hiding this comment.
The implementation introduces a new linkedin field for authors, but the codebase already has a generic link field in the Author type (see pages/blog/index.page.tsx lines 16-21) that's used in blog posts like gsoc25-wrapup.md. This creates redundancy and inconsistency. Consider using the existing link field instead of adding a new linkedin-specific field. The link field is more flexible and can point to any professional profile (LinkedIn, personal website, etc.).
| {author.linkedin && ( | |
| <a | |
| className='text-blue-700 hover:underline' | |
| href={author.linkedin} | |
| target="_blank" | |
| rel="noopener noreferrer" | |
| > | |
| {author.link && ( | |
| <a | |
| className='text-blue-700 hover:underline' | |
| href={author.link} | |
| target="_blank" | |
| rel="noopener noreferrer" | |
| > | |
| Profile |
| @@ -214,8 +217,10 @@ export default function ProHelp({ contractorData }: ProHelpPageProps) { | |||
| {/* Image and Name */} | |||
| <div className='flex items-center space-x-8 pr-8'> | |||
| <div className='relative group'> | |||
| <img | |||
| <Image | |||
| src={`https://github.com/${contractor.github}.png`} | |||
| width={128} | |||
| height={128} | |||
| className='w-32 h-32 rounded-md border-4 border-blue-100 shadow-lg hover:border-blue-300 transition-all duration-300 dark:border-gray-600' | |||
| alt={`${contractor.name}'s avatar`} | |||
| /> | |||
There was a problem hiding this comment.
The changes to migrate from img to Image component in this file are unrelated to the LinkedIn profile feature described in the PR title and description. These changes should be in a separate PR focused on Next.js Image component migration. Including unrelated changes makes the PR harder to review and understand.
pages/blog/posts/[slug].page.tsx
Outdated
| <div className='text-sm font-semibold'> | ||
| {author.name} | ||
| </div> | ||
| <div className='flex gap-2 text-xs'> | ||
| {author.twitter && ( | ||
| <a | ||
| className='text-blue-500 hover:underline' | ||
| href={`https://x.com/${author.twitter}`} | ||
| target="_blank" | ||
| rel="noopener noreferrer" | ||
| > | ||
| </a> | ||
| )} | ||
| {author.linkedin && ( | ||
| <a | ||
| className='text-blue-700 hover:underline' | ||
| href={author.linkedin} | ||
| target="_blank" | ||
| rel="noopener noreferrer" | ||
| > | ||
| </a> | ||
| )} |
There was a problem hiding this comment.
The implementation differs from what was requested in issue #1398. The issue asks for "Clicking on an author's name in a blog post should redirect users to their LinkedIn profile," but this implementation adds a separate "LinkedIn" link instead of making the author's name clickable. While the current approach may be more flexible (supporting both Twitter and LinkedIn), the discrepancy should be clarified.
|
Hi @vivekyadav-3! Thanks a lot for your contribution! I noticed that the following required information is missing or incomplete: kind of change description Please update the PR description to include this information. You can find placeholders in the PR template for these items. Thanks a lot! |
built with Refined Cloudflare Pages Action⚡ Cloudflare Pages Deployment
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2254 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 30 30
Lines 640 663 +23
Branches 198 205 +7
=========================================
+ Hits 640 663 +23 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
@vivekyadav-3 , some checks are failed , please fix them |
What kind of change does this PR introduce?
Issue Number:
Closes #1398
Description:
This PR adds support for displaying LinkedIn profile links for blog post authors, similar to the existing Twitter link functionality.
Changes:
pages/blog/posts/[slug].page.tsxto check for alinkedinfield in the author's frontmatter.Screenshots/videos:
Tested locally by adding a
linkedinfield to a sample post in frontmatter; link renders correctly in author bio.If relevant, did you update the documentation?