Skip to content

feature: content collections#258

Draft
jurgenbelien wants to merge 4 commits intomainfrom
feat/content-collections
Draft

feature: content collections#258
jurgenbelien wants to merge 4 commits intomainfrom
feat/content-collections

Conversation

@jurgenbelien
Copy link
Contributor

Changes

Associated issue

How to test

Checklist

  • I have performed a self-review of my own code
  • I have made sure that my PR is easy to review (not too big, includes comments)
  • I have made updated relevant documentation files (in project README, docs/, etc)
  • I have added a decision log entry if the change affects the architecture or changes a significant technology
  • I have notified a reviewer

@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Mar 13, 2025

Deploying head-start with  Cloudflare Pages  Cloudflare Pages

Latest commit: 63a800d
Status: ✅  Deploy successful!
Preview URL: https://86fbdcdc.head-start.pages.dev
Branch Preview URL: https://feat-content-collections.head-start.pages.dev

View logs

@jurgenbelien jurgenbelien force-pushed the feat/content-collections branch 7 times, most recently from 15303e2 to 5c6c47a Compare March 20, 2025 08:23
@jurgenbelien
Copy link
Contributor Author

jurgenbelien commented Apr 1, 2025

  • Consider paths as identifiers for entries in collections, instead of pure slugs or ids, for those items that have routes, ie. /en/files/...
  • Collection block:
    • Specify type of collection
    • Specify sorting
    • Specify limit
    • Layout (?)
type CollectionItem = {
  recordId,
  id, // path,
  type,
  locale,
  publishedAt,
}

@jurgenbelien jurgenbelien force-pushed the feat/content-collections branch from 5c6c47a to 63a800d Compare April 19, 2025 10:11
@jbmoelker jbmoelker changed the title feat: content collections feature: content collections Apr 22, 2025

return (useLoaderDirectly)
? collectionMap[collection].loader()
.then(entries => normalizeEntries(entries, collection))
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
.then(entries => normalizeEntries(entries, collection))
.then(entries => normalizeEntries<typeof entries[number]>(entries, collection))

Without it, entries might become a union of collection entries.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant