Skip to content

Commit

Permalink
docs: add chapter for search-engine-optimized routes
Browse files Browse the repository at this point in the history
  • Loading branch information
Eisie96 authored and shauke committed Jun 15, 2022
1 parent a183b74 commit 6992ea1
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions docs/concepts/search-engine-optimization.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,23 @@ It is also possible to use translation keys here.

[`seo.effects.ts`](../../src/app/extensions/seo/store/seo/seo.effects.ts) is the central place for customizations concerning dynamic content, e.g. names of products or categories (asynchronous data from the API).
Effects are an essential part of our [State Management](./state-management.md).

## Optimized URLs

Optimized URLs are a major factor in determining search engine rankings. They should have a clear structure and must be readable.
By default, product, category and content page routes contain their localized context path.
Parameters are appended to theses paths that contain localization-independent and uniquely identifiable data.

| Type | Structure | Parameter | Example |
| ------------ | ---------------------------------------- | ------------------------------------------------- | ------------------------------------------------------------------------------------------------------- |
| category | complete category path | **-ctg**: category id | /computers/notebooks-and-pcs/notebook-accessories-ctgComputers.1835.1284 |
| product | complete category path with product name | **-prd**: product sku, </br>**-ctg**: category id | /computers/notebooks-and-pcs/notebook-accessories/kensington-keyfolio-prd5981602-ctgComputers.1835.1284 |
| content page | complete content page path | **-pg**: content page id | /help/faq/seo/how-to-pghow-to-seo |

**_NOTE:_** The given parameters for each url are needed to differentiate category, product and content page routes.
It is important to ensure that no identifier contains the specified parameter id.
For example, a category name including a `-ctg` substring could lead to unwanted behavior.

**_NOTE:_** Route generation and parsing for category, product and content-page routes can be customized.
This will require changes to the well documented [`product.route.ts`](../../src/app/core/routing/product/product.route.ts), [`category.route.ts`](../../src/app/core/routing/category/category.route.ts) or [`content-page.route.ts`](../../src/app/core/routing/content-page/content-page.route.ts) files.
Additionally, the corresponding pipes (e.g. [`product-route.pipe.ts`](../../src/app/core/routing/product/product-route.pipe.ts)) might have to be updated to fit your needs as will [`routing.ts`](../../src/app/core/utils/routing.ts).

0 comments on commit 6992ea1

Please sign in to comment.