devfolio-page 0.1.2 → 0.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cli/index.js CHANGED
@@ -9,7 +9,7 @@ const program = new Command();
9
9
  program
10
10
  .name('devfolio-page')
11
11
  .description('Your portfolio as code. Version control it like software.')
12
- .version('0.1.2');
12
+ .version('0.1.4');
13
13
  program
14
14
  .command('init')
15
15
  .description('Create a new portfolio.yaml with interactive prompts')
@@ -106,7 +106,7 @@ const richProjectSchema = z.object({
106
106
  title: z.string().min(1, 'Project title is required'),
107
107
  subtitle: z.string().optional(),
108
108
  featured: z.boolean().optional(),
109
- thumbnail: urlOrPath,
109
+ thumbnail: urlOrPath.optional(),
110
110
  hero: urlOrPath.optional(),
111
111
  meta: z.object({
112
112
  year: z.union([z.string(), z.number()]),
@@ -474,6 +474,10 @@ async function copyFonts(outputDir) {
474
474
  async function copyUserImages(portfolio, outputDir) {
475
475
  const imagePaths = extractAllImagePaths(portfolio);
476
476
  for (const imgPath of imagePaths) {
477
+ // Skip undefined or empty paths
478
+ if (!imgPath) {
479
+ continue;
480
+ }
477
481
  // Skip absolute URLs
478
482
  if (imgPath.startsWith('http://') || imgPath.startsWith('https://')) {
479
483
  continue;
@@ -503,7 +507,8 @@ function extractAllImagePaths(portfolio) {
503
507
  paths.push(meta.hero_image);
504
508
  // Extract from rich projects
505
509
  portfolio.projects?.forEach((project) => {
506
- paths.push(project.thumbnail);
510
+ if (project.thumbnail)
511
+ paths.push(project.thumbnail);
507
512
  if (project.hero)
508
513
  paths.push(project.hero);
509
514
  project.sections.forEach((section) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "devfolio-page",
3
- "version": "0.1.2",
3
+ "version": "0.1.4",
4
4
  "description": "Your portfolio as code. Version control it like software.",
5
5
  "type": "module",
6
6
  "bin": {