Skip to content

Commit

Permalink
docs: Unpublish and algolia process
Browse files Browse the repository at this point in the history
  • Loading branch information
neilmistryamplience committed May 9, 2024
1 parent 5acdc6a commit 2bdfa91
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 18 deletions.
33 changes: 27 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ The package also includes a Debug/X-Ray panel to help understand how the pages a
This demo application was developed and tested with:

- Node version `20.x`
- NPM version `10.x`

## General Use (w/o Amplience account)

Expand Down Expand Up @@ -80,10 +79,11 @@ The main tool for using your own Amplience environment with `dc-demostore-core`

At a high level the basic steps are:

1. [Request an Amplience Media and Dynamic Account (if you don't already have one)](#requesting-an-amplience-environment)
2. [Deploy a fork of `dc-demostore-core` (we'll cover deploying on Vercel)](#fork--deploy-dc-demostore-core)
3. Configure & use `dc-demostore-cli` to populate content
4. Update your local / deployed `dc-demostore-core` with environment variables to your account.
1. [Request an Amplience Demostore Account (if you don't already have one)](#requesting-an-amplience-demo-store-environment)
2. [Optionally request an Algolia account (if you don't already have one)](#requesting-an-algolia-account-optional)
3. [Deploy a fork of `dc-demostore-core` (we'll cover deploying on Vercel)](#fork--deploy-dc-demostore-core)
4. Configure & use `dc-demostore-cli` to populate content
5. Update your local / deployed `dc-demostore-core` with environment variables to your account.

> Note: If you already have an Amplience Demostore account and are upgrading to version `1.4.0` or later, you should upload the rendering templates for Stylitics components into your Content Hub.
Expand All @@ -98,6 +98,24 @@ This section assumes you are already an Amplience partner, customer, or internal

If you already have a Dynamic Content and Dynamic Media instance, you can skip to the [next step](#fork--deploy-dc-demostore-core).

## Requesting an Algolia Account (Optional)

This application can also automate Blog content into Algolia to be searchable and retrieved dynamically. This is not mandatory and the application will fall back to blogs being surfaced by the Amplience Filter API if you do not wish to use Algolia.

If you do wish to include Algolia, you will need access to an account

- Amplience Advanced Content Search
- If you already have an Algolia account directly, then you can use that account.
- Sign up for a free trial on [Algolia's website](https://www.algolia.com).

You will need your:

- Application ID
- Write Key
- Search Key

When automating in adding an environment via the demostore-cli, you have the option to supply Algolia credentials. If they are available then indexes, records and your configuration for the demostore app will be automated as part of this.

## Fork & Deploy `dc-demostore-core`

Go [HERE for some basic instructions](docs/ForkDeploy.md) on Forking and deploying core.
Expand Down Expand Up @@ -147,7 +165,10 @@ info: run completed in [ 1m47s ]

Once ran, you will be provided with your own specific value for the `NEXT_PUBLIC_DEMOSTORE_CONFIG_JSON` environment variable to replace in both your `.env.local` file and in your Vercel deployment environment variable.

> Note: If you ever need to revert, simply run the `cleanup` command.
> Notes:
>
> - If you ever need to revert, simply run the `cleanup` command.
> - If you choose not to supply Algolia credentials they will be omitted from this value.
## Change dc-demostore-core Config / Point to your account

Expand Down
25 changes: 13 additions & 12 deletions docs/WorkingWithPages.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ The concepts of pages are a key demonstrable area of Demostore. They exist in 2

### Navigation:

- **Category Page** - An item & page linked to a Commerce category (PLP)
- **Landing Page** - An item and standalone page for content only
- **External Page** - An item which has an external link for its page content
- **Category Page** - An item & page linked to a Commerce category (PLP)
- **Landing Page** - An item and standalone page for content only
- **External Page** - An item which has an external link for its page content

### Standalone:

- **Content Page** - A page which can be used by itself without being in the menu.
- **Content Page** - A page which can be used by itself without being in the menu.

## Ordering in Navigation

Expand All @@ -20,29 +20,30 @@ Example: 0 will be first

The priority is in relation to other priorities set at the same at the same level in the hierarchy. So for example if you have 2 nodes at the same level

- MyItemA [Priority set to 50]
- MyItemB [Priority set to 10]
- MyItemA [Priority set to 50]
- MyItemB [Priority set to 10]

Will display as `MyItemB,MyItemA` in that order

> Note: When categories are set to automatically draw from commerce, they are given their priority with increments of 10 so that you can mix and max dynamic and curated navigation.
> Additional node: If items have the same priority, they will display in order of which they are returned from the API.

## Hiding a page

Each of these content types has a flag in the content form called `is Active` which defaults to true.

If you disable this, then the page is no longer visible if attempting to visit it directly or in the menu navigation.

## Archiving a page & delivery keys

Best practice when archiving a page is to follow the steps below:

1) Set the page to not be active & save
a) If the page was previously published then republish.
2) Change the delivery key to something random & save
b) Delivery keys are mandatory so you can use the same path and append a unique id using an online tool such as [Short UUID Generator](https://generateuuid.online/short-uuid). Example `category/6vYaP46nCukXc2DPTpnXZP`
3) If the page is part of the navigation and already published, you should also remove the node and republish so that the parent link is no longer attached. See [Removing a node from a hierachy](https://amplience.com/developers/docs/dev-tools/guides-tutorials/hierarchies/#removing-a-node-from-a-hierarchy)
1. Set the page to not be active & save
a) If the page was previously published then unpublish.
2. Change the delivery key to something random & save
b) Delivery keys are mandatory so you can use the same path and append a unique id using an online tool such as [Short UUID Generator](https://generateuuid.online/short-uuid). Example `category/6vYaP46nCukXc2DPTpnXZP`
3. If the page is part of the navigation you should also remove the node so that the parent link is no longer attached for staging content. See [Removing a node from a hierachy](https://amplience.com/developers/docs/dev-tools/guides-tutorials/hierarchies/#removing-a-node-from-a-hierarchy)

This will ensure that your content is not still visible when removed and your delivery key can be re-used again.

Expand Down

0 comments on commit 2bdfa91

Please sign in to comment.