Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Contentlayer is a must & multiple content sources #53

Closed
alvesvin opened this issue Nov 21, 2021 · 1 comment
Closed

Contentlayer is a must & multiple content sources #53

alvesvin opened this issue Nov 21, 2021 · 1 comment
Labels
duplicate This issue or pull request already exists meta: archived

Comments

@alvesvin
Copy link

alvesvin commented Nov 21, 2021

Hey 👋

I came across Contentlayer by a Lee Robinson's live about his blog and I instantly fell in love. I'm really excited about this project and I think this is going to be the next standard way of consuming content from multiple sources. I'm really excited to contribute because I feel Contentful is a must for the web dev community, but I'm not used to contributing at all. I'll dedicate my next days studying this repository to really understand it, but if a great soul could provide a overall architechture/understanding of all the packages and how they fit together, that'd be awesome.

Update: I just watched the Effect Time: Intro to Contentlayer and it's a great introduction. It's more complex than I expected 🥲

What I expect about Contentlayer is that it's going to be the single source of any kind of content a project needs. Instead of using multiple libraries to interact with third party services, Contentlayer would be the only one library needed. Is it correct?

One thing I noticed by quickly looking at the examples is that contentlayer.config.ts only exports one source of content. I don't know if such a case exists were a project consumes content from multiple CMS, for example, at the same time. If such a project exists, would it be possible to export multiple content sources like:

import { makeSourcePlugin } from '@contentlayer/source-contentful'
import { makeSource } from '@contentlayer/source-files'

export const mdx = makeSource({});
export const contentful = makeSourcePlugin({});

And using it like:

import { mdx, contentful } from "./contentlayer/data";

mdx.allPost();
contentful.allPost();

// Proposed syntax
//
// mdx.posts.list()
// contentful.posts.list()

I really like the generated Prisma client, and I think the proposed syntax is very elegant.

@schickling
Copy link
Collaborator

Thanks a lot for your kind message. There's now a new issue that tracks your requested feature: #84

@schickling schickling added meta: archived duplicate This issue or pull request already exists labels Jan 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists meta: archived
Projects
None yet
Development

No branches or pull requests

2 participants