Remain eBay
If you want the script in your current document to remain specifically focused on an eBay-style marketplace, I'd replace the generic type detection with marketplace-specific content models.
const MARKETPLACE_SCHEMAS = {
categories: "category",
products: "product",
auctions: "auction",
bids: "bid",
offers: "offer",
watchlist: "watchlist",
orders: "order",
returns: "return",
disputes: "dispute",
refunds: "refund",
sellers: "seller",
buyers: "buyer",
messages: "message",
shipping: "shipping",
payments: "payment",
reviews: "review",
stores: "store",
inventory: "inventory",
notifications: "notification",
emails: "email",
legal: "legal",
admin: "admin"
};
Example generated frontmatter for a product:
---
id: iphone-15-pro
title: Apple iPhone 15 Pro
slug: /products/iphone-15-pro
type: product
status: active
visibility: public
listingType: fixed-price
inventoryTracking: true
permissions:
- guest
- buyer
seo:
title: Apple iPhone 15 Pro
description: Product listing
analytics:
track: true
version: 1.0.0
---
Auction listing:
---
id: vintage-watch-auction
title: Vintage Watch Auction
slug: /auctions/vintage-watch
type: auction
status: active
startingBid: true
reservePrice: false
bidIncrement: true
permissions:
- buyer
- seller
analytics:
track: true
version: 1.0.0
---
Seller center document:
---
id: seller-dashboard
title: Seller Dashboard
slug: /seller-center/dashboard
type: seller
status: published
visibility: authenticated
permissions:
- seller
analytics:
track: true
version: 1.0.0
---
For a full eBay-style repository, I'd keep the automation focused on these marketplace modules:
content/
├── categories/
├── products/
├── auctions/
├── bids/
├── offers/
├── watchlist/
├── cart/
├── checkout/
├── orders/
├── returns/
├── disputes/
├── refunds/
├── messaging/
├── seller-center/
├── buyer-center/
├── stores/
├── inventory/
├── shipping/
├── payments/
├── reviews/
├── notifications/
├── emails/
├── admin/
└── legal/
This keeps the generator purpose-built for an eBay-like marketplace instead of becoming a generic CMS frontmatter tool.
For an eBay-style marketplace, I'd expand the schema far beyond generic CMS content and model the actual marketplace entities.
Product Schema
---
id:
title:
slug:
type: product
status:
active
sellerId:
storeId:
listingType:
fixed-price
condition:
brand:
mpn:
upc:
price:
currency: AUD
quantity:
inventoryTracking: true
shippingProfile:
returnsProfile:
paymentProfile:
categories: []
tags: []
seo:
title:
description:
keywords: []
analytics:
impressions: true
clicks: true
conversions: true
version:
createdAt:
updatedAt:
---
Auction Schema
---
id:
title:
slug:
type: auction
status: active
sellerId:
startingPrice:
reservePrice:
buyItNowPrice:
bidIncrement:
auctionStart:
auctionEnd:
watchers:
bidCount:
shippingProfile:
returnsProfile:
analytics:
bids: true
watchers: true
conversions: true
version:
createdAt:
updatedAt:
---
Offer Schema
---
id:
type: offer
listingId:
buyerId:
sellerId:
offeredPrice:
counterOfferPrice:
status:
pending
expiresAt:
createdAt:
updatedAt:
---
Order Schema
---
id:
type: order
orderNumber:
buyerId:
sellerId:
paymentStatus:
fulfillmentStatus:
subtotal:
shipping:
tax:
discount:
total:
currency: AUD
trackingNumber:
shippingCarrier:
createdAt:
updatedAt:
---
Return Schema
---
id:
type: return
orderId:
productId:
buyerId:
sellerId:
reason:
resolution:
status:
requested
refundAmount:
createdAt:
updatedAt:
---
Seller Profile Schema
---
id:
type: seller
storeName:
sellerLevel:
feedbackScore:
positiveFeedback:
topRatedSeller:
location:
country:
businessAccount:
analytics:
sales
revenue
conversionRate
createdAt:
updatedAt:
---
Buyer Profile Schema
---
id:
type: buyer
watchlist:
savedSearches:
purchaseCount:
feedbackScore:
preferredCategories: []
createdAt:
updatedAt:
---
Messaging Schema
---
id:
type: message
conversationId:
senderId:
recipientId:
listingId:
status:
unread
attachments: []
createdAt:
updatedAt:
---
Feedback / Review Schema
---
id:
type: feedback
buyerId:
sellerId:
orderId:
rating:
comment:
positive:
negative:
neutral:
createdAt:
updatedAt:
---
Store Schema
---
id:
type: store
storeName:
storeSlug:
ownerId:
logo:
banner:
subscriptionTier:
featuredListings: []
seo:
title:
description:
createdAt:
updatedAt:
---
eBay-Style Repository Structure
content/
├── categories/
├── products/
├── auctions/
├── offers/
├── bids/
├── orders/
├── transactions/
├── returns/
├── refunds/
├── disputes/
├── feedback/
├── watchlists/
├── saved-searches/
├── buyer-center/
├── seller-center/
├── stores/
├── inventory/
├── shipping/
├── carriers/
├── payments/
├── tax/
├── coupons/
├── promotions/
├── notifications/
├── messages/
├── emails/
├── sms/
├── push/
├── trust-safety/
├── fraud/
├── moderation/
├── admin/
├── analytics/
└── legal/
For the document you're building, I'd make the frontmatter generator schema-aware so it automatically applies the correct marketplace schema based on the folder:
products/* → Product Schema
auctions/* → Auction Schema
offers/* → Offer Schema
orders/* → Order Schema
returns/* → Return Schema
feedback/* → Review Schema
stores/* → Store Schema
messages/* → Messaging Schema
seller-center/* → Seller Schema
buyer-center/* → Buyer Schema
That gives you a true marketplace content model rather than a generic markdown repository.