Blog
Creating your own headless CMS for free
Setup
Go to Supabase
Head over to Supabase and navigate to your project’s dashboard.
Create blogs table
Using the SQL Editor, create a table using the following SQL code:
Create RLS policy
Add a new RLS policy that enables read access to the public (all users).
Usage
The /blogs
route will display all the blogs you have created.
To create a blog you can insert a new row to the blogs table you have just created. You can use the blog structure below to define the blog and define a slug that will be used as the link on your site: /blogs/[slug]
Blog Structure Example
Live Blog ExampleWithin each content object, there is a “type” property that corresponds to a component found in src/components/blog
.
In src/routes/blogs/[slug]/+page.svelte
you will see how the blog gets dynamically rendered based on the “type” property.