Skip to content

Commit 506e73e

Browse files
authored
feat: Replace existing archetypes with three new discrete types (#97)
NGINX documentation broadly follows the Diataxis model, and we have specific conventions around certain types of documents. This commit pares the exisiting Hugo archetype down to three that are closely related: how-to, concept and tutorial. Outside of providing page-specific information architecture, these templates include our updated frontmatter formatting and parameter, and inline guidance on how we prefer to use Markdown formatting and Hugo shortcodes. There will be additional work of this nature in the future, once more specialised content types have been identified and consensus has been reached on what their precise style should be.
1 parent 8485f7f commit 506e73e

File tree

9 files changed

+225
-457
lines changed

9 files changed

+225
-457
lines changed

archetypes/api.md

-17
This file was deleted.

archetypes/blog.md

-7
This file was deleted.

archetypes/concept.md

+62-32
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,74 @@
11
---
2+
# We use sentence case and present imperative tone
23
title: "{{ replace .Name "-" " " | title }}"
3-
date: {{ .Date }}
4-
# Change draft status to false to publish doc
5-
draft: true
6-
# Description
7-
# Add a short description (150 chars) for the doc. Include keywords for SEO.
8-
# The description text appears in search results and at the top of the doc.
9-
description: ""
10-
# Assign weights in increments of 100
11-
weight:
12-
toc: true
13-
tags: [ "docs" ]
14-
# Create a new entry in the Jira DOCS Catalog and add the ticket ID (DOCS-<number>) below
4+
# Weights are assigned in increments of 100: determines sorting order
5+
weight: i00
6+
# Creates a table of contents and sidebar, useful for large documents
7+
toc: false
8+
# Types have a 1:1 relationship with Hugo archetypes, so you shouldn't need to change this
9+
type: concept
10+
# Intended for internal catalogue and search, case sensitive:
11+
# Agent, N4Azure, NIC, NIM, NGF, NAP-DOS, NAP-WAF, NGINX One, NGINX+, Solutions, Unit
12+
product:
13+
# Intended for internal catalogue
1514
docs: "DOCS-000"
16-
# Taxonomies
17-
# These are pre-populated with all available terms for your convenience.
18-
# Remove all terms that do not apply.
19-
categories: ["installation", "platform management", "load balancing", "api management", "service mesh", "security", "analytics"]
20-
doctypes: ["concept"]
21-
journeys: ["researching", "getting started", "using", "renewing", "self service"]
22-
personas: ["devops", "netops", "secops", "support"]
23-
versions: []
24-
authors: []
2515
---
26-
27-
## Overview
2816

29-
Briefly describe the goal of this document, that is, what the user will learn or accomplish by reading what follows.
17+
[//]: # "These are Markdown comments to guide you through document structure. Remove them as you go, as well as any unnecessary sections."
18+
[//]: # "Use underscores for _italics_, and double asterisks for **bold**."
19+
[//]: # "Backticks are for `monospace`, used sparingly and reserved mostly for executable names - they can cause formatting problems. Avoid them in tables: use italics instead."
3020

31-
## Concept 1 - format as a noun phrase
21+
[//]: # "Begin each document with a sentence or two explaining what the purpose of the guide is, and what high-level actions to expect. No need to adhere precisely the example text given anywhere in this template."
3222

33-
This is where you explain the concept. Provide information that will help the user understand what the element/feature is and how it fits into the overall product.
23+
This guide provides an overview of <concept>, which is used <for/in> <action 1>, <action 2> and <action 3>.
3424

35-
Organize content in this section with H3 and H4 headings.
25+
It is an example of a <other concept>, and is closely related to <third concept>.
3626

37-
## Concept 2 - format as a noun phrase
27+
---
28+
29+
## Background
30+
31+
[//]: # "Explain what the concept is. If possible, relate it to another commonly known concept or software."
32+
[//]: # "This relates the new idea to the reader using their existing knowledge, helping their understanding of it and thus what its purpose is in context."
33+
34+
---
35+
36+
## Use cases
37+
38+
[//]: # "Name the individual use case sections after the actual use case itself, e.g "Route traffic between applications"
39+
40+
### Use case 1
41+
42+
[//]: # "A description for a use case should be a high level outline of a particular problem, then explain how the subject concept is the solution for the issue."
43+
44+
[//]: # "If it helps, include a diagram of some kind. Ensure your description provides all the context required, however: a diagram is an aid to explain things, not a replacement."
3845

39-
## Concept 3 - format as a noun phrase
46+
```mermaid
47+
# You can use Mermaid to draw diagrams in a codeblock with mermaid as the language.
48+
# Read their documentation for usage: https://mermaid.js.org/intro/
49+
```
50+
51+
Starting from the <top/left> of the diagram, you can see that <thing> is connected to <other thing>: this relationship is established when configuring <parameter> as part of <file name>.
52+
53+
[//]: # "End a particular use case section with links to other pages, such as instructional documentation, other concepts, or reference information (Such as API specifications)."
54+
55+
- [Additional reading 1](some-external-link)
56+
- [Additional reading 2]({{< ref "/some/internal/link.md" >}})
57+
- Additional reading 3
58+
59+
### Use case 2
60+
61+
---
62+
63+
## Conclusion
64+
65+
[//]: # "Summarize everything that the reader will have learned by reading this entire concept document."
66+
[//]: # "It should fulfill the promise made by the introductory paragraph at the top of the document."
67+
[//]: # "Since each use case provides links to additional documents, you may not need to link to more,"
68+
[//]: # "or even include the final 'See also' section."
69+
70+
---
4071

41-
## What's Next
72+
## See also
4273

43-
- Provide up to 5 links to related topics (optional).
44-
- Format as a bulleted list.
74+
[//]: # "Link to related documents, such as concepts, reference material or similar use cases."

archetypes/default.md

+61-50
Original file line numberDiff line numberDiff line change
@@ -1,79 +1,90 @@
11
---
2+
# We use sentence case and present imperative tone
23
title: "{{ replace .Name "-" " " | title }}"
3-
date: {{ .Date }}
4-
# Change draft status to false to publish doc.
5-
draft: true
6-
# Description
7-
# Add a short description (150 chars) for the doc. Include keywords for SEO.
8-
# The description text appears in search results and at the top of the doc.
9-
description: ""
10-
# Assign weights in increments of 100
11-
weight:
12-
toc: true
13-
tags: [ "docs" ]
14-
# Create a new entry in the Jira DOCS Catalog and add the ticket ID (DOCS-<number>) below
4+
# Weights are assigned in increments of 100: determines sorting order
5+
weight: i00
6+
# Creates a table of contents and sidebar, useful for large documents
7+
toc: false
8+
# Types have a 1:1 relationship with Hugo archetypes, so you shouldn't need to change this
9+
type: how-to
10+
# Intended for internal catalogue and search, case sensitive:
11+
# Agent, N4Azure, NIC, NIM, NGF, NAP-DOS, NAP-WAF, NGINX One, NGINX+, Solutions, Unit
12+
product:
13+
# Intended for internal catalogue
1514
docs: "DOCS-000"
16-
# Taxonomies
17-
# These are pre-populated with all available terms for your convenience.
18-
# Remove all terms that do not apply.
19-
categories: ["installation", "platform management", "load balancing", "api management", "service mesh", "security", "analytics"]
20-
doctypes: ["task"]
21-
journeys: ["researching", "getting started", "using", "renewing", "self service"]
22-
personas: ["devops", "netops", "secops", "support"]
23-
versions: []
24-
authors: []
15+
---
16+
17+
[//]: # "These are Markdown comments to guide you through document structure. Remove them as you go, as well as any unnecessary sections."
18+
[//]: # "Use underscores for _italics_, and double asterisks for **bold**."
19+
[//]: # "Backticks are for `monospace`, used sparingly and reserved mostly for executable names - they can cause formatting problems. Avoid them in tables: use italics instead."
20+
21+
[//]: # "Begin each document with a sentence or two explaining what the purpose of the guide is, and what high-level actions to expect. No need to adhere precisely the example text given anywhere in this template."
22+
23+
This guide explains how to <X> with <Y>. In involves the use of <A>, <B> and <C>, demonstrating how <X> works with an example <Z>.
2524

2625
---
2726

28-
## Overview
27+
## Before you begin
28+
29+
[//]: # "List everything someone will need installed or configured before it's required. Link directly to installation guides where possible."
30+
31+
To complete this guide, you will need the following prerequisites:
32+
33+
- [Requirement 1](some-external-link)
34+
- [Requirement 2]({{< ref "/some/internal/link.md" >}})
35+
- Requirement 3
36+
37+
[//]: # "Note the style of link for requirement two: keep the markdown extension. Links are resolved from the root of the documentation folder, often /site."
2938

30-
Briefly describe the goal of this document, that is, what the user will learn or accomplish by reading what follows.
39+
---
40+
41+
## Step 1
3142

32-
Introduce and explain any new concepts the user may need to understand before proceeding.
43+
[//]: # "Explain the initial step: this is usually creating or configuring a resource. Sub-steps may not be necessary, depending on complexity."
3344

34-
## Before You Begin
45+
```shell
46+
# We typically show examples of commands or code in one code block, which can be easily copied by a reader using a button connected to the block.
47+
```
48+
```text
49+
# A second code block is used underneath the first to show what kind of example output to expect from the command. Truncate unnecessary output with ellipses (...).
50+
```
3551

36-
To complete the instructions in this guide, you need the following:
52+
### Sub-step 1
3753

38-
1. Provide any prerequisites here.
39-
2. Format as a numbered or bulleted list as appropriate.
40-
3. Keep the list entries grammatically parallel.1. Provide any prerequisites here.
54+
[//]: # "Sub-steps are ways of breaking steps into even smaller sections. Each step or sub-step should focus on one thing at a time: a user should be able to stop at the end of section and come back afterwards without leaving their software in a non-functional state."
4155

42-
## Goal 1 - write as a verb phrase
56+
---
4357

44-
Add introductory text. Say what the user will be doing.
58+
### Sub-step 2
4559

46-
To do xzy, take the following steps:
60+
[//]: # "A useful final sub-step for a given section is some kind of verification or testing, so the reader is confident the steps have been successful."
4761

48-
1. This is where you provide the steps that the user must take to accomplish the goal.
62+
---
4963

50-
```bash
51-
code examples should be nested within the list
52-
```
64+
## Step 2
5365

54-
2. Format as numbered lists.
66+
[//]: # "Explain any additional steps required. If the how-to guide involves multiple components, each component can have its own step for delineation."
5567

56-
{{< note >}}Add notes like this.{{</note>}}
68+
### Sub-step 1
5769

58-
3. If there is only one step, you don't need to format it as a numbered list.
70+
---
5971

60-
## Goal 2 - write as a verb phrase
72+
### Sub-step 2
6173

62-
## Goal 3 - write as a verb phrase
74+
---
6375

64-
## Discussion
76+
## Step 3
6577

66-
Use the discussion section to expand on the information presented in the steps above.
78+
[//]: # "The final step of a how-to guide is usually a final test, and summarizes all of the previous steps taken to accomplish the purpose of the guide."
6779

68-
This section contains the "why" information.
80+
### Sub-step 1
6981

70-
This information lives at the end of the document so that users who just want to follow the steps don't have to scroll through a wall of explanatory text to find them.
82+
---
7183

72-
## Verification
84+
### Sub-step 2
7385

74-
Explain how the user can verify the steps completed successfully.
86+
---
7587

76-
## What's Next
88+
## See also
7789

78-
- Provide up to 5 links to related topics (optional).
79-
- Format as a bulleted list.
90+
[//]: # "Link to related documents, such as concepts, reference material or similar use cases."

archetypes/openapi.md

-30
This file was deleted.

0 commit comments

Comments
 (0)