From 62dea50131b23a4e388a05de1ddc0a81a1ea44ca Mon Sep 17 00:00:00 2001 From: Ariful Alam Date: Fri, 1 Mar 2024 14:28:35 +0600 Subject: [PATCH 1/6] Hide sections if required fields are not present --- src/components/certification-card/index.tsx | 25 ++-- src/components/education-card/index.tsx | 21 +-- src/components/experience-card/index.tsx | 34 ++--- src/components/publication-card/index.tsx | 157 ++++++++++++++++++++ src/utils/index.tsx | 20 ++- 5 files changed, 204 insertions(+), 53 deletions(-) create mode 100644 src/components/publication-card/index.tsx diff --git a/src/components/certification-card/index.tsx b/src/components/certification-card/index.tsx index bda4ed90b..73d79fef8 100644 --- a/src/components/certification-card/index.tsx +++ b/src/components/certification-card/index.tsx @@ -78,22 +78,15 @@ const CertificationCard = ({ renderSkeleton() ) : ( <> - {certifications - .filter( - (certification) => - certification.year || - certification.name || - certification.body, - ) - .map((certification, index) => ( - - ))} + {certifications.map((certification, index) => ( + + ))} )} diff --git a/src/components/education-card/index.tsx b/src/components/education-card/index.tsx index f21568fe1..be52948e3 100644 --- a/src/components/education-card/index.tsx +++ b/src/components/education-card/index.tsx @@ -70,19 +70,14 @@ const EducationCard = ({ renderSkeleton() ) : ( <> - {educations - .filter( - (item) => - item.institution || item.degree || item.from || item.to, - ) - .map((item, index) => ( - - ))} + {educations.map((item, index) => ( + + ))} )} diff --git a/src/components/experience-card/index.tsx b/src/components/experience-card/index.tsx index ff7532269..cc58deabd 100644 --- a/src/components/experience-card/index.tsx +++ b/src/components/experience-card/index.tsx @@ -75,27 +75,19 @@ const ExperienceCard = ({ renderSkeleton() ) : ( - {experiences - .filter( - (experience) => - experience.company || - experience.position || - experience.from || - experience.to, - ) - .map((experience, index) => ( - - ))} + {experiences.map((experience, index) => ( + + ))} )} diff --git a/src/components/publication-card/index.tsx b/src/components/publication-card/index.tsx new file mode 100644 index 000000000..8ded02ba7 --- /dev/null +++ b/src/components/publication-card/index.tsx @@ -0,0 +1,157 @@ +import React, { Fragment } from 'react'; +import { SanitizedExperience } from '../../interfaces/sanitized-config'; +import { skeleton } from '../../utils'; + +const ListItem = ({ + time, + position, + company, + companyLink, +}: { + time: React.ReactNode; + position?: React.ReactNode; + company?: React.ReactNode; + companyLink?: string; +}) => ( +
  • +
    +
    {time}
    +

    {position}

    + +
  • +); + +const PublicationCard = ({ + experiences, + loading, +}: { + experiences: SanitizedExperience[]; + loading: boolean; +}) => { + const renderSkeleton = () => { + const array = []; + for (let index = 0; index < 2; index++) { + array.push( + , + ); + } + + return array; + }; + return ( +
    +
    +
    +
    +
    +
    +
    + + Publications + +
    +
    +
    +
    + +
    +
    +
    +
    +
    +

    + Publication Title +

    +

    + Conference / Journal Name +

    +

    + Authors: John Doe, Jane Smith +

    +

    + Lorem ipsum dolor sit amet, consectetur + adipiscing elit, sed do eiusmod tempor + incididunt ut labore et dolore magna aliqua. Ut + enim ad minim veniam, quis nostrud exercitation + ullamco laboris nisi ut aliquip ex ea commodo + consequat. Duis aute irure dolor in + reprehenderit in voluptate velit esse cillum + dolore eu fugiat nulla pariatur. Excepteur sint + occaecat cupidatat non proident, sunt in culpa + qui officia deserunt mollit anim id est laborum. +

    +
    +
    +
    +
    +
    +
    + +
    +
    +
    +
    +
    +

    + Publication Title +

    +

    + Conference / Journal Name +

    +

    + Authors: John Doe, Jane Smith +

    +

    + Lorem ipsum dolor sit amet, consectetur + adipiscing elit, sed do eiusmod tempor + incididunt ut labore et dolore magna aliqua. Ut + enim ad minim veniam, quis nostrud exercitation + ullamco laboris nisi ut aliquip ex ea commodo + consequat. Duis aute irure dolor in + reprehenderit in voluptate velit esse cillum + dolore eu fugiat nulla pariatur. Excepteur sint + occaecat cupidatat non proident, sunt in culpa + qui officia deserunt mollit anim id est laborum. +

    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    + ); +}; + +export default PublicationCard; diff --git a/src/utils/index.tsx b/src/utils/index.tsx index a1df9c334..3905c96b9 100644 --- a/src/utils/index.tsx +++ b/src/utils/index.tsx @@ -82,9 +82,23 @@ export const getSanitizedConfig = ( fileUrl: config?.resume?.fileUrl || '', }, skills: config?.skills || [], - experiences: config?.experiences || [], - certifications: config?.certifications || [], - educations: config?.educations || [], + experiences: + config?.experiences?.filter( + (experience) => + experience.company || + experience.position || + experience.from || + experience.to, + ) || [], + certifications: + config?.certifications?.filter( + (certification) => + certification.year || certification.name || certification.body, + ) || [], + educations: + config?.educations?.filter( + (item) => item.institution || item.degree || item.from || item.to, + ) || [], googleAnalytics: { id: config?.googleAnalytics?.id, }, From 233476584e226fc5bf55f7e8bc6b071d2217f4f4 Mon Sep 17 00:00:00 2001 From: Ariful Alam Date: Fri, 1 Mar 2024 16:18:20 +0600 Subject: [PATCH 2/6] Add section for publication --- README.md | 36 +++ gitprofile.config.ts | 20 ++ global.d.ts | 14 + src/components/blog-card/index.tsx | 2 +- src/components/certification-card/index.tsx | 2 +- .../external-project-card/index.tsx | 2 +- src/components/gitprofile.tsx | 7 + src/components/publication-card/index.tsx | 252 +++++++++--------- src/interfaces/sanitized-config.tsx | 10 + src/utils/index.tsx | 1 + 10 files changed, 212 insertions(+), 134 deletions(-) diff --git a/README.md b/README.md index a99413416..7c0a936bf 100644 --- a/README.md +++ b/README.md @@ -69,6 +69,7 @@ ✓ [Certification Section](#certifications) ✓ [Education Section](#education) ✓ [Projects Section](#projects) +✓ [Publication Section](#publications) ✓ [Blog Posts Section](#blog-posts) To view a live example, **[click here](https://arifszn.github.io/gitprofile)**. @@ -282,6 +283,17 @@ const CONFIG = { to: '2014', }, ], + publications: [ + { + title: 'Publication Title', + conferenceName: 'Conference Name', + journalName: 'Journal Name', + authors: 'John Doe, Jane Smith', + link: 'https://example.com', + description: + 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed euismod, nunc ut.', + }, + ], // Display articles from your medium or dev account. (Optional) blog: { source: 'dev', // medium | dev @@ -660,6 +672,30 @@ const CONFIG = { }; ``` +### Publications + +Provide your academic publishing in `publications`. + +```ts +// gitprofile.config.ts +const CONFIG = { + // ... + publications: [ + { + title: 'Publication Title', + conferenceName: 'Conference Name', + journalName: 'Journal Name', + authors: 'John Doe, Jane Smith', + link: 'https://example.com', + description: + 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed euismod, nunc ut.', + }, + ], +}; +``` + +Empty array will hide the publications section. + ### Blog Posts If you have [medium](https://medium.com) or [dev](https://dev.to) account, you can show your recent blog posts in here just by providing your medium/dev username. You can limit how many posts to display (Max is `10`). diff --git a/gitprofile.config.ts b/gitprofile.config.ts index bed1e2c17..f83cc8b29 100644 --- a/gitprofile.config.ts +++ b/gitprofile.config.ts @@ -132,6 +132,26 @@ const CONFIG = { to: '2014', }, ], + publications: [ + { + title: 'Publication Title', + conferenceName: '', + journalName: 'Journal Name', + authors: 'John Doe, Jane Smith', + link: 'https://example.com', + description: + 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.', + }, + { + title: 'Publication Title', + conferenceName: 'Conference Name', + journalName: '', + authors: 'John Doe, Jane Smith', + link: 'https://example.com', + description: + 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.', + }, + ], // Display articles from your medium or dev account. (Optional) blog: { source: 'dev', // medium | dev diff --git a/global.d.ts b/global.d.ts index 33179e1ff..8a3c48f8b 100644 --- a/global.d.ts +++ b/global.d.ts @@ -217,6 +217,15 @@ interface Education { to: string; } +interface Publication { + title: string; + conferenceName?: string; + journalName?: string; + authors?: string; + link?: string; + description?: string; +} + interface GoogleAnalytics { /** * GA3 tracking id/GA4 tag id UA-XXXXXXXXX-X | G-XXXXXXXXXX @@ -370,6 +379,11 @@ interface Config { */ educations?: Array; + /** + * Publication list + */ + publications?: Array; + /** * Resume */ diff --git a/src/components/blog-card/index.tsx b/src/components/blog-card/index.tsx index 2efc8e5d8..37d44e68c 100644 --- a/src/components/blog-card/index.tsx +++ b/src/components/blog-card/index.tsx @@ -132,7 +132,7 @@ const BlogCard = ({
    -

    +

    {article.title}

    diff --git a/src/components/certification-card/index.tsx b/src/components/certification-card/index.tsx index 73d79fef8..3394de159 100644 --- a/src/components/certification-card/index.tsx +++ b/src/components/certification-card/index.tsx @@ -19,7 +19,7 @@ const ListItem = ({ style={{ left: '-4.5px' }} >

    {year}
    -
    +
    {name} diff --git a/src/components/external-project-card/index.tsx b/src/components/external-project-card/index.tsx index 4139568bc..b5e1c17e8 100644 --- a/src/components/external-project-card/index.tsx +++ b/src/components/external-project-card/index.tsx @@ -93,7 +93,7 @@ const ExternalProjectCard = ({
    -

    +

    {item.title}

    {item.imageUrl && ( diff --git a/src/components/gitprofile.tsx b/src/components/gitprofile.tsx index 7d1ca0fa2..da3b10370 100644 --- a/src/components/gitprofile.tsx +++ b/src/components/gitprofile.tsx @@ -29,6 +29,7 @@ import GithubProjectCard from './github-project-card'; import ExternalProjectCard from './external-project-card'; import BlogCard from './blog-card'; import Footer from './footer'; +import PublicationCard from './publication-card'; /** * Renders the GitProfile component. @@ -255,6 +256,12 @@ const GitProfile = ({ config }: { config: Config }) => { googleAnalyticsId={sanitizedConfig.googleAnalytics.id} /> )} + {sanitizedConfig.publications.length !== 0 && ( + + )} {sanitizedConfig.projects.external.projects.length !== 0 && ( ( -
  • -
    -
    {time}
    -

    {position}

    - -
  • -); - const PublicationCard = ({ - experiences, + publications, loading, }: { - experiences: SanitizedExperience[]; + publications: SanitizedPublication[]; loading: boolean; }) => { const renderSkeleton = () => { const array = []; - for (let index = 0; index < 2; index++) { + for (let index = 0; index < publications.length; index++) { array.push( - , +
    +
    +
    +
    +
    +
    +

    + {skeleton({ + widthCls: 'w-32', + heightCls: 'h-8', + className: 'mb-2 mx-auto', + })} +

    +

    + {skeleton({ + widthCls: 'w-20', + heightCls: 'h-4', + className: 'mb-2 mx-auto', + })} +

    +

    + {skeleton({ + widthCls: 'w-20', + heightCls: 'h-4', + className: 'mb-2 mx-auto', + })} +

    +

    + {skeleton({ + widthCls: 'w-full', + heightCls: 'h-4', + className: 'mb-2 mx-auto', + })} +

    +

    + {skeleton({ + widthCls: 'w-full', + heightCls: 'h-4', + className: 'mb-2 mx-auto', + })} +

    +
    +
    +
    +
    +
    +
    , ); } return array; }; - return ( -
    -
    -
    -
    -
    -
    -
    - - Publications - -
    + + const renderPublications = () => { + return publications.map((item, index) => ( + +
    +
    +
    +
    +
    +

    + {item.title} +

    + {item.conferenceName && ( +

    + {item.conferenceName} +

    + )} + {item.journalName && ( +

    + {item.journalName} +

    + )} + {item.authors && ( +

    + Author: {item.authors} +

    + )} + {item.description && ( +

    + {item.description} +

    + )} +
    -
    -
    - -
    -
    -
    -
    -
    -

    - Publication Title -

    -

    - Conference / Journal Name -

    -

    - Authors: John Doe, Jane Smith -

    -

    - Lorem ipsum dolor sit amet, consectetur - adipiscing elit, sed do eiusmod tempor - incididunt ut labore et dolore magna aliqua. Ut - enim ad minim veniam, quis nostrud exercitation - ullamco laboris nisi ut aliquip ex ea commodo - consequat. Duis aute irure dolor in - reprehenderit in voluptate velit esse cillum - dolore eu fugiat nulla pariatur. Excepteur sint - occaecat cupidatat non proident, sunt in culpa - qui officia deserunt mollit anim id est laborum. -

    -
    -
    -
    -
    -
    -
    - -
    -
    -
    -
    -
    -

    - Publication Title -

    -

    - Conference / Journal Name -

    -

    - Authors: John Doe, Jane Smith -

    -

    - Lorem ipsum dolor sit amet, consectetur - adipiscing elit, sed do eiusmod tempor - incididunt ut labore et dolore magna aliqua. Ut - enim ad minim veniam, quis nostrud exercitation - ullamco laboris nisi ut aliquip ex ea commodo - consequat. Duis aute irure dolor in - reprehenderit in voluptate velit esse cillum - dolore eu fugiat nulla pariatur. Excepteur sint - occaecat cupidatat non proident, sunt in culpa - qui officia deserunt mollit anim id est laborum. -

    -
    -
    -
    -
    -
    -
    +
    +
    +
    + + )); + }; + + return ( + +
    +
    +
    +
    +
    +
    +
    + {loading ? ( + skeleton({ widthCls: 'w-40', heightCls: 'h-8' }) + ) : ( + + Publications + + )} +
    +
    +
    +
    + {loading ? renderSkeleton() : renderPublications()} +
    -
    + ); }; diff --git a/src/interfaces/sanitized-config.tsx b/src/interfaces/sanitized-config.tsx index d860b8587..37e0c39a0 100644 --- a/src/interfaces/sanitized-config.tsx +++ b/src/interfaces/sanitized-config.tsx @@ -87,6 +87,15 @@ export interface SanitizedEducation { to: string; } +export interface SanitizedPublication { + title: string; + conferenceName?: string; + journalName?: string; + authors?: string; + link?: string; + description?: string; +} + export interface SanitizedGoogleAnalytics { id?: string; } @@ -132,6 +141,7 @@ export interface SanitizedConfig { experiences: Array; educations: Array; certifications: Array; + publications: Array; googleAnalytics: SanitizedGoogleAnalytics; hotjar: SanitizedHotjar; blog: SanitizedBlog; diff --git a/src/utils/index.tsx b/src/utils/index.tsx index 3905c96b9..f222147f1 100644 --- a/src/utils/index.tsx +++ b/src/utils/index.tsx @@ -99,6 +99,7 @@ export const getSanitizedConfig = ( config?.educations?.filter( (item) => item.institution || item.degree || item.from || item.to, ) || [], + publications: config?.publications?.filter((item) => item.title) || [], googleAnalytics: { id: config?.googleAnalytics?.id, }, From cd5bf223de18231bca0a02ec7c747b60c778b519 Mon Sep 17 00:00:00 2001 From: Ariful Alam Date: Fri, 1 Mar 2024 16:31:36 +0600 Subject: [PATCH 3/6] Add ResearchGate social link --- README.md | 4 +++- gitprofile.config.ts | 1 + global.d.ts | 5 +++++ src/components/details-card/index.tsx | 11 +++++++++-- src/interfaces/sanitized-config.tsx | 1 + src/utils/index.tsx | 1 + 6 files changed, 20 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 7c0a936bf..6d2ae7cfe 100644 --- a/README.md +++ b/README.md @@ -211,6 +211,7 @@ const CONFIG = { linkedin: 'ariful-alam', twitter: 'arif_szn', mastodon: 'arifszn@mastodon.social', + researchGate: '', facebook: '', instagram: '', youtube: '', // example: 'pewdiepie' @@ -485,7 +486,7 @@ Your avatar and bio will be fetched from GitHub automatically. ### Social Links -You can link your social media services you're using, including LinkedIn, Twitter, Mastodon, Facebook, Instagram, YouTube, Dribbble, Behance, Medium, dev, Stack Overflow, Skype, Telegram, personal website, phone and email. +You can link your social media services you're using, including LinkedIn, Twitter, Mastodon, ResearchGate, Facebook, Instagram, YouTube, Dribbble, Behance, Medium, dev, Stack Overflow, Skype, Telegram, personal website, phone and email. ```ts // gitprofile.config.ts @@ -495,6 +496,7 @@ const CONFIG = { linkedin: 'ariful-alam', twitter: 'arif_szn', mastodon: 'arifszn@mastodon.social', + researchGate: '', facebook: '', instagram: '', youtube: '', diff --git a/gitprofile.config.ts b/gitprofile.config.ts index f83cc8b29..ddcf55942 100644 --- a/gitprofile.config.ts +++ b/gitprofile.config.ts @@ -60,6 +60,7 @@ const CONFIG = { linkedin: 'ariful-alam', twitter: 'arif_szn', mastodon: 'arifszn@mastodon.social', + researchGate: '', facebook: '', instagram: '', youtube: '', // example: 'pewdiepie' diff --git a/global.d.ts b/global.d.ts index 8a3c48f8b..bff0e6df4 100644 --- a/global.d.ts +++ b/global.d.ts @@ -122,6 +122,11 @@ interface Social { */ mastodon?: string; + /** + * ResearchGate username + */ + researchGate?: string; + /** * Facebook */ diff --git a/src/components/details-card/index.tsx b/src/components/details-card/index.tsx index 39c8c1f33..b8c2a9c80 100644 --- a/src/components/details-card/index.tsx +++ b/src/components/details-card/index.tsx @@ -4,7 +4,7 @@ import { AiFillInstagram, AiFillMediumSquare, } from 'react-icons/ai'; -import { SiTwitter } from 'react-icons/si'; +import { SiTwitter, SiResearchgate } from 'react-icons/si'; import { CgDribbble } from 'react-icons/cg'; import { RiPhoneFill, RiMailFill } from 'react-icons/ri'; import { Fragment } from 'react'; @@ -147,6 +147,14 @@ const DetailsCard = ({ profile, loading, social, github }: Props) => { value={github.username} link={`https://github.com/${github.username}`} /> + {social?.researchGate && ( + } + title="ResearchGate:" + value={social.researchGate} + link={`https://www.researchgate.net/profile/${social.researchGate}`} + /> + )} {social?.twitter && ( } @@ -265,7 +273,6 @@ const DetailsCard = ({ profile, loading, social, github }: Props) => { link={`https://t.me/${social.telegram}`} /> )} - {social?.phone && ( } diff --git a/src/interfaces/sanitized-config.tsx b/src/interfaces/sanitized-config.tsx index 37e0c39a0..4f207df1a 100644 --- a/src/interfaces/sanitized-config.tsx +++ b/src/interfaces/sanitized-config.tsx @@ -46,6 +46,7 @@ export interface SanitizedSocial { linkedin?: string; twitter?: string; mastodon?: string; + researchGate?: string; facebook?: string; instagram?: string; youtube?: string; diff --git a/src/utils/index.tsx b/src/utils/index.tsx index f222147f1..86ad24501 100644 --- a/src/utils/index.tsx +++ b/src/utils/index.tsx @@ -77,6 +77,7 @@ export const getSanitizedConfig = ( email: config?.social?.email, skype: config?.social?.skype, telegram: config?.social?.telegram, + researchGate: config?.social?.researchGate, }, resume: { fileUrl: config?.resume?.fileUrl || '', From ca4a3ce8f0e3eb92494fa6c9b67456444ad01066 Mon Sep 17 00:00:00 2001 From: Ariful Alam Date: Fri, 1 Mar 2024 16:34:10 +0600 Subject: [PATCH 4/6] Add 1 more skeleton for publication description --- src/components/publication-card/index.tsx | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/components/publication-card/index.tsx b/src/components/publication-card/index.tsx index f30784506..e8aa065a3 100644 --- a/src/components/publication-card/index.tsx +++ b/src/components/publication-card/index.tsx @@ -54,6 +54,13 @@ const PublicationCard = ({ className: 'mb-2 mx-auto', })}

    +

    + {skeleton({ + widthCls: 'w-full', + heightCls: 'h-4', + className: 'mb-2 mx-auto', + })} +

    From 15a94c1da4b21ee4d79d3eeca11fddc23d6eccbf Mon Sep 17 00:00:00 2001 From: Ariful Alam Date: Fri, 1 Mar 2024 16:34:22 +0600 Subject: [PATCH 5/6] Set blog post limit to 2 --- gitprofile.config.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gitprofile.config.ts b/gitprofile.config.ts index ddcf55942..fad74326f 100644 --- a/gitprofile.config.ts +++ b/gitprofile.config.ts @@ -157,7 +157,7 @@ const CONFIG = { blog: { source: 'dev', // medium | dev username: 'arifszn', // to hide blog section, keep it empty - limit: 3, // How many articles to display. Max is 10. + limit: 2, // How many articles to display. Max is 10. }, googleAnalytics: { id: '', // GA3 tracking id/GA4 tag id UA-XXXXXXXXX-X | G-XXXXXXXXXX From d60aea0f5e3bd8d6b0786f298ae833bd877eb303 Mon Sep 17 00:00:00 2001 From: Ariful Alam Date: Fri, 1 Mar 2024 16:40:19 +0600 Subject: [PATCH 6/6] Bump version to 3.1.0 --- package-lock.json | 4 ++-- package.json | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index bd13b909f..92de716f5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@arifszn/gitprofile", - "version": "3.0.0", + "version": "3.1.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@arifszn/gitprofile", - "version": "3.0.0", + "version": "3.1.0", "license": "MIT", "dependencies": { "react": "^18.2.0", diff --git a/package.json b/package.json index 587257c10..118a81d50 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@arifszn/gitprofile", "description": "Create an automatic portfolio based on GitHub profile", - "version": "3.0.0", + "version": "3.1.0", "type": "module", "license": "MIT", "author": "arifszn", @@ -81,6 +81,7 @@ "github-pages", "github-portfolio", "vite-portfolio", + "academic-portfolio", "github-api" ] }