mirror of
https://github.com/NohamR/gitprofile.git
synced 2026-05-25 12:27:17 +00:00
Merge branch 'main' of https://github.com/csarnataro/gitprofile into add-skype-and-telegram-to-social-links
This commit is contained in:
33
README.md
33
README.md
@@ -213,13 +213,14 @@ const config = {
|
|||||||
social: {
|
social: {
|
||||||
linkedin: '',
|
linkedin: '',
|
||||||
twitter: '',
|
twitter: '',
|
||||||
|
mastodon: '',
|
||||||
facebook: '',
|
facebook: '',
|
||||||
instagram: '',
|
instagram: '',
|
||||||
dribbble: '',
|
dribbble: '',
|
||||||
behance: '',
|
behance: '',
|
||||||
medium: '',
|
medium: '',
|
||||||
dev: '',
|
dev: '',
|
||||||
stackoverflow: '',
|
stackoverflow: '', // format: userid/username
|
||||||
website: '',
|
website: '',
|
||||||
skype: '',
|
skype: '',
|
||||||
telegram: '',
|
telegram: '',
|
||||||
@@ -358,6 +359,9 @@ const config = {
|
|||||||
'--rounded-btn': '3rem',
|
'--rounded-btn': '3rem',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// Optional Footer. Supports plain text or HTML.
|
||||||
|
footer: `Copyright © 2023 John Doe`,
|
||||||
};
|
};
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -369,7 +373,7 @@ The default theme can be specified.
|
|||||||
|
|
||||||
```js
|
```js
|
||||||
// gitprofile.config.js
|
// gitprofile.config.js
|
||||||
module.exports = {
|
const config = {
|
||||||
// ...
|
// ...
|
||||||
themeConfig: {
|
themeConfig: {
|
||||||
defaultTheme: 'light',
|
defaultTheme: 'light',
|
||||||
@@ -386,7 +390,7 @@ You can create your own custom theme by modifying these values. Theme `procyon`
|
|||||||
|
|
||||||
```js
|
```js
|
||||||
// gitprofile.config.js
|
// gitprofile.config.js
|
||||||
module.exports = {
|
const config = {
|
||||||
// ...
|
// ...
|
||||||
themeConfig: {
|
themeConfig: {
|
||||||
customTheme: {
|
customTheme: {
|
||||||
@@ -409,7 +413,7 @@ module.exports = {
|
|||||||
|
|
||||||
```js
|
```js
|
||||||
// gitprofile.config.js
|
// gitprofile.config.js
|
||||||
module.exports = {
|
const config = {
|
||||||
// ...
|
// ...
|
||||||
googleAnalytics: {
|
googleAnalytics: {
|
||||||
id: '',
|
id: '',
|
||||||
@@ -425,7 +429,7 @@ Besides tracking visitors, it will track `click events` on projects and blog pos
|
|||||||
|
|
||||||
```js
|
```js
|
||||||
// gitprofile.config.js
|
// gitprofile.config.js
|
||||||
module.exports = {
|
const config = {
|
||||||
// ...
|
// ...
|
||||||
hotjar: {
|
hotjar: {
|
||||||
id: '',
|
id: '',
|
||||||
@@ -444,15 +448,16 @@ Your avatar and bio will be fetched from GitHub automatically.
|
|||||||
|
|
||||||
### Social Links
|
### Social Links
|
||||||
|
|
||||||
You can link your social media services you're using, including LinkedIn, Twitter, Facebook, Instagram, 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, Facebook, Instagram, Dribbble, Behance, Medium, dev, Stack Overflow, Skype, Telegram, personal website, phone and email.
|
||||||
|
|
||||||
```js
|
```js
|
||||||
// gitprofile.config.js
|
// gitprofile.config.js
|
||||||
module.exports = {
|
const config = {
|
||||||
// ...
|
// ...
|
||||||
social: {
|
social: {
|
||||||
linkedin: 'ariful-alam',
|
linkedin: 'ariful-alam',
|
||||||
twitter: 'arif_szn',
|
twitter: 'arif_szn',
|
||||||
|
mastodon: '',
|
||||||
facebook: '',
|
facebook: '',
|
||||||
instagram: '',
|
instagram: '',
|
||||||
dribbble: '',
|
dribbble: '',
|
||||||
@@ -475,7 +480,7 @@ To showcase your skills provide them here.
|
|||||||
|
|
||||||
```js
|
```js
|
||||||
// gitprofile.config.js
|
// gitprofile.config.js
|
||||||
module.exports = {
|
const config = {
|
||||||
// ...
|
// ...
|
||||||
skills: ['JavaScript', 'React.js'],
|
skills: ['JavaScript', 'React.js'],
|
||||||
};
|
};
|
||||||
@@ -489,7 +494,7 @@ Provide your job history in `experiences`.
|
|||||||
|
|
||||||
```js
|
```js
|
||||||
// gitprofile.config.js
|
// gitprofile.config.js
|
||||||
module.exports = {
|
const config = {
|
||||||
// ...
|
// ...
|
||||||
experiences: [
|
experiences: [
|
||||||
{
|
{
|
||||||
@@ -518,7 +523,7 @@ Provide your education history in `education`.
|
|||||||
|
|
||||||
```js
|
```js
|
||||||
// gitprofile.config.js
|
// gitprofile.config.js
|
||||||
module.exports = {
|
const config = {
|
||||||
// ...
|
// ...
|
||||||
education: [
|
education: [
|
||||||
{
|
{
|
||||||
@@ -545,7 +550,7 @@ Provide your industry certifications in `certifications`.
|
|||||||
|
|
||||||
```js
|
```js
|
||||||
// gitprofile.config.js
|
// gitprofile.config.js
|
||||||
module.exports = {
|
const config = {
|
||||||
// ...
|
// ...
|
||||||
certifications: [
|
certifications: [
|
||||||
{
|
{
|
||||||
@@ -568,7 +573,7 @@ Your public repo from GitHub will be displayed in the `Github Projects` section
|
|||||||
|
|
||||||
```js
|
```js
|
||||||
// gitprofile.config.js
|
// gitprofile.config.js
|
||||||
module.exports = {
|
const config = {
|
||||||
// ...
|
// ...
|
||||||
github: {
|
github: {
|
||||||
username: 'arifszn',
|
username: 'arifszn',
|
||||||
@@ -588,7 +593,7 @@ In this section you can showcase your external/personal projects.
|
|||||||
|
|
||||||
```js
|
```js
|
||||||
// gitprofile.config.js
|
// gitprofile.config.js
|
||||||
module.exports = {
|
const config = {
|
||||||
// ...
|
// ...
|
||||||
externalProjects: [
|
externalProjects: [
|
||||||
{
|
{
|
||||||
@@ -607,7 +612,7 @@ If you have [medium](https://medium.com) or [dev](https://dev.to) account, you c
|
|||||||
|
|
||||||
```js
|
```js
|
||||||
// gitprofile.config.js
|
// gitprofile.config.js
|
||||||
module.exports = {
|
const config = {
|
||||||
// ...
|
// ...
|
||||||
blog: {
|
blog: {
|
||||||
source: 'dev',
|
source: 'dev',
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ const config = {
|
|||||||
social: {
|
social: {
|
||||||
linkedin: 'ariful-alam',
|
linkedin: 'ariful-alam',
|
||||||
twitter: 'arif_szn',
|
twitter: 'arif_szn',
|
||||||
|
mastodon: '',
|
||||||
facebook: '',
|
facebook: '',
|
||||||
instagram: '',
|
instagram: '',
|
||||||
dribbble: '',
|
dribbble: '',
|
||||||
@@ -102,7 +103,6 @@ const config = {
|
|||||||
link: 'https://example.com',
|
link: 'https://example.com',
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
|
||||||
// Display blog posts from your medium or dev account. (Optional)
|
// Display blog posts from your medium or dev account. (Optional)
|
||||||
blog: {
|
blog: {
|
||||||
source: 'dev', // medium | dev
|
source: 'dev', // medium | dev
|
||||||
@@ -118,7 +118,7 @@ const config = {
|
|||||||
snippetVersion: 6,
|
snippetVersion: 6,
|
||||||
},
|
},
|
||||||
themeConfig: {
|
themeConfig: {
|
||||||
defaultTheme: 'business',
|
defaultTheme: 'winter',
|
||||||
|
|
||||||
// Hides the switch in the navbar
|
// Hides the switch in the navbar
|
||||||
// Useful if you want to support a single color mode
|
// Useful if you want to support a single color mode
|
||||||
@@ -176,6 +176,13 @@ const config = {
|
|||||||
'--rounded-btn': '3rem',
|
'--rounded-btn': '3rem',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// Optional Footer. Supports plain text or HTML.
|
||||||
|
footer: `Made with <a
|
||||||
|
class="text-primary" href="https://github.com/arifszn/gitprofile"
|
||||||
|
target="_blank"
|
||||||
|
rel="noreferrer"
|
||||||
|
>GitProfile</a> and ❤️`,
|
||||||
};
|
};
|
||||||
|
|
||||||
export default config;
|
export default config;
|
||||||
|
|||||||
562
package-lock.json
generated
562
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -11,6 +11,7 @@ import Certification from './certification';
|
|||||||
import Education from './education';
|
import Education from './education';
|
||||||
import Project from './project';
|
import Project from './project';
|
||||||
import Blog from './blog';
|
import Blog from './blog';
|
||||||
|
import Footer from './footer';
|
||||||
import {
|
import {
|
||||||
genericError,
|
genericError,
|
||||||
getInitialTheme,
|
getInitialTheme,
|
||||||
@@ -19,7 +20,6 @@ import {
|
|||||||
setupHotjar,
|
setupHotjar,
|
||||||
tooManyRequestError,
|
tooManyRequestError,
|
||||||
sanitizeConfig,
|
sanitizeConfig,
|
||||||
skeleton,
|
|
||||||
} from '../helpers/utils';
|
} from '../helpers/utils';
|
||||||
import { HelmetProvider } from 'react-helmet-async';
|
import { HelmetProvider } from 'react-helmet-async';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
@@ -221,24 +221,7 @@ const GitProfile = ({ config }) => {
|
|||||||
className={`p-4 footer ${bgColor} text-base-content footer-center`}
|
className={`p-4 footer ${bgColor} text-base-content footer-center`}
|
||||||
>
|
>
|
||||||
<div className="card compact bg-base-100 shadow">
|
<div className="card compact bg-base-100 shadow">
|
||||||
<a
|
<Footer content={sanitizedConfig.footer} loading={loading} />
|
||||||
className="card-body"
|
|
||||||
href="https://github.com/arifszn/gitprofile"
|
|
||||||
target="_blank"
|
|
||||||
rel="noreferrer"
|
|
||||||
>
|
|
||||||
<div>
|
|
||||||
{loading ? (
|
|
||||||
skeleton({ width: 'w-52', height: 'h-6' })
|
|
||||||
) : (
|
|
||||||
<p className="font-mono text-sm">
|
|
||||||
Made with{' '}
|
|
||||||
<span className="text-primary">GitProfile</span> and
|
|
||||||
❤️
|
|
||||||
</p>
|
|
||||||
)}
|
|
||||||
</div>
|
|
||||||
</a>
|
|
||||||
</div>
|
</div>
|
||||||
</footer>
|
</footer>
|
||||||
</Fragment>
|
</Fragment>
|
||||||
@@ -263,6 +246,7 @@ GitProfile.propTypes = {
|
|||||||
social: PropTypes.shape({
|
social: PropTypes.shape({
|
||||||
linkedin: PropTypes.string,
|
linkedin: PropTypes.string,
|
||||||
twitter: PropTypes.string,
|
twitter: PropTypes.string,
|
||||||
|
mastodon: PropTypes.string,
|
||||||
facebook: PropTypes.string,
|
facebook: PropTypes.string,
|
||||||
instagram: PropTypes.string,
|
instagram: PropTypes.string,
|
||||||
dribbble: PropTypes.string,
|
dribbble: PropTypes.string,
|
||||||
@@ -274,6 +258,9 @@ GitProfile.propTypes = {
|
|||||||
phone: PropTypes.string,
|
phone: PropTypes.string,
|
||||||
email: PropTypes.string,
|
email: PropTypes.string,
|
||||||
}),
|
}),
|
||||||
|
resume: PropTypes.shape({
|
||||||
|
fileUrl: PropTypes.string,
|
||||||
|
}),
|
||||||
skills: PropTypes.array,
|
skills: PropTypes.array,
|
||||||
externalProjects: PropTypes.arrayOf(
|
externalProjects: PropTypes.arrayOf(
|
||||||
PropTypes.shape({
|
PropTypes.shape({
|
||||||
@@ -335,6 +322,7 @@ GitProfile.propTypes = {
|
|||||||
'--rounded-btn': PropTypes.string,
|
'--rounded-btn': PropTypes.string,
|
||||||
}),
|
}),
|
||||||
}),
|
}),
|
||||||
|
footer: PropTypes.string,
|
||||||
}).isRequired,
|
}).isRequired,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -183,7 +183,7 @@ const Blog = ({ loading, blog, googleAnalytics }) => {
|
|||||||
<div
|
<div
|
||||||
className={`card compact bg-base-100 ${
|
className={`card compact bg-base-100 ${
|
||||||
loading || (articles && articles.length)
|
loading || (articles && articles.length)
|
||||||
? 'card compact shadow bg-opacity-40'
|
? 'shadow bg-opacity-40'
|
||||||
: 'shadow-lg'
|
: 'shadow-lg'
|
||||||
}`}
|
}`}
|
||||||
>
|
>
|
||||||
|
|||||||
@@ -16,12 +16,39 @@ import {
|
|||||||
FaFacebook,
|
FaFacebook,
|
||||||
FaGlobe,
|
FaGlobe,
|
||||||
FaSkype,
|
FaSkype,
|
||||||
|
FaMastodon,
|
||||||
FaStackOverflow,
|
FaStackOverflow,
|
||||||
FaTelegram,
|
FaTelegram,
|
||||||
} from 'react-icons/fa';
|
} from 'react-icons/fa';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import { skeleton } from '../../helpers/utils';
|
import { skeleton } from '../../helpers/utils';
|
||||||
|
|
||||||
|
const isCompanyMention = (company) => {
|
||||||
|
return company.startsWith('@') && !company.includes(' ');
|
||||||
|
};
|
||||||
|
|
||||||
|
const companyLink = (company) => {
|
||||||
|
return `https://github.com/${company.substring(1)}`;
|
||||||
|
};
|
||||||
|
|
||||||
|
const getMastodonValue = (mastodonURL) => {
|
||||||
|
const regex = /(https?:\/\/)?(www\.)?([^\s/]+)\/@(\w+)/;
|
||||||
|
|
||||||
|
const match = mastodonURL.match(regex);
|
||||||
|
|
||||||
|
if (match) {
|
||||||
|
const domain = match[3];
|
||||||
|
const username = match[4];
|
||||||
|
return `${domain}/@${username}`;
|
||||||
|
}
|
||||||
|
|
||||||
|
return mastodonURL;
|
||||||
|
};
|
||||||
|
|
||||||
|
const getMastodonLink = (mastodonURL) => {
|
||||||
|
return mastodonURL.replace(/^(https?:\/\/)?(www\.)?/, 'https://');
|
||||||
|
};
|
||||||
|
|
||||||
const ListItem = ({ icon, title, value, link, skeleton = false }) => {
|
const ListItem = ({ icon, title, value, link, skeleton = false }) => {
|
||||||
return (
|
return (
|
||||||
<a
|
<a
|
||||||
@@ -36,27 +63,16 @@ const ListItem = ({ icon, title, value, link, skeleton = false }) => {
|
|||||||
className={`${
|
className={`${
|
||||||
skeleton ? 'flex-grow' : ''
|
skeleton ? 'flex-grow' : ''
|
||||||
} text-sm font-normal text-right mr-2 ml-3 ${link ? 'truncate' : ''}`}
|
} text-sm font-normal text-right mr-2 ml-3 ${link ? 'truncate' : ''}`}
|
||||||
|
style={{
|
||||||
|
wordBreak: 'break-word',
|
||||||
|
}}
|
||||||
>
|
>
|
||||||
<div
|
{value}
|
||||||
style={{
|
|
||||||
wordBreak: 'break-word',
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
{value}
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</a>
|
</a>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
const isCompanyMention = (company) => {
|
|
||||||
return company.startsWith('@') && !company.includes(' ');
|
|
||||||
};
|
|
||||||
|
|
||||||
const companyLink = (company) => {
|
|
||||||
return `https://github.com/${company.substring(1)}`;
|
|
||||||
};
|
|
||||||
|
|
||||||
const Details = ({ profile, loading, social, github }) => {
|
const Details = ({ profile, loading, social, github }) => {
|
||||||
const renderSkeleton = () => {
|
const renderSkeleton = () => {
|
||||||
let array = [];
|
let array = [];
|
||||||
@@ -116,6 +132,14 @@ const Details = ({ profile, loading, social, github }) => {
|
|||||||
link={`https://twitter.com/${social.twitter}`}
|
link={`https://twitter.com/${social.twitter}`}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
|
{social?.mastodon && (
|
||||||
|
<ListItem
|
||||||
|
icon={<FaMastodon className="mr-2" />}
|
||||||
|
title="Mastodon:"
|
||||||
|
value={getMastodonValue(social.mastodon)}
|
||||||
|
link={getMastodonLink(social.mastodon)}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
{social?.linkedin && (
|
{social?.linkedin && (
|
||||||
<ListItem
|
<ListItem
|
||||||
icon={<GrLinkedinOption className="mr-2" />}
|
icon={<GrLinkedinOption className="mr-2" />}
|
||||||
|
|||||||
@@ -134,7 +134,7 @@ const ExternalProject = ({ externalProjects, loading, googleAnalytics }) => {
|
|||||||
<div className="col-span-1 lg:col-span-2">
|
<div className="col-span-1 lg:col-span-2">
|
||||||
<div className="grid grid-cols-2 gap-6">
|
<div className="grid grid-cols-2 gap-6">
|
||||||
<div className="col-span-2">
|
<div className="col-span-2">
|
||||||
<div className="card compact bg-gradient-to-br to-base-200 from-base-100 shadow">
|
<div className="card compact bg-base-100 shadow bg-opacity-40">
|
||||||
<div className="card-body">
|
<div className="card-body">
|
||||||
<div className="mx-3 flex items-center justify-between mb-2">
|
<div className="mx-3 flex items-center justify-between mb-2">
|
||||||
<h5 className="card-title">
|
<h5 className="card-title">
|
||||||
|
|||||||
24
src/components/footer/index.jsx
Normal file
24
src/components/footer/index.jsx
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
import PropTypes from 'prop-types';
|
||||||
|
|
||||||
|
import { skeleton } from '../../helpers/utils';
|
||||||
|
|
||||||
|
const Footer = ({ content, loading }) => {
|
||||||
|
if (!content) return null;
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div className="card-body">
|
||||||
|
{loading ? (
|
||||||
|
skeleton({ width: 'w-52', height: 'h-6' })
|
||||||
|
) : (
|
||||||
|
<div dangerouslySetInnerHTML={{ __html: content }} />
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
Footer.propTypes = {
|
||||||
|
content: PropTypes.string,
|
||||||
|
loading: PropTypes.bool.isRequired,
|
||||||
|
};
|
||||||
|
|
||||||
|
export default Footer;
|
||||||
@@ -96,7 +96,7 @@ const Project = ({ repo, loading, github, googleAnalytics }) => {
|
|||||||
{item.description}
|
{item.description}
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<div className="flex justify-between text-sm text-base-content text-opacity-60">
|
<div className="flex justify-between text-sm text-base-content text-opacity-60 truncate">
|
||||||
<div className="flex flex-grow">
|
<div className="flex flex-grow">
|
||||||
<span className="mr-3 flex items-center">
|
<span className="mr-3 flex items-center">
|
||||||
<AiOutlineStar className="mr-0.5" />
|
<AiOutlineStar className="mr-0.5" />
|
||||||
@@ -146,7 +146,7 @@ const Project = ({ repo, loading, github, googleAnalytics }) => {
|
|||||||
href={`https://github.com/${github.username}?tab=repositories`}
|
href={`https://github.com/${github.username}?tab=repositories`}
|
||||||
target="_blank"
|
target="_blank"
|
||||||
rel="noreferrer"
|
rel="noreferrer"
|
||||||
className="text-base-content opacity-50"
|
className="text-base-content opacity-50 hover:underline"
|
||||||
>
|
>
|
||||||
See All
|
See All
|
||||||
</a>
|
</a>
|
||||||
|
|||||||
@@ -147,6 +147,7 @@ export const sanitizeConfig = (config) => {
|
|||||||
social: {
|
social: {
|
||||||
linkedin: config?.social?.linkedin,
|
linkedin: config?.social?.linkedin,
|
||||||
twitter: config?.social?.twitter,
|
twitter: config?.social?.twitter,
|
||||||
|
mastodon: config?.social?.mastodon,
|
||||||
facebook: config?.social?.facebook,
|
facebook: config?.social?.facebook,
|
||||||
instagram: config?.social?.instagram,
|
instagram: config?.social?.instagram,
|
||||||
dribbble: config?.social?.dribbble,
|
dribbble: config?.social?.dribbble,
|
||||||
@@ -189,6 +190,7 @@ export const sanitizeConfig = (config) => {
|
|||||||
themes: themes,
|
themes: themes,
|
||||||
customTheme: customTheme,
|
customTheme: customTheme,
|
||||||
},
|
},
|
||||||
|
footer: config?.footer,
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -210,7 +212,7 @@ export const tooManyRequestError = (reset) => {
|
|||||||
target="_blank"
|
target="_blank"
|
||||||
rel="noopener noreferrer"
|
rel="noopener noreferrer"
|
||||||
>
|
>
|
||||||
rate limit.
|
rate limit
|
||||||
</a>
|
</a>
|
||||||
! Try again later{` ${reset}`}.
|
! Try again later{` ${reset}`}.
|
||||||
</p>
|
</p>
|
||||||
|
|||||||
10
types/index.d.ts
vendored
10
types/index.d.ts
vendored
@@ -49,6 +49,11 @@ export interface Social {
|
|||||||
*/
|
*/
|
||||||
twitter?: string;
|
twitter?: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Mastodon
|
||||||
|
*/
|
||||||
|
mastodon?: string;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Facebook
|
* Facebook
|
||||||
*/
|
*/
|
||||||
@@ -299,6 +304,11 @@ export interface Config {
|
|||||||
* Theme config
|
* Theme config
|
||||||
*/
|
*/
|
||||||
themeConfig?: ThemeConfig;
|
themeConfig?: ThemeConfig;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Custom footer
|
||||||
|
*/
|
||||||
|
footer?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface GitProfileProps {
|
export interface GitProfileProps {
|
||||||
|
|||||||
Reference in New Issue
Block a user