Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chore: Added letter section to add home page in basic setup doc #295

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 20 additions & 1 deletion src/pages/docs/how-to/basic-setup/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,26 @@ This catch-all route tells Next.js to use the templates to render pages.

Note that it is still possible to override this with hardcoded pages. For example, if you have a page in your WordPress site with a URI of `/about`, Faust.js will render that page using the relevant template in your project's `wp-templates` folder. However, if you add a `src/pages/about.js` file to your project, Next.js will render the `/about` path in your app using that file instead.

### D. Test your template
### D. Update the "Home" Page

Ensure you have a `/src/pages/index.js` file in order for the catch-all to work properly.

This could either be a hard-coded page or a faust page, such as:

```js title="src/pages/index.js"
import { getWordPressProps, WordPressTemplate } from "@faustwp/core"

export default function Page(props: any) {
return <WordPressTemplate {...props} />
}

export function getStaticProps(ctx: any) {
return getWordPressProps({ ctx })
}
```
Having this index will allow you to have WordPress + Faust on your home page.

### E. Test your template

You should now be able to make use of this template.

Expand Down
Loading