This commit is contained in:
@@ -29,6 +29,8 @@ function getMdiIcon(iconName: string): string {
|
|||||||
const iconMap: { [key: string]: string } = {
|
const iconMap: { [key: string]: string } = {
|
||||||
"mdi:email":
|
"mdi:email":
|
||||||
'<svg style="width: 12px; height: 12px; display: inline-block; vertical-align: middle; fill: currentColor;" viewBox="0 0 24 24"><path d="M20,8L12,13L4,8V6L12,11L20,6M20,4H4C2.89,4 2,4.89 2,6V18A2,2 0 0,0 4,20H20A2,2 0 0,0 22,18V6C2.89,4 20,4.89 20,4Z"/></svg>',
|
'<svg style="width: 12px; height: 12px; display: inline-block; vertical-align: middle; fill: currentColor;" viewBox="0 0 24 24"><path d="M20,8L12,13L4,8V6L12,11L20,6M20,4H4C2.89,4 2,4.89 2,6V18A2,2 0 0,0 4,20H20A2,2 0 0,0 22,18V6C2.89,4 20,4.89 20,4Z"/></svg>',
|
||||||
|
"mdi:phone":
|
||||||
|
'<svg style="width: 12px; height: 12px; display: inline-block; vertical-align: middle; fill: currentColor;" viewBox="0 0 24 24"><path d="M6.62,10.79C8.06,13.62 10.38,15.94 13.21,17.38L15.41,15.18C15.69,14.9 16.08,14.82 16.43,14.93C17.55,15.3 18.75,15.5 20,15.5A1,1 0 0,1 21,16.5V20A1,1 0 0,1 20,21A17,17 0 0,1 3,4A1,1 0 0,1 4,3H7.5A1,1 0 0,1 8.5,4C8.5,5.25 8.7,6.45 9.07,7.57C9.18,7.92 9.1,8.31 8.82,8.59L6.62,10.79Z"/></svg>',
|
||||||
"mdi:download":
|
"mdi:download":
|
||||||
'<svg style="width: 12px; height: 12px; display: inline-block; vertical-align: middle; fill: currentColor;" viewBox="0 0 24 24"><path d="M5,20H19V18H5M19,9H15V3H9V9H5L12,16L19,9Z"/></svg>',
|
'<svg style="width: 12px; height: 12px; display: inline-block; vertical-align: middle; fill: currentColor;" viewBox="0 0 24 24"><path d="M5,20H19V18H5M19,9H15V3H9V9H5L12,16L19,9Z"/></svg>',
|
||||||
"mdi:link":
|
"mdi:link":
|
||||||
@@ -41,6 +43,7 @@ interface ResumeData {
|
|||||||
basics: {
|
basics: {
|
||||||
name: string;
|
name: string;
|
||||||
email: string;
|
email: string;
|
||||||
|
phone?: string;
|
||||||
website?: string;
|
website?: string;
|
||||||
profiles: {
|
profiles: {
|
||||||
network: string;
|
network: string;
|
||||||
@@ -201,12 +204,14 @@ const createHead = (name: string) => `
|
|||||||
const createHeader = (
|
const createHeader = (
|
||||||
basics: any,
|
basics: any,
|
||||||
emailIcon: string,
|
emailIcon: string,
|
||||||
|
phoneIcon: string,
|
||||||
profileIcons: { [key: string]: string },
|
profileIcons: { [key: string]: string },
|
||||||
) => `
|
) => `
|
||||||
<header class="text-center mb-3 pb-2 border-b-2 border-gray-300">
|
<header class="text-center mb-3 pb-2 border-b-2 border-gray-300">
|
||||||
<h1 class="text-3xl font-bold text-gray-900 mb-1">${basics.name}</h1>
|
<h1 class="text-3xl font-bold text-gray-900 mb-1">${basics.name}</h1>
|
||||||
<div class="flex justify-center items-center flex-wrap gap-4 text-xs text-gray-600">
|
<div class="flex justify-center items-center flex-wrap gap-4 text-xs text-gray-600">
|
||||||
${basics.email ? `<div class="flex items-center gap-1">${emailIcon} ${basics.email}</div>` : ""}
|
${basics.email ? `<div class="flex items-center gap-1">${emailIcon} ${basics.email}</div>` : ""}
|
||||||
|
${basics.phone ? `<div class="flex items-center gap-1">${phoneIcon} ${basics.phone}</div>` : ""}
|
||||||
${
|
${
|
||||||
basics.profiles
|
basics.profiles
|
||||||
?.map((profile: any) => {
|
?.map((profile: any) => {
|
||||||
@@ -319,6 +324,7 @@ const generateResumeHTML = async (data: ResumeData): Promise<string> => {
|
|||||||
// Pre-fetch icons
|
// Pre-fetch icons
|
||||||
const profileIcons = await fetchProfileIcons(data.basics.profiles);
|
const profileIcons = await fetchProfileIcons(data.basics.profiles);
|
||||||
const emailIcon = getMdiIcon("mdi:email");
|
const emailIcon = getMdiIcon("mdi:email");
|
||||||
|
const phoneIcon = getMdiIcon("mdi:phone");
|
||||||
|
|
||||||
// Generate section content
|
// Generate section content
|
||||||
const sections = {
|
const sections = {
|
||||||
@@ -345,7 +351,7 @@ const generateResumeHTML = async (data: ResumeData): Promise<string> => {
|
|||||||
${createHead(data.basics.name)}
|
${createHead(data.basics.name)}
|
||||||
<body class="bg-white text-gray-900 text-xs leading-tight p-3">
|
<body class="bg-white text-gray-900 text-xs leading-tight p-3">
|
||||||
<div class="resume-container mx-auto">
|
<div class="resume-container mx-auto">
|
||||||
${createHeader(data.basics, emailIcon, profileIcons)}
|
${createHeader(data.basics, emailIcon, phoneIcon, profileIcons)}
|
||||||
${createSummarySection(data.summary, resumeConfig)}
|
${createSummarySection(data.summary, resumeConfig)}
|
||||||
<div class="grid grid-cols-2 gap-4">
|
<div class="grid grid-cols-2 gap-4">
|
||||||
<div class="space-y-4">
|
<div class="space-y-4">
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ export const GET: APIRoute = async () => {
|
|||||||
[basics]
|
[basics]
|
||||||
name = "Your Full Name"
|
name = "Your Full Name"
|
||||||
email = "your.email@example.com"
|
email = "your.email@example.com"
|
||||||
|
phone = "+1 (555) 123-4567" # Optional
|
||||||
website = "https://yourwebsite.com"
|
website = "https://yourwebsite.com"
|
||||||
|
|
||||||
# Add your social media profiles
|
# Add your social media profiles
|
||||||
|
|||||||
Reference in New Issue
Block a user