Skip to content

Commit 30dd70e

Browse files
authored
feat: Update Hugo and PR template guidance (#894)
This commit updates the Hugo guidance to accurately reflect the usage of our most common shortcodes, and guides people away from the ones that have been removed or will be removed soon based on Mainframe changes. The guidance is not fully inclusive: we have not yet determined where full documentation for all theme elements should live (Such as a publicly-facing design system), but it should cover the most commonly used shortcodes. The pull request template has also been updated in the same manner, attempting to focus on critical information for contributors. The checklist was previously quite long: it has been reduced to essential elements, and reframed as a direct, personal commitment. The detail underneath the "Proposed changes" has been shifted to inline, hidden guidance, following a similar pattern in our Hugo archetypes. Some information from the old checklist has been moved there, but it otherwise covers the same ground as the old guidance. It refers to and reinforces our standards asserted by our Git conventions documentation, and will not create visual noise within the PR should the contributor choose not to remove it.
1 parent fb2abfd commit 30dd70e

File tree

3 files changed

+71
-69
lines changed

3 files changed

+71
-69
lines changed

.github/pull_request_template.md

Lines changed: 20 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,31 @@
11
### Proposed changes
22

3-
Write a clear and concise description that helps reviewers understand the purpose and impact of your changes. Use the
4-
following format:
3+
[//]: # "Write a clear and concise description of what the pull request changes."
4+
[//]: # "You can use our Commit messages guidance for this."
5+
[//]: # "https://github.com/nginx/documentation/blob/main/documentation/git-conventions.md#commit-messages"
56

6-
Problem: Give a brief overview of the problem or feature being addressed.
7+
[//]: # "First, explain what was changed, and why. This should be most of the detail."
8+
[//]: # "Then how the changes were made, such as referring to existing styles and conventions."
9+
[//]: # "Finish by noting anything beyond the scope of the PR changes that may be affected."
710

8-
Solution: Explain the approach you took to implement the solution, highlighting any significant design decisions or
9-
considerations.
11+
[//]: # "Include information on testing if relevant and non-obvious from the deployment preview."
12+
[//]: # "For expediency, you can use screenshots to show small before and after examples."
1013

11-
Testing: Describe any testing that you did.
14+
[//]: # "If the changes were defined by a GitHub issue, reference it using keywords."
15+
[//]: # "https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/using-keywords-in-issues-and-pull-requests"
1216

13-
Please focus on (optional): If you any specific areas where you would like reviewers to focus their attention or provide
14-
specific feedback, add them here.
15-
16-
If this PR addresses an [issue](https://github.com/nginx/documentation/issues) on GitHub, ensure that you link to it here:
17-
18-
Closes #ISSUE
17+
[//]: # "Do not like to any internal, non-public resources. This includes internal repository issues or anything in an intranet."
18+
[//]: # "You can make reference to internal discussions without linking to them: see 'Referencing internal information'."
19+
[//]: # "https://github.com/nginx/documentation/blob/main/documentation/closed-contributions.md#referencing-internal-information"
1920

2021
### Checklist
2122

22-
Before merging a pull request, run through this checklist and mark each as complete.
23+
Before sharing this pull request, I completed the following checklist:
2324

24-
- [ ] I have read the [contributing guidelines](https://github.com/nginx/documentation/blob/main/CONTRIBUTING.md)
25-
- [ ] I have signed the [F5 Contributor License Agreement (CLA)](https://github.com/f5/.github/blob/main/CLA/cla-markdown.md)
26-
- [ ] I have rebased my branch onto main
27-
- [ ] I have ensured my PR is targeting the main branch and pulling from my branch from my own fork
28-
- [ ] I have ensured that the commit messages adhere to [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/#summary)
29-
- [ ] I have ensured that documentation content adheres to [the style guide](/documentation/style-guide.md)
30-
- [ ] If the change involves potentially sensitive changes[^1], I have assessed the possible impact
31-
- [ ] If applicable, I have added tests that prove my fix is effective or that my feature works
32-
- [ ] I have ensured that existing tests pass after adding my changes
33-
- [ ] If applicable, I have updated [`README.md`](/README.md)
25+
- [ ] I read the [Contributing guidelines](/CONTRIBUTING.md)
26+
- [ ] My branch adheres to the [Git conventions](/documentation/git-conventions.md)
27+
- [ ] My content changes adhere to the [F5 NGINX Documentation style guide](/documentation/style-guide.md)
28+
- [ ] If my changes involve potentially sensitive information[^1], I have assessed the possible impact
29+
- [ ] I have waited to ensure my changes pass tests, and addressed any discovered issues
3430

35-
[^1]: Potentially sensitive changes include anything involving code, personally identify information (PII), live URLs or significant amounts of new or revised documentation. Please refer to [our style guide](/documentation/style-guide.md) for guidance about placeholder content.
31+
[^1]: Potentially sensitive information includes personally identify information (PII), authentication credentials, and live URLs. Refer to the [style guide](/documentation/style-guide.md) for guidance about placeholder content.

documentation/closed-contributions.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,19 @@ We work in public by default, so this process should only be used on a case by c
1111

1212
For standard content releases, review the [Contributing guidelines](/CONTRIBUTING.md).
1313

14+
## Referencing internal information
15+
16+
During the last stage of this process, or while making any public pull request, you may need to reference something internal.
17+
18+
As mentioned in our pull request template checklist, you should not link to internal resources: they are considered "sensitive content", defined previously.
19+
20+
Instead, include the key outputs of the internal resource as part of describing context:
21+
22+
> "Following an internal discussion, the instructions for foo have been clarified"
23+
> "The phrasing of bar has been changed based on an internal requirement"
24+
25+
This allows you to retain the necessary context for a change without exposing a potentially important resource to the public.
26+
1427
## Overview
1528

1629
This repository (https://github.com/nginx/documentation) is where we work by default. It has a one-way sync to an internal repository, used for closed content.

documentation/writing-hugo.md

Lines changed: 38 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -87,53 +87,58 @@ To install <integation>, refer to the [integration instructions]({{< ref "/integ
8787

8888
### How to use Hugo shortcodes
8989

90-
[Hugo shortcodes](https://github.com/nginxinc/nginx-hugo-theme/tree/main/layouts/shortcodes) are used to format callouts, add images, and reuse content across different pages.
90+
[Hugo shortcodes](https://github.com/nginxinc/nginx-hugo-theme/tree/main/layouts/shortcodes) are used to provide extra functionality and special formatting to Markdown content.
9191

92-
For example, to use the `note` callout:
92+
This is an example of a call-out shortcode:
9393

9494
```md
95-
{{< note >}} Provide the text of the note here .{{< /note >}}
95+
{{< call-out "note" >}} Provide the text of the note here .{{< /call-out >}}
9696
```
9797

98-
The callout shortcodes support multi-line blocks:
98+
Here are some other shortcodes:
99+
100+
- `include`: Include the content of a file in another file: read the [Re-use content with includes](#re-use-content-with-includes) instructions
101+
- `tabs`: Create mutually exclusive tabbed window panes, useful for parallel instructions
102+
- `table`: Add scrollbars to wide tables for browsers with smaller viewports
103+
- `icon`: Add a [Lucide icon](https://lucide.dev/icons/) by using its name as a parameter
104+
- `link`: Link to a file, prepending its path with the Hugo baseUrl
105+
- `ghcode`: Embeds the contents of a code file: read the [Add code to documentation pages](#add-code-to-documentation-pages) instructions
106+
- `openapi`: Loads an OpenAPI specification and render it as HTML using ReDoc
107+
108+
#### Add call-outs to documentation pages
109+
110+
The call out shortcode support multi-line blocks:
99111

100112
```md
101-
{{< caution >}}
113+
{{< call-out "caution" >}}
102114
You should probably never do this specific thing in a production environment.
103115

104116
If you do, and things break, don't say we didn't warn you.
105-
{{< /caution >}}
117+
{{< /call-out >}}
106118
```
107119

108-
Supported callouts:
120+
The first parameter determines the type of call-out, which defines the colour given to it.
121+
122+
Supported types:
109123
- `note`
110124
- `tip`
111125
- `important`
112126
- `caution`
113127
- `warning`
114128

115-
You can also create custom callouts using the `call-out` shortcode `{{< call-out "type position" "header" "font-awesome icon >}}`. For example:
129+
An optional second parameter will add a title to the call-out: without it, it will fall back to the type.
116130

117131
```md
118-
{{<call-out "important side-callout" "JWT file required for upgrade" "fa fa-exclamation-triangle">}}
119-
```
132+
{{< call-out "important" "This instruction only applies to v#.#.#" >}}
133+
These instructions are only intended for versions #.#.# onwards.
120134

121-
By default, all custom callouts are displayed inline, unless you add `side-callout` which places the callout to the right of the content.
122-
123-
Here are some other shortcodes:
135+
Follow <these-instructions> if you're using an older version.
136+
{{< /call-out >}}
137+
```
124138

125-
- `fa`: Inserts a Font Awesome icon
126-
- `collapse`: Make a section collapsible
127-
- `tab`: Create mutually exclusive tabbed window panes, useful for parallel instructions
128-
- `table`: Add scrollbars to wide tables for browsers with smaller viewports
129-
- `link`: Link to a file, prepending its path with the Hugo baseUrl
130-
- `openapi`: Loads an OpenAPI specification and render it as HTML using ReDoc
131-
- `include`: Include the content of a file in another file; the included file must be present in the '/content/includes/' directory
132-
- `raw-html`: Include a block of raw HTML
133-
- `readfile`: Include the content of another file in the current file, which can be in an arbitrary location.
134-
- `bootstrap-table`: formats a table using Bootstrap classes; accepts any bootstrap table classes as additional arguments, e.g. `{{< bootstrap-table "table-bordered table-hover" }}`
139+
Finally, you can use an optional third parameter to add a [Lucide icon](https://lucide.dev/icons/) using its name.
135140

136-
### Add code to documentation pages
141+
#### Add code to documentation pages
137142

138143
For command, binary, and process names, we sparingly use pairs of backticks (\`\<some-name\>\`): `<some-name>`.
139144

@@ -145,22 +150,9 @@ You can also use the `ghcode` shortcode to embed a single file directly from Git
145150

146151
An example of this can be seen in [/content/ngf/get-started.md](https://github.com/nginx/documentation/blob/af8a62b15f86a7b7be7944b7a79f44fd5e526c15/content/ngf/get-started.md?plain=1#L233C1-L233C128), which embeds a YAML file.
147152

153+
#### Re-use content with includes
148154

149-
### Add images to documentation pages
150-
151-
Use the `img` shortcode to add images to documentation pages. It has the same parameters as the Hugo [figure shortcode](https://gohugo.io/content-management/shortcodes/#figure).
152-
153-
1. Add the image to the `/static/img` directory.
154-
2. Add the `img` shortcode:
155-
- `{{< img src="<img-file.png>" alt="<Alternative text>">}}`
156-
- Do not include a forward slash at the beginning of the file path or it will [break the image](https://gohugo.io/functions/relurl/#input-begins-with-a-slash).
157-
158-
> **Important**: We have strict guidelines for using images. Review them in our [style guide](/documentation/style-guide.md#guidelines-for-screenshots).
159-
160-
161-
### How to use Hugo includes
162-
163-
Hugo includes are a custom shortcode that allows you to embed content stored in the [`/content/includes` directory](https://github.com/nginx/documentation/tree/main/content/includes).
155+
The includes are a custom shortcode that allows you to embed content stored in the [`/content/includes` directory](https://github.com/nginx/documentation/tree/main/content/includes).
164156

165157
It allows for content to be defined once and display in multiple places without duplication, creating consistency and simplifying the maintenance of items such as reference tables.
166158

@@ -180,12 +172,13 @@ This particular include file is used in the following pages:
180172

181173
View the [Guidelines for includes](/templates/style-guide.md#guidelines-for-includes) for instructions on how to write effective include files.
182174

183-
## Linting
175+
#### Add images to documentation pages
184176

185-
To use markdownlint to check content, run the following command:
177+
Use the `img` shortcode to add images to documentation pages. It has the same parameters as the Hugo [figure shortcode](https://gohugo.io/content-management/shortcodes/#figure).
186178

187-
```shell
188-
markdownlint -c .markdownlint.yaml </content/path>
189-
```
179+
1. Add the image to the `/static/img` directory.
180+
2. Add the `img` shortcode:
181+
- `{{< img src="<img-file.png>" alt="<Alternative text>">}}`
182+
- Do not include a forward slash at the beginning of the file path or it will [break the image](https://gohugo.io/functions/relurl/#input-begins-with-a-slash).
190183

191-
The content path can be an individual file or a folder.
184+
> **Important**: We have strict guidelines for using images. Review them in our [style guide](/documentation/style-guide.md#guidelines-for-screenshots).

0 commit comments

Comments
 (0)