Skip to content

Commit 6c12034

Browse files
committed
structure for metadata page
1 parent bd8d6cc commit 6c12034

File tree

4 files changed

+106
-77
lines changed

4 files changed

+106
-77
lines changed

public/__redirects

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1317,6 +1317,8 @@
13171317
/docs-guide/manage-content/redirects/ /style-guide/how-we-docs/redirects/ 301
13181318
/docs-guide/manage-content/redirects/best-practices/ /style-guide/how-we-docs/redirects/ 301
13191319
/docs-guide/manage-content/redirects/process/ /style-guide/how-we-docs/redirects/ 301
1320+
/docs-guide/manage-content/metadata/ /style-guide/how-we-docs/metadata/ 301
1321+
/docs-guide/manage-content/metadata/process/ /style-guide/how-we-docs/metadata/ 301
13201322

13211323
# support
13221324

src/content/docs/docs-guide/manage-content/metadata/index.mdx

Lines changed: 0 additions & 25 deletions
This file was deleted.

src/content/docs/docs-guide/manage-content/metadata/process.mdx

Lines changed: 0 additions & 52 deletions
This file was deleted.
Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
---
2+
pcx_content_type: how-to
3+
title: Metadata
4+
meta:
5+
title: Metadata | How we docs
6+
---
7+
8+
Page-level metadata - content type, associated products, last updated, word count - lets you take a broader, more strategic view of your content.
9+
10+
It helps you answer questions like the following:
11+
12+
- As a writer:
13+
- Am I missing something obvious in the content strategy?
14+
- What are some pages I should be updating right now?
15+
- How does X tutorial compare with all tutorials? Is it getting more traffic than the baseline?
16+
- As a manager:
17+
- Are we over or underinvesting in a specific product area? Or a specific content type?
18+
- How does the traffic to this set of products compare to another?
19+
- How can I communicate broader trends to my stakeholders?
20+
21+
You cannot answer these questions without some level of rollup reporting, which you can only get through metadata.
22+
23+
## What we track
24+
25+
At Cloudflare, we track the following information about different pages:
26+
27+
| Value | Description | Examples |
28+
| ---------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------- |
29+
| **Product** | The top-level subfolder of the page. | `dns`, `bots` |
30+
| **Product Group** | The primary area that each product falls into. | `Application Performance`, `Developer Platform` |
31+
| **Tags** | Specific [atttributes](/style-guide/frontmatter/tags/) related to a page's content or purpose. | `AI`, `JavaScript`, `Headers` |
32+
| **Content type** | The primary purpose of the page, which corresponds to our listed [content types](/style-guide/documentation-content-strategy/content-types/). | `how-to`, `faq` |
33+
| **Last modified** | How many days ago was this page last updated? | `63` |
34+
| **Last reviewed** (optional) | How many days ago was this page last reviewed? | `100` |
35+
36+
Of all of these values, there is a bit of nuance to our **Last reviewed** metadata. **Last reviewed** differs from **Last modified** because a review is more thorough than an update. A review implies that all contents of the page have been vetted for accuracy.
37+
38+
Because of this extra effort, we only track **Last reviewed** for content types that are particularly important to the user journey and require an additional level of maintenance. At the moment, those content types are [tutorials](/style-guide/documentation-content-strategy/content-types/tutorial/).
39+
40+
---
41+
42+
## How we track
43+
44+
We set these values at two different levels, the folder level and the page level.
45+
46+
### Folder-level attributes
47+
48+
We set two values at a folder level, `Product` and `Product Group`. We take this approach because we can assume that these values apply every page within that folder.
49+
50+
{/* GitHubCode example of a product.yaml file */}
51+
52+
### Page-level attributes
53+
54+
We primarily set page-level attributes through the [page's frontmatter](/style-guide/frontmatter/custom-properties/).
55+
56+
{/* GitHubCode example of a specific file with a lot of them */}
57+
58+
However, the `last_modified` value is pulled automatically from the git history of a file.
59+
60+
---
61+
62+
## How we use values
63+
64+
We choose to render all of these values as specific `meta` properties for each page.
65+
66+
For example, these are the `meta` properties and values on the [AI Audit - Get Started page](/ai-audit/get-started/).
67+
68+
{/* prettier-ignore */}
69+
```html title="Get Started | AI Audit"
70+
<meta name="pcx_content_group" content="Core platform" >
71+
<meta name="pcx_product" content="AI Audit" >
72+
<meta name="pcx_content_type" content="get-started" >
73+
<meta name="pcx_last_modified" content="7" >
74+
```
75+
76+
We render these values using a custom override for our [`Head.astro`]() file.
77+
78+
{/* GitHubCode for Head.astro */}
79+
80+
### Benefits
81+
82+
We get two primary benefits from structuring our content this way.
83+
84+
First, our metadata is easily consumable by anyone who crawls our pages. We started using these values for our Algolia search configuration and internal reporting, but have since expanded to sharing this data with other teams that consume our content for AI systems too.
85+
86+
Additionally, this decisions means that our GitHub repo is always the source of truth. We do not have to keep a spreadsheet or mapping updated elsewhere, the source of truth is always in our repo and - by extension - a lot more likely to be accurate than if we maintained multiple sources of truth.
87+
88+
---
89+
90+
## How we ensure quality
91+
92+
It's difficult to avoid errors with this kind of metadata, specifically because we are relying on freeform text entry in the frontmatter of individual files.
93+
94+
We utilize `zod` schemas heavily in our Astro site, which are defined at [tbd](/tbd/).
95+
96+
These allow us to provide Intellisense guidance for contributors using IDEs for local development.
97+
98+
### Optional or required
99+
100+
At the moment, most of our Zod schemas are purely optional, meaning that they will not cause a build to fail.
101+
102+
However, we do have one value, `tags`, that we enforce an allowlist as part of our schema validation. We enforce this schema specifically because we render it as a customer-facing facet for our [search page](/search/), meaning that typos are more disruptive than for other types of metadata.
103+
104+
To try and make this list a bit more flexible, we've included `alternate` values that can lead to the same presented value.

0 commit comments

Comments
 (0)