flowershow
flowershow copied to clipboard
Tutorial: Custom page types and layouts
This is the tutorial subject that won in our latest Discord poll.
Acceptance
- [x] tutorial copy written, that covers:
- [x] how to create custom Contentlayer document types (e.g.
Recipefor sb writing a cooking blog, orReviewfor sb writing book reviews etc.) - [x] how to create a layout and use it for the custom document type Currently getting errors when using a symlinked component
- [x] (bonus:) how to create a home page for listing all the pages of the custom type
- we can just use our
BlogsListcomponent (which btw should be renamed to sth more generic)
- we can just use our
- [x] how to create custom Contentlayer document types (e.g.
- [x] posted in our docs
- [x] link to it added in our docs index page
- [ ] posted in dev.to
- [x] posted on reddit here
- [x] announced on our Discord channel Done here
- [ ] short email about it sent out to subscribers
Notes
- We should probably export our Avatar component from core so users can use it in their own custom layouts
- Rename Bloglist to something more generic like
ListorIndexList
@khalilcodes @olayway I assume when a user wants to create a custom layout, they have to do that outside .flowershow and create a symlink in eg. .flowershow/layouts/custom , otherwise if they want to upgrade flowershow by reinstalling with npx flowershow@latest install , they will lose their custom components.
Creating a custom layout component in .flowershow/layouts seems to work as expected when used. But I am getting an error when trying to use a symlinked layout component like the error below:

So just using a non symlinked component for the tutorial for now
@PhilippeduPreez I think for now it's ok to add the custom layout to .flowershow/layouts. The user will have to mess around with .flowershow/contentlayer.config.ts file anyway. We'll worry about the upgradeability problem later on.
@PhilippeduPreez I've also created this issue about warning users about potentially losing custom stuff after re-running install command #444
@PhilippeduPreez let me know if you need any help with the copy! 😊