admin-lib-cms 1.0.8 → 1.0.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +12 -5
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -85,7 +85,14 @@ Pass whichever adapter you choose into the `<CmsProvider adapter={myAdapter}>`.
|
|
|
85
85
|
```
|
|
86
86
|
*(If you are developing locally, you can use a workspace reference or file path).*
|
|
87
87
|
|
|
88
|
-
|
|
88
|
+
2. **Tailwind CSS Configuration (Important)**:
|
|
89
|
+
If your project uses Tailwind CSS v4, you must tell the compiler to scan `admin-lib-cms` for styling classes. Open your main CSS file (e.g., `app/globals.css`) and add the `@source` directive right after the tailwind import:
|
|
90
|
+
```css
|
|
91
|
+
@import "tailwindcss";
|
|
92
|
+
@source "../node_modules/admin-lib-cms";
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
### 3. Define your CMS Configuration
|
|
89
96
|
Create a configuration file (e.g. `cms.config.ts`) to tell the admin panel about your site's structure, the pages that can be edited, and the data collections you want to manage.
|
|
90
97
|
|
|
91
98
|
```typescript
|
|
@@ -122,7 +129,7 @@ export const cmsConfig: CmsConfig = {
|
|
|
122
129
|
};
|
|
123
130
|
```
|
|
124
131
|
|
|
125
|
-
###
|
|
132
|
+
### 4. Wrap your application with the CmsProvider
|
|
126
133
|
Typically in your `layout.tsx` or `_app.tsx`, pass your adapter and configuration to the provider:
|
|
127
134
|
|
|
128
135
|
```tsx
|
|
@@ -141,7 +148,7 @@ Typically in your `layout.tsx` or `_app.tsx`, pass your adapter and configuratio
|
|
|
141
148
|
}
|
|
142
149
|
```
|
|
143
150
|
|
|
144
|
-
|
|
151
|
+
5. Setup Authentication Routes:
|
|
145
152
|
`admin-lib-cms` provides a fully featured authentication system (registration, login, and JWT cookies) that works directly with your Storage Adapter. Create an API route at `app/api/admin/auth/route.ts`:
|
|
146
153
|
|
|
147
154
|
```tsx
|
|
@@ -157,7 +164,7 @@ Typically in your `layout.tsx` or `_app.tsx`, pass your adapter and configuratio
|
|
|
157
164
|
export const POST = handler;
|
|
158
165
|
```
|
|
159
166
|
|
|
160
|
-
|
|
167
|
+
6. Setup the Admin Pages (Dashboard & Login):
|
|
161
168
|
In your app's routing, create the following pages to render the CMS interface.
|
|
162
169
|
|
|
163
170
|
**Dashboard (`app/admin/page.tsx`):**
|
|
@@ -179,7 +186,7 @@ Typically in your `layout.tsx` or `_app.tsx`, pass your adapter and configuratio
|
|
|
179
186
|
}
|
|
180
187
|
```
|
|
181
188
|
|
|
182
|
-
|
|
189
|
+
7. Make elements editable on your pages:
|
|
183
190
|
|
|
184
191
|
You can use specific `Editable` components depending on the type of content you want to manage.
|
|
185
192
|
|