avitorio / outstatic

Outstatic - A static CMS for Next.js
https://Outstatic.com
MIT License
2.67k stars 157 forks source link

Creating a new collection doesn't creates something on the website #128

Closed Prottoy2938 closed 1 year ago

Prottoy2938 commented 1 year ago

Provide environment information

Nextjs latest, Outstatic latest

What browser are you using? (if relevant)

No response

How are you deploying your application? (if relevant)

No response

Describe the Bug

I'm following the default get started guide on the documentation. Whenever I'm creating a new collection & adding blogs on that collection, nothing gets added to the site. The new collection & its content doesn't shows up. The website only shows Posts & Projects collecton & nothing else

Expected Behavior

Should show the collection

Link to reproduction - Issues with a link to complete (but minimal) reproduction code will be addressed faster

https://outstatic.com/docs/getting-started

To Reproduce

Follow the default getting started process as described in the documentation file

avitorio commented 1 year ago

Hey Alred,

In the blog example you'd need to specifically add the collections you added to the code.

Example in code: https://github.com/avitorio/outstatic/blob/279ce74649fd480ae531fd0dfcfb218b64d0d4cd/examples/blog/src/app/page.tsx#L47C1-L63C1

That's the basic idea, you can create the collections and then fetch them on the front end.

Prottoy2938 commented 1 year ago

Is it possible to do the whole process automatically?

avitorio commented 1 year ago

It is possible but requires some setup. You can make it so that new collections create new pages on the site, that would require you to use a dynamic route and fetch each collection so the front end knows what to display...