From 48a34a28c794bd2c57228deb8ab0fe14759a1362 Mon Sep 17 00:00:00 2001 From: Oleg Proskurin Date: Sun, 18 Jan 2026 23:13:51 +0700 Subject: [PATCH] feat: ts index file --- .../src/app/(landings)/blog/blog-posts.json | 130 ----------------- .../src/app/(landings)/blog/blog-posts.ts | 137 ++++++++++++++++++ apps/landing/src/app/(landings)/blog/utils.ts | 6 +- 3 files changed, 140 insertions(+), 133 deletions(-) delete mode 100644 apps/landing/src/app/(landings)/blog/blog-posts.json create mode 100644 apps/landing/src/app/(landings)/blog/blog-posts.ts diff --git a/apps/landing/src/app/(landings)/blog/blog-posts.json b/apps/landing/src/app/(landings)/blog/blog-posts.json deleted file mode 100644 index 76f9482..0000000 --- a/apps/landing/src/app/(landings)/blog/blog-posts.json +++ /dev/null @@ -1,130 +0,0 @@ -{ - "posts": [ - { - "slug": "midjourney-alternatives", - "title": "Best Midjourney Alternatives in 2026", - "description": "19 AI image generators compared: UI platforms, API services, open-source options, and aggregators. Find the right tool for your needs.", - "heroImage": "/blog/midjourney-alternatives-hero.png", - "category": "guides", - "date": "2026-01-18", - "author": { - "name": "Banatie Team", - "avatar": "/blog/authors/default.jpg" - }, - "readTime": "25 min", - "relatedArticles": ["api-integration-tips", "placeholder-images-guide"], - "relatedDocs": [ - { "title": "API Reference", "href": "/docs/api/", "icon": "code" }, - { "title": "MCP Integration", "href": "/docs/guides/", "icon": "terminal" } - ] - }, - { - "slug": "placeholder-images-guide", - "title": "Getting Started with AI Placeholder Images", - "description": "Learn how to use Banatie to generate contextual placeholder images for your projects.", - "heroImage": "/blog/placeholder-guide-hero.jpg", - "category": "guides", - "date": "2025-01-15", - "author": { - "name": "Banatie Team", - "avatar": "/blog/authors/default.jpg" - }, - "readTime": "5 min", - "relatedArticles": ["api-integration-tips", "prompt-engineering-basics"], - "relatedDocs": [ - { "title": "API Reference", "href": "/docs/api/", "icon": "code" }, - { "title": "Quick Start", "href": "/docs/guides/", "icon": "book" } - ] - }, - { - "slug": "api-integration-tips", - "title": "API Integration Tips for Developers", - "description": "Best practices for integrating Banatie API into your applications and workflows.", - "heroImage": "/blog/api-tips-hero.jpg", - "category": "tutorials", - "date": "2025-01-12", - "author": { - "name": "Banatie Team", - "avatar": "/blog/authors/default.jpg" - }, - "readTime": "7 min", - "relatedArticles": ["placeholder-images-guide", "image-generation-best-practices"], - "relatedDocs": [ - { "title": "API Reference", "href": "/docs/api/", "icon": "code" }, - { "title": "Authentication", "href": "/docs/guides/", "icon": "book" } - ] - }, - { - "slug": "design-workflow-optimization", - "title": "Optimizing Your Design Workflow with AI Images", - "description": "How designers can speed up their prototyping process using AI-generated placeholders.", - "heroImage": "/blog/design-workflow-hero.jpg", - "category": "guides", - "date": "2025-01-10", - "author": { - "name": "Banatie Team", - "avatar": "/blog/authors/default.jpg" - }, - "readTime": "6 min", - "relatedArticles": ["use-cases-ecommerce", "placeholder-images-guide"], - "relatedDocs": [ - { "title": "Getting Started", "href": "/docs/guides/", "icon": "book" }, - { "title": "Image Parameters", "href": "/docs/api/", "icon": "code" } - ] - }, - { - "slug": "prompt-engineering-basics", - "title": "Prompt Engineering for Better Image Results", - "description": "Master the art of writing prompts that generate exactly the images you need.", - "heroImage": "/blog/prompt-engineering-hero.jpg", - "category": "tutorials", - "date": "2025-01-08", - "author": { - "name": "Banatie Team", - "avatar": "/blog/authors/default.jpg" - }, - "readTime": "8 min", - "relatedArticles": ["image-generation-best-practices", "placeholder-images-guide"], - "relatedDocs": [ - { "title": "Prompt Guide", "href": "/docs/guides/", "icon": "book" }, - { "title": "API Reference", "href": "/docs/api/", "icon": "code" } - ] - }, - { - "slug": "image-generation-best-practices", - "title": "Best Practices for AI Image Generation", - "description": "Learn the do's and don'ts of generating high-quality AI images for your projects.", - "heroImage": "/blog/best-practices-hero.jpg", - "category": "guides", - "date": "2025-01-05", - "author": { - "name": "Banatie Team", - "avatar": "/blog/authors/default.jpg" - }, - "readTime": "6 min", - "relatedArticles": ["prompt-engineering-basics", "api-integration-tips"], - "relatedDocs": [ - { "title": "Image Quality", "href": "/docs/guides/", "icon": "book" }, - { "title": "Parameters", "href": "/docs/api/", "icon": "code" } - ] - }, - { - "slug": "use-cases-ecommerce", - "title": "AI Placeholders for E-commerce Projects", - "description": "How online stores can use AI-generated images for product mockups and prototypes.", - "heroImage": "/blog/ecommerce-hero.jpg", - "category": "use-cases", - "date": "2025-01-02", - "author": { - "name": "Banatie Team", - "avatar": "/blog/authors/default.jpg" - }, - "readTime": "5 min", - "relatedArticles": ["design-workflow-optimization", "image-generation-best-practices"], - "relatedDocs": [ - { "title": "Quick Start", "href": "/docs/guides/", "icon": "book" }, - { "title": "Batch Generation", "href": "/docs/api/", "icon": "code" } - ] - } - ] -} diff --git a/apps/landing/src/app/(landings)/blog/blog-posts.ts b/apps/landing/src/app/(landings)/blog/blog-posts.ts new file mode 100644 index 0000000..a026d20 --- /dev/null +++ b/apps/landing/src/app/(landings)/blog/blog-posts.ts @@ -0,0 +1,137 @@ +import type { BlogPost } from './types'; + +export const blogPosts: BlogPost[] = [ + { + slug: 'midjourney-alternatives', + title: 'Best Midjourney Alternatives in 2026', + description: + '19 AI image generators compared: UI platforms, API services, open-source options, and aggregators. Find the right tool for your needs.', + heroImage: '/blog/midjourney-alternatives-hero.png', + category: 'guides', + date: '2026-01-18', + author: { + name: 'Banatie Team', + avatar: '/blog/authors/default.jpg', + }, + readTime: '25 min', + relatedArticles: ['api-integration-tips', 'placeholder-images-guide'], + relatedDocs: [ + { title: 'API Reference', href: '/docs/api/', icon: 'code' }, + { title: 'MCP Integration', href: '/docs/guides/', icon: 'terminal' }, + ], + }, + // { + // slug: 'placeholder-images-guide', + // title: 'Getting Started with AI Placeholder Images', + // description: + // 'Learn how to use Banatie to generate contextual placeholder images for your projects.', + // heroImage: '/blog/placeholder-guide-hero.jpg', + // category: 'guides', + // date: '2025-01-15', + // author: { + // name: 'Banatie Team', + // avatar: '/blog/authors/default.jpg', + // }, + // readTime: '5 min', + // relatedArticles: ['api-integration-tips', 'prompt-engineering-basics'], + // relatedDocs: [ + // { title: 'API Reference', href: '/docs/api/', icon: 'code' }, + // { title: 'Quick Start', href: '/docs/guides/', icon: 'book' }, + // ], + // }, + // { + // slug: 'api-integration-tips', + // title: 'API Integration Tips for Developers', + // description: + // 'Best practices for integrating Banatie API into your applications and workflows.', + // heroImage: '/blog/api-tips-hero.jpg', + // category: 'tutorials', + // date: '2025-01-12', + // author: { + // name: 'Banatie Team', + // avatar: '/blog/authors/default.jpg', + // }, + // readTime: '7 min', + // relatedArticles: ['placeholder-images-guide', 'image-generation-best-practices'], + // relatedDocs: [ + // { title: 'API Reference', href: '/docs/api/', icon: 'code' }, + // { title: 'Authentication', href: '/docs/guides/', icon: 'book' }, + // ], + // }, + // { + // slug: 'design-workflow-optimization', + // title: 'Optimizing Your Design Workflow with AI Images', + // description: + // 'How designers can speed up their prototyping process using AI-generated placeholders.', + // heroImage: '/blog/design-workflow-hero.jpg', + // category: 'guides', + // date: '2025-01-10', + // author: { + // name: 'Banatie Team', + // avatar: '/blog/authors/default.jpg', + // }, + // readTime: '6 min', + // relatedArticles: ['use-cases-ecommerce', 'placeholder-images-guide'], + // relatedDocs: [ + // { title: 'Getting Started', href: '/docs/guides/', icon: 'book' }, + // { title: 'Image Parameters', href: '/docs/api/', icon: 'code' }, + // ], + // }, + // { + // slug: 'prompt-engineering-basics', + // title: 'Prompt Engineering for Better Image Results', + // description: + // 'Master the art of writing prompts that generate exactly the images you need.', + // heroImage: '/blog/prompt-engineering-hero.jpg', + // category: 'tutorials', + // date: '2025-01-08', + // author: { + // name: 'Banatie Team', + // avatar: '/blog/authors/default.jpg', + // }, + // readTime: '8 min', + // relatedArticles: ['image-generation-best-practices', 'placeholder-images-guide'], + // relatedDocs: [ + // { title: 'Prompt Guide', href: '/docs/guides/', icon: 'book' }, + // { title: 'API Reference', href: '/docs/api/', icon: 'code' }, + // ], + // }, + // { + // slug: 'image-generation-best-practices', + // title: 'Best Practices for AI Image Generation', + // description: + // "Learn the do's and don'ts of generating high-quality AI images for your projects.", + // heroImage: '/blog/best-practices-hero.jpg', + // category: 'guides', + // date: '2025-01-05', + // author: { + // name: 'Banatie Team', + // avatar: '/blog/authors/default.jpg', + // }, + // readTime: '6 min', + // relatedArticles: ['prompt-engineering-basics', 'api-integration-tips'], + // relatedDocs: [ + // { title: 'Image Quality', href: '/docs/guides/', icon: 'book' }, + // { title: 'Parameters', href: '/docs/api/', icon: 'code' }, + // ], + // }, + // { + // slug: 'use-cases-ecommerce', + // title: 'AI Placeholders for E-commerce Projects', + // description: + // 'How online stores can use AI-generated images for product mockups and prototypes.', + // heroImage: '/blog/ecommerce-hero.jpg', + // category: 'use-cases', + // date: '2025-01-02', + // author: { + // name: 'Banatie Team', + // avatar: '/blog/authors/default.jpg', + // }, + // readTime: '5 min', + // relatedArticles: ['design-workflow-optimization', 'image-generation-best-practices'], + // relatedDocs: [ + // { title: 'Quick Start', href: '/docs/guides/', icon: 'book' }, + // { title: 'Batch Generation', href: '/docs/api/', icon: 'code' }, + // ], + // }, +]; diff --git a/apps/landing/src/app/(landings)/blog/utils.ts b/apps/landing/src/app/(landings)/blog/utils.ts index f7e5d3e..03fbd2b 100644 --- a/apps/landing/src/app/(landings)/blog/utils.ts +++ b/apps/landing/src/app/(landings)/blog/utils.ts @@ -1,11 +1,11 @@ import type { Metadata } from 'next'; import type { BlogPost } from './types'; -import postsData from './blog-posts.json'; +import { blogPosts } from './blog-posts'; -export const getAllPosts = (): BlogPost[] => postsData.posts as BlogPost[]; +export const getAllPosts = (): BlogPost[] => blogPosts; export const getPostBySlug = (slug: string): BlogPost | undefined => - (postsData.posts as BlogPost[]).find((p) => p.slug === slug); + blogPosts.find((p) => p.slug === slug); export const getPostsBySlugs = (slugs: string[]): BlogPost[] => slugs