chore(examples): removes nested docs, redirects, virtual fields, custom server, and hierarchy examples (#9112)

Removes examples that are now duplicative or unnecessary due to new
features in 3.0:

### Custom server

This one can be removed in favor of [Next.js
documentation](https://nextjs.org/docs/pages/building-your-application/configuring/custom-server)

### Hierarchy

The new `join` field can solve for many of the use cases for the
`hierarchy` example. Bi-directional relationships with the `join` field
should be preferred here.

### Nested Docs, Redirects

Our website template showcases how to use the `nested-docs` and
`redirects` plugins in-depth, with real-world examples.

### Virtual Fields

Virtual fields have gotten significantly easier and can now be defined
by specifying `virtual: true`. Not a big need for a full example any
longer.

---------

Co-authored-by: Jacob Fletcher <jacobsfletch@gmail.com>
This commit is contained in:
James Mikrut
2024-11-18 16:11:21 -05:00
committed by GitHub
parent 54379eccf4
commit 6873b139e2
239 changed files with 14 additions and 55079 deletions

View File

@@ -1,43 +1,35 @@
import type { Page } from '../payload-types'
export const home: Partial<Page> = {
title: 'Home Page',
slug: 'home',
_status: 'published',
richText: [
{
children: [
{ text: 'This is a ' },
{ type: 'link', newTab: true, url: 'https://nextjs.org/', children: [{ text: '' }] },
{ type: 'link', children: [{ text: '' }], newTab: true, url: 'https://nextjs.org/' },
{ text: '' },
{
type: 'link',
linkType: 'custom',
url: 'https://nextjs.org/',
newTab: true,
children: [{ text: 'Next.js' }],
linkType: 'custom',
newTab: true,
url: 'https://nextjs.org/',
},
{ text: " app made explicitly for Payload's " },
{
type: 'link',
newTab: true,
url: 'https://github.com/payloadcms/payload/tree/main/examples/redirects',
children: [{ text: '' }],
},
{ text: '' },
{
type: 'link',
children: [{ text: 'Draft Preview Example' }],
linkType: 'custom',
newTab: true,
url: 'https://github.com/payloadcms/payload/tree/main/examples/draft-preview/payload',
children: [{ text: 'Draft Preview Example' }],
},
{ text: '. This example demonstrates how to implement draft preview into Payload using ' },
{
type: 'link',
children: [{ text: 'Drafts' }],
newTab: true,
url: 'https://payloadcms.com/docs/versions/drafts#drafts',
children: [{ text: 'Drafts' }],
},
{ text: '.' },
],
@@ -47,30 +39,31 @@ export const home: Partial<Page> = {
children: [
{
type: 'link',
linkType: 'custom',
url: 'http://localhost:3000/admin',
newTab: true,
children: [{ text: 'Log in to the admin panel' }],
linkType: 'custom',
newTab: true,
url: 'http://localhost:3000/admin',
},
{ text: ' and refresh this page to see the ' },
{
type: 'link',
children: [{ text: 'Payload Admin Bar' }],
linkType: 'custom',
newTab: true,
url: 'https://github.com/payloadcms/payload-admin-bar',
children: [{ text: 'Payload Admin Bar' }],
},
{
text: ' appear at the top of this site. This will allow you to seamlessly navigate between the two apps. Then, navigate to the ',
},
{
type: 'link',
children: [{ text: 'example page' }],
linkType: 'custom',
url: 'http://localhost:3001/example-page',
children: [{ text: 'example page' }],
},
{ text: ' to see how we control access to draft content. ' },
],
},
],
title: 'Home Page',
}