diff --git a/examples/next/block-support/.env.local.sample b/examples/next/block-support/.env.local.sample index 46782dd61..b88d18d46 100644 --- a/examples/next/block-support/.env.local.sample +++ b/examples/next/block-support/.env.local.sample @@ -1,8 +1,8 @@ -# Your WordPress site URL -NEXT_PUBLIC_WORDPRESS_URL=https://faustexample.wpengine.com +# Your WordPress site URL. It needs WPGraphQL Content Blocks; see the README. +NEXT_PUBLIC_WORDPRESS_URL=https://your-wordpress-site.com # Plugin secret found in WordPress Settings->Faust -# FAUST_SECRET_KEY=YOUR_PLUGIN_SECRET +FAUST_SECRET_KEY=YOUR_PLUGIN_SECRET # Needed for sitemaps (no naming requirements for this, NEXT_PUBLIC_SITE_URL is just an example) NEXT_PUBLIC_SITE_URL=http://localhost:3000 diff --git a/examples/next/block-support/README.md b/examples/next/block-support/README.md index 5d0394e02..a99f796ae 100644 --- a/examples/next/block-support/README.md +++ b/examples/next/block-support/README.md @@ -7,14 +7,16 @@ Example showcasing Faust.js block editor support. ## Pre-requisites -See and for reference +See [Basic Setup](https://faustjs.org/docs/how-to/basic-setup/) and [Rendering Blocks](https://faustjs.org/docs/how-to/rendering-blocks/) for reference. -You have a WordPress instance with tne following plugins installed and active on your WordPress instance: +You need your own WordPress site with these plugins installed and active: - [WPGraphQL](https://github.com/wp-graphql/wp-graphql) - [FaustWP](https://github.com/wpengine/faustjs/tree/canary/plugins/faustwp) - [WPGraphQL Content Blocks](https://github.com/wpengine/wp-graphql-content-blocks) +The example only has a front page template, so set a static front page in Settings > Reading and add some blocks to it. + In order to run the block-support example you need to do the following: @@ -22,17 +24,17 @@ In order to run the block-support example you need to do the following: ```bash git clone git@github.com:wpengine/faustjs.git my-project cd my-project/examples/next/block-support/ -touch .env.local +cp .env.local.sample .env.local ``` Update the .env.local as per setup guide ```.env.local # Your WordPress site URL -NEXT_PUBLIC_WORDPRESS_URL=https://faustexample.wpengine.com +NEXT_PUBLIC_WORDPRESS_URL=https://your-wordpress-site.com -# Plugin secret found in WordPress Settings->Headless -#FAUST_SECRET_KEY= +# Plugin secret found in WordPress Settings->Faust +FAUST_SECRET_KEY=YOUR_PLUGIN_SECRET # The URL of your site, used by Faust for sitemap generation, however you can name this whatever you want. NEXT_PUBLIC_SITE_URL=http://localhost:3000 diff --git a/examples/next/custom-toolbar/.env.local.sample b/examples/next/custom-toolbar/.env.local.sample deleted file mode 100644 index 79b29afdd..000000000 --- a/examples/next/custom-toolbar/.env.local.sample +++ /dev/null @@ -1,5 +0,0 @@ -# Your WordPress site URL -NEXT_PUBLIC_WORDPRESS_URL=https://faustexample.wpengine.com - -# Plugin secret found in WordPress Settings->Headless -# FAUST_SECRET_KEY=YOUR_PLUGIN_SECRET \ No newline at end of file diff --git a/examples/next/custom-toolbar/.gitignore b/examples/next/custom-toolbar/.gitignore deleted file mode 100644 index 1437c53f7..000000000 --- a/examples/next/custom-toolbar/.gitignore +++ /dev/null @@ -1,34 +0,0 @@ -# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. - -# dependencies -/node_modules -/.pnp -.pnp.js - -# testing -/coverage - -# next.js -/.next/ -/out/ - -# production -/build - -# misc -.DS_Store -*.pem - -# debug -npm-debug.log* -yarn-debug.log* -yarn-error.log* - -# local env files -.env.local -.env.development.local -.env.test.local -.env.production.local - -# vercel -.vercel diff --git a/examples/next/custom-toolbar/README.md b/examples/next/custom-toolbar/README.md deleted file mode 100644 index 2154852c6..000000000 --- a/examples/next/custom-toolbar/README.md +++ /dev/null @@ -1,24 +0,0 @@ -# Custom Toolbar - -> **Deprecated:** This example is deprecated and no longer maintained. It will not receive updates or security fixes. - -This repository uses a starter scaffolding to get you up and running quickly on [WP Engine's Headless Platform](https://wpengine.com/headless-wordpress/) with a WordPress site skeleton for more advanced developers and also includes the Custom Toolbar Example. - -## For more information - -For more information on this Blueprint please check out the following sources: - -- [WP Engine's Headless Platform](https://wpengine.com/headless-wordpress/) -- [Faust.js](https://faustjs.org) -- [WPGraphQL](https://www.wpgraphql.com) -- [WP Engine's Headless WordPress Blog](https://developers.wpengine.com) - -### Contributor License Agreement - -All external contributors to WP Engine products must have a signed Contributor License Agreement (CLA) in place before the contribution may be accepted into any WP Engine codebase. - -1. [Submit your name and email](https://wpeng.in/cla/) -2. 📝 Sign the CLA emailed to you -3. 📥 Receive copy of signed CLA - -❤️ Thank you for helping us fulfill our legal obligations in order to continue empowering builders through headless WordPress. diff --git a/examples/next/custom-toolbar/faust.config.js b/examples/next/custom-toolbar/faust.config.js deleted file mode 100644 index 83c249fc6..000000000 --- a/examples/next/custom-toolbar/faust.config.js +++ /dev/null @@ -1,14 +0,0 @@ -import { setConfig } from "@faustwp/core"; -import templates from "./wp-templates"; -import possibleTypes from "./possibleTypes.json"; -import { CustomToolbar } from "./plugins/CustomToolbar"; - -/** - * @type {import('@faustwp/core').FaustConfig} - **/ -export default setConfig({ - templates, - plugins: [new CustomToolbar()], - experimentalToolbar: true, - possibleTypes, -}); diff --git a/examples/next/custom-toolbar/next.config.js b/examples/next/custom-toolbar/next.config.js deleted file mode 100644 index 25fa23092..000000000 --- a/examples/next/custom-toolbar/next.config.js +++ /dev/null @@ -1,6 +0,0 @@ -const { withFaust, getWpHostname } = require('@faustwp/core'); - -/** - * @type {import('next').NextConfig} - **/ -module.exports = withFaust({}); diff --git a/examples/next/custom-toolbar/package.json b/examples/next/custom-toolbar/package.json deleted file mode 100644 index c977db0bc..000000000 --- a/examples/next/custom-toolbar/package.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "name": "@faustwp/custom-toolbar", - "private": true, - "scripts": { - "dev": "faust dev", - "build": "faust build", - "generate": "faust generatePossibleTypes", - "start": "faust start" - }, - "dependencies": { - "@apollo/client": "^3.7.7", - "@faustwp/cli": "^3.2.5", - "@faustwp/core": "^3.3.2", - "graphql": "^16.6.0", - "next": "^16.2.9", - "react": "^18.2.0", - "react-dom": "^18.2.0" - }, - "overrides": { - "fast-xml-parser": "^5.3.4", - "postcss": "^8.5.10" - } -} diff --git a/examples/next/custom-toolbar/pages/[...wordpressNode].js b/examples/next/custom-toolbar/pages/[...wordpressNode].js deleted file mode 100644 index fe51bbcc9..000000000 --- a/examples/next/custom-toolbar/pages/[...wordpressNode].js +++ /dev/null @@ -1,16 +0,0 @@ -import { getWordPressProps, WordPressTemplate } from '@faustwp/core'; - -export default function Page(props) { - return ; -} - -export function getStaticProps(ctx) { - return getWordPressProps({ ctx }); -} - -export async function getStaticPaths() { - return { - paths: [], - fallback: 'blocking', - }; -} diff --git a/examples/next/custom-toolbar/pages/_app.js b/examples/next/custom-toolbar/pages/_app.js deleted file mode 100644 index 297723c04..000000000 --- a/examples/next/custom-toolbar/pages/_app.js +++ /dev/null @@ -1,16 +0,0 @@ -import "../faust.config"; -import React from "react"; -import { useRouter } from "next/router"; -import { FaustProvider } from "@faustwp/core"; -import '@faustwp/core/dist/css/toolbar.css'; -import "../styles/globals.css"; - -export default function MyApp({ Component, pageProps }) { - const router = useRouter(); - - return ( - - - - ); -} diff --git a/examples/next/custom-toolbar/pages/api/faust/[[...route]].js b/examples/next/custom-toolbar/pages/api/faust/[[...route]].js deleted file mode 100644 index e73fd7919..000000000 --- a/examples/next/custom-toolbar/pages/api/faust/[[...route]].js +++ /dev/null @@ -1,4 +0,0 @@ -import '../../../faust.config'; -import { apiRouter } from '@faustwp/core'; - -export default apiRouter; diff --git a/examples/next/custom-toolbar/pages/example.js b/examples/next/custom-toolbar/pages/example.js deleted file mode 100644 index b1c3866f2..000000000 --- a/examples/next/custom-toolbar/pages/example.js +++ /dev/null @@ -1,51 +0,0 @@ -import { gql, useQuery } from "@apollo/client"; -import Head from "next/head"; -import Header from "../components/header"; -import EntryHeader from "../components/entry-header"; -import Footer from "../components/footer"; -import { getNextStaticProps } from "@faustwp/core"; - -/** - * Next.js file based page example with Faust helpers. - */ -export default function Page() { - const { data } = useQuery(Page.query); - - const { title: siteTitle, description: siteDescription } = - data.generalSettings; - const menuItems = data.primaryMenuItems.nodes; - - return ( - <> - - {siteTitle} - - -
- -
- -

Next.js pages are still supported!

-
- -