diff --git a/src/components/AIPrompt.astro b/src/components/AIPrompt.astro index 1466391c..b2e8a535 100644 --- a/src/components/AIPrompt.astro +++ b/src/components/AIPrompt.astro @@ -6,11 +6,12 @@ interface Props { url: string; // anything that precedes the prompt: e.g. "https://ai.example.com/?prompt=" title: string; icon: string; + prompt?: string; // optional custom prompt, defaults to AI_SUMMARY_PROMPT } -const { url, title, icon } = Astro.props; +const { url, title, icon, prompt = AI_SUMMARY_PROMPT } = Astro.props; -const fullUrl = url + encodeURIComponent(AI_SUMMARY_PROMPT); +const fullUrl = url + encodeURIComponent(prompt); --- @@ -43,21 +48,57 @@ metadata.tags?.sort(); }} >
-

- {metadata.title} -

+
+
+

+ {metadata.title} +

+ { + metadata.image ? ( + {`${metadata.title} + ) : ( +
+ ) + } +
+
+

Ask AI about this project

+
+ + +
+ + + Copied to clipboard + +
+
+
+
- { - metadata.image ? ( - {`${metadata.title} - ) : ( -
- ) - }

{metadata.date} @@ -126,4 +167,20 @@ metadata.tags?.sort(); }

+ + diff --git a/src/lib/constants.ts b/src/lib/constants.ts index b02c1722..2294a963 100644 --- a/src/lib/constants.ts +++ b/src/lib/constants.ts @@ -1,2 +1,10 @@ export const AI_SUMMARY_PROMPT = "I am a recruiter, tell me about Oliver Bryan, a software developer. What would he bring to the table? Review his portfolio at ob248.com and summarize his key strengths, technical skills, and notable projects. What makes him stand out as a candidate?"; + +export function getProjectPrompt( + projectName: string, + projectDescription: string, + projectSlug: string, +): string { + return `Tell me about "${projectName}", a project by Oliver Bryan. ${projectDescription} Review the project page at ob248.com/projects/${projectSlug} and explain the technical decisions, technologies used, and what this project demonstrates about Oliver's skills as a developer. Provide any url or repository that would be helpful.`; +}