create-puck-app 0.13.0-canary.b95050d → 0.13.0-canary.ecb276c
Sign up to get free protection for your applications and to get access to all the features.
package/package.json
CHANGED
@@ -33,7 +33,7 @@ To adopt this recipe you will need to:
|
|
33
33
|
|
34
34
|
- **IMPORTANT** Add authentication to `/edit` routes. This can be done by modifying the example routes `/app/routes/_index.tsx` and `/app/routes/edit.tsx` or the example model in `/app/models/page.server.ts`. **If you don't do this, Puck will be completely public.**
|
35
35
|
- Integrate your database into the API calls in `/app/models/page.server.ts`
|
36
|
-
- Implement a custom puck configuration in
|
36
|
+
- Implement a custom puck configuration in `/app/puck.config.tsx`
|
37
37
|
|
38
38
|
By default, this recipe will have JavaScript enable on all routes - like a usual react app. If you know that your Puck content doesn't need react, then you can disable JS uncommenting the relevant code in `/app/root.tsx` and the example route `/app/routes/_index.tsx`. Check the network tab for no JS downloads, and verify that the page still works.
|
39
39
|
|
@@ -3,7 +3,7 @@ import type { LoaderFunctionArgs, MetaFunction } from "@remix-run/node";
|
|
3
3
|
import { json } from "@remix-run/node";
|
4
4
|
import { useLoaderData } from "@remix-run/react";
|
5
5
|
|
6
|
-
import puckConfig from "
|
6
|
+
import puckConfig from "~/puck.config";
|
7
7
|
import { getPage } from "~/models/page.server";
|
8
8
|
|
9
9
|
export const loader = async ({ params }: LoaderFunctionArgs) => {
|
@@ -22,7 +22,7 @@ export const loader = async ({ params }: LoaderFunctionArgs) => {
|
|
22
22
|
};
|
23
23
|
|
24
24
|
export const meta: MetaFunction<typeof loader> = ({ data }) => {
|
25
|
-
const title = data?.puckData?.root?.title || "Page";
|
25
|
+
const title = data?.puckData?.root?.props?.title || "Page";
|
26
26
|
|
27
27
|
return [{ title }];
|
28
28
|
};
|
@@ -10,7 +10,7 @@ import { json } from "@remix-run/node";
|
|
10
10
|
import { useLoaderData, useSubmit } from "@remix-run/react";
|
11
11
|
import invariant from "tiny-invariant";
|
12
12
|
|
13
|
-
import puckConfig from "
|
13
|
+
import puckConfig from "~/puck.config";
|
14
14
|
import { getPage, setPage } from "~/models/page.server";
|
15
15
|
|
16
16
|
export const action = async ({ params, request }: ActionFunctionArgs) => {
|
@@ -40,7 +40,7 @@ export const loader = async ({ params }: LoaderFunctionArgs) => {
|
|
40
40
|
};
|
41
41
|
|
42
42
|
export const meta: MetaFunction<typeof loader> = ({ data }) => {
|
43
|
-
const title = data?.initialData?.root?.title || "Untitled page";
|
43
|
+
const title = data?.initialData?.root?.props?.title || "Untitled page";
|
44
44
|
|
45
45
|
return [{ title: `Editing: ${title}` }];
|
46
46
|
};
|
File without changes
|