You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/tutorial/learn-faust/index.md
+12-13Lines changed: 12 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
---
2
-
title: "Learn Faust.js"
3
-
description: "Tutorial to learn about the core features of Faust.js."
2
+
title: 'Learn Faust.js'
3
+
description: 'Tutorial to learn about the core features of Faust.js.'
4
4
---
5
5
6
6
This tutorial introduces you to the core features of Faust.js. You'll begin with a pre-configured Next.js project and learn how to implement these features yourself:
@@ -98,7 +98,7 @@ By referencing the template hierarchy image above, you can see that we can targe
98
98
Copy the `gql` import and the `SingleTemplate` component from `wp-templates/single.js` and paste them into `wp-templates/page.js`. Rename the `SingleTemplate` component to `PageTemplate`. Our new page template should now look like this:
99
99
100
100
```jsx title="wp-templates/page.js"
101
-
import { gql } from"@apollo/client";
101
+
import { gql } from'@apollo/client';
102
102
103
103
exportdefaultfunctionPageTemplate(props) {
104
104
const { title, content } =props.data.page;
@@ -117,7 +117,7 @@ You can see that the `PageTemplate` component receives the props passed into it,
117
117
Next, copy the `SingleTemplate.query` and `SingleTemplate.variables` assignments from `wp-templates/single.js` and paste them into `wp-templates/page.js`. rename them to `PageTemplate.query` and `PageTemplate.variables`. The new page template should now look like this:
118
118
119
119
```jsx title="wp-templates/page.js"
120
-
import { gql } from"@apollo/client";
120
+
import { gql } from'@apollo/client';
121
121
122
122
exportdefaultfunctionPageTemplate(props) {
123
123
const { title, content } =props.data.page;
@@ -153,8 +153,8 @@ The `PageTemplate.variables` function takes the `uri` for the current page and m
153
153
ThelaststepistomakeFaustawareofournewtemplate. Todothis, open `wp-templates/index.js` and add these lines:
154
154
155
155
```js
156
-
importSingleTemplatefrom"./single";
157
-
importPageTemplatefrom"./page"; // [!code ++]
156
+
importSingleTemplatefrom'./single';
157
+
importPageTemplatefrom'./page'; // [!code ++]
158
158
159
159
consttemplates = {
160
160
single: SingleTemplate,
@@ -198,9 +198,9 @@ This tells React to render a "Loading" message if the component is still loading
198
198
Update the `Component.variables` function to return a new `asPreview` variable that is set to the value of `ctx?.asPreview`:
0 commit comments