Merge pull request #179 from joanjeremiah/downloadResume

Add conditional download resume feature
This commit is contained in:
Ariful Alam 2022-10-03 15:28:13 +06:00 committed by GitHub
commit 1dec29a718
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 25 additions and 3 deletions

View File

@ -205,6 +205,9 @@ const config = {
projects: [], // These projects will not be displayed. example: ['my-project1', 'my-project2']
},
},
resume: {
fileName: 'resume.pdf', // Place the resume file in public folder with the same name as the 'fileName' property.
},
social: {
linkedin: '',
twitter: '',

View File

@ -10,6 +10,9 @@ const config = {
projects: [], // These projects will not be displayed. example: ['my-project1', 'my-project2']
},
},
resume: {
fileName: 'resume.pdf', // Place the resume file in public folder with the same name as the 'fileName' property.
},
social: {
linkedin: 'ariful-alam',
twitter: 'arif_szn',

View File

@ -34,8 +34,8 @@
"build:library": "vite build --config library.config.js",
"lint": "eslint --ext .js,.jsx .",
"lint:fix": "eslint --ext .js,.jsx --fix .",
"prettier": "prettier --check './**/*.{js,jsx,ts,tsx,css,md,json}'",
"prettier:fix": "prettier --write './**/*.{js,jsx,ts,tsx,css,md,json}'"
"prettier": "prettier --check \"./**/*.{js,jsx,ts,tsx,css,md,json}\"",
"prettier:fix": "prettier --write \"./**/*.{js,jsx,ts,tsx,css,md,json}\""
},
"dependencies": {
"react": "^18.2.0",

BIN
public/resume.pdf Normal file

Binary file not shown.

View File

@ -160,6 +160,7 @@ const GitProfile = ({ config }) => {
profile={profile}
loading={loading}
avatarRing={!sanitizedConfig.themeConfig.hideAvatarRing}
resume={sanitizedConfig.resume}
/>
<Details
profile={profile}

View File

@ -2,7 +2,7 @@ import PropTypes from 'prop-types';
import { fallbackImage, skeleton } from '../../helpers/utils';
import LazyImage from '../lazy-image';
const AvatarCard = ({ profile, loading, avatarRing }) => {
const AvatarCard = ({ profile, loading, avatarRing, resume }) => {
return (
<div className="card shadow-lg compact bg-base-100">
<div className="grid place-items-center py-8">
@ -55,6 +55,17 @@ const AvatarCard = ({ profile, loading, avatarRing }) => {
: profile.bio}
</div>
</div>
{resume?.fileName && (
<a
href={resume.fileName}
target="_blank"
className="btn btn-outline btn-primary text-xs mt-6"
download
rel="noreferrer"
>
Download Resume
</a>
)}
</div>
</div>
);
@ -64,6 +75,7 @@ AvatarCard.propTypes = {
profile: PropTypes.object,
loading: PropTypes.bool.isRequired,
avatarRing: PropTypes.bool.isRequired,
resume: PropTypes.object,
};
export default AvatarCard;

View File

@ -144,6 +144,9 @@ export const sanitizeConfig = (config) => {
projects: config?.github?.exclude?.projects || [],
},
},
resume: {
fileName: config?.resume?.fileName || false,
},
social: {
linkedin: config?.social?.linkedin,
twitter: config?.social?.twitter,