Skip to content

Commit 3c29272

Browse files
Mikalai Radchukm1kola
authored andcommitted
Updates contributing docs
Signed-off-by: Mikalai Radchuk <[email protected]>
1 parent 4ab9551 commit 3c29272

File tree

3 files changed

+38
-97
lines changed

3 files changed

+38
-97
lines changed

README.md

Lines changed: 8 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -20,18 +20,16 @@ updates:
2020

2121
1. Fork [olm-docs](https://github.com/operator-framework/olm-docs) on GitHub.
2222
1. Make your changes and send a pull request (PR).
23-
1. If you're not yet ready for a review, add "WIP" to the PR name to indicate
24-
it's a work in progress. (**Don't** add the Hugo property
25-
"draft = true" to the page front matter, because that prevents the
26-
auto-deployment of the content preview described in the next point.)
23+
1. If you're not yet ready for a review, create a draft PR to indicate it's a work in progress. (**Don't** add the Hugo property
24+
"draft = true" to the page front matter, because that prevents the
25+
auto-deployment of the content preview described in the next point.)
2726
1. Wait for the automated PR workflow to do some checks. When it's ready,
28-
you should see a comment like this: **deploy/netlify — Deploy preview ready!**
27+
you should see a comment like this: **deploy/netlify — Deploy preview ready!**
2928
1. Click **Details** to the right of "Deploy preview ready" to see a preview
30-
of your updates.
29+
of your updates.
3130
1. Continue updating your doc and pushing your changes until you're happy with
32-
the content.
33-
1. When you're ready for a review, add a comment to the PR, and remove any
34-
"WIP" markers.
31+
the content.
32+
1. When you're ready for a review, remove any "WIP" markers and mark PR ready for review.
3533

3634
## Updating a single page
3735

@@ -43,52 +41,12 @@ If you've just spotted something you'd like to change while using the docs, Docs
4341

4442
## Previewing your changes locally
4543

46-
If you want to run your own local Hugo server to preview your changes as you work:
47-
48-
1. Follow the instructions in [Getting started](/docs/getting-started) to install Hugo and any other tools you need. You'll need at least **Hugo version 0.45** (we recommend using the most recent available version), and it must be the **extended** version, which supports SCSS.
49-
1. Fork [olm-docs](https://github.com/operator-framework/olm-docs), then create a local copy using `git clone`. Don’t forget to use `--recurse-submodules` or you won’t pull down some of the code you need to generate a working site.
50-
51-
```sh
52-
git clone --recurse-submodules --depth 1 https://github.com/google/docsy-example.git
53-
```
54-
55-
1. Run `hugo server` in the site root directory. By default your site will be available at <http://localhost:1313/>. Now that you're serving your site locally, Hugo will watch for changes to the content and automatically refresh your site.
56-
1. Continue with the usual GitHub workflow to edit files, commit them, push the
57-
changes up to your fork, and create a pull request.
44+
If you want to run your own local Hugo server to preview your changes as you work follow [this guide](/content/en/docs/contribution-guidelines/local-docs.md).
5845

5946
## Creating an issue
6047

6148
If you've found a problem in the docs, but you're not sure how to fix it yourself, please create an issue in the [olm-docs repo](https://github.com/operator-framework/olm-docs). You can also create an issue about a specific page by clicking the **Create Issue** button in the top right hand corner of the page.
6249

63-
## Local Development
64-
65-
Clone the repository:
66-
67-
```sh
68-
git clone https://github.com/operator-framework/olm-docs/
69-
```
70-
71-
The docs are built with [Hugo](https://gohugo.io/) which can be installed along with the
72-
required extensions by following the [docsy install
73-
guide](https://www.docsy.dev/docs/getting-started/#prerequisites-and-installation).
74-
75-
We use `git submodules` to install the docsy theme. From the
76-
root directory, update the submodules to install the theme.
77-
78-
```sh
79-
git submodule update --init --recursive
80-
```
81-
82-
## Build and Serve
83-
84-
You can build and serve your docs to localhost:1313 with:
85-
86-
```sh
87-
hugo server
88-
```
89-
90-
Any changes will be included in real time.
91-
9250
## Useful resources
9351

9452
* [Docsy user guide](https://www.docsy.dev/docs/): All about Docsy, including how it manages navigation, look and feel, and multi-language support.

content/en/docs/contribution-guidelines/_index.md

Lines changed: 13 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -24,48 +24,36 @@ Here's a quick guide to updating the docs. It assumes you're familiar with the
2424
GitHub workflow and you're happy to use the automated preview of your doc
2525
updates:
2626

27-
- Fork [olm-docs](https://github.com/operator-framework/olm-docs) on GitHub.
28-
- Make your changes and send a pull request (PR).
29-
- If you're not yet ready for a review, add "WIP" to the PR name to indicate
30-
it's a work in progress. (**Don't** add the Hugo property
27+
1. Fork [olm-docs](https://github.com/operator-framework/olm-docs) on GitHub.
28+
1. Make your changes and send a pull request (PR).
29+
1. If you're not yet ready for a review, create a draft PR to indicate it's a work in progress. (**Don't** add the Hugo property
3130
"draft = true" to the page front matter, because that prevents the
3231
auto-deployment of the content preview described in the next point.)
33-
- Wait for the automated PR workflow to do some checks. When it's ready,
32+
1. Wait for the automated PR workflow to do some checks. When it's ready,
3433
you should see a comment like this: **deploy/netlify — Deploy preview ready!**
35-
- Click **Details** to the right of "Deploy preview ready" to see a preview
34+
1. Click **Details** to the right of "Deploy preview ready" to see a preview
3635
of your updates.
37-
- Continue updating your doc and pushing your changes until you're happy with
36+
1. Continue updating your doc and pushing your changes until you're happy with
3837
the content.
39-
- When you're ready for a review, add a comment to the PR, and remove any
40-
"WIP" markers.
38+
1. When you're ready for a review, remove any "WIP" markers and mark PR ready for review.
4139

4240
## Updating a single page
4341

4442
If you've just spotted something you'd like to change while using the docs, Docsy has a shortcut for you:
4543

46-
- Click **Edit this page** in the top right hand corner of the page.
47-
- If you don't already have an up to date fork of the project repo, you are prompted to get one - click **Fork this repository and propose changes** or **Update your Fork** to get an up to date version of the project to edit. The appropriate page in your fork is displayed in edit mode.
48-
- Follow the rest of the [Quick start with Netlify](#quick-start-with-netlify) process above to make, preview, and propose your changes.
44+
1. Click **Edit this page** in the top right hand corner of the page.
45+
1. If you don't already have an up to date fork of the project repo, you are prompted to get one - click **Fork this repository and propose changes** or **Update your Fork** to get an up to date version of the project to edit. The appropriate page in your fork is displayed in edit mode.
46+
1. Follow the rest of the [Quick start with Netlify](#quick-start-with-netlify) process above to make, preview, and propose your changes.
4947

5048
## Previewing your changes locally
5149

52-
If you want to run your own local Hugo server to preview your changes as you work:
53-
54-
- Follow the instructions in [Getting started](/docs/getting-started) to install Hugo and any other tools you need. You'll need at least **Hugo version 0.45** (we recommend using the most recent available version), and it must be the **extended** version, which supports SCSS.
55-
- Fork [olm-docs](https://github.com/operator-framework/olm-docs), then create a local copy using `git clone`. Don’t forget to use `--recurse-submodules` or you won’t pull down some of the code you need to generate a working site.
56-
57-
```bash
58-
git clone --recurse-submodules --depth 1 https://github.com/google/docsy-example.git
59-
```
60-
61-
- Run `hugo server` in the site root directory. By default your site will be available at http://localhost:1313. Now that you're serving your site locally, Hugo will watch for changes to the content and automatically refresh your site.
62-
- Continue with the usual GitHub workflow to edit files, commit them, push the changes up to your fork, and create a pull request.
50+
If you want to run your own local Hugo server to preview your changes as you work follow [this guide](/docs/contribution-guidelines/local-docs/).
6351

6452
## Creating an issue
6553

6654
If you've found a problem in the docs, but you're not sure how to fix it yourself, please create an issue in the [olm-docs repo](https://github.com/operator-framework/olm-docs). You can also create an issue about a specific page by clicking the **Create Issue** button in the top right hand corner of the page.
6755

6856
## Useful resources
6957

70-
- [Docsy user guide](https://www.docsy.dev/docs/): All about Docsy, including how it manages navigation, look and feel, and multi-language support.
71-
- [Hugo documentation](https://gohugo.io/documentation/): Comprehensive reference for Hugo.
58+
* [Docsy user guide](https://www.docsy.dev/docs/): All about Docsy, including how it manages navigation, look and feel, and multi-language support.
59+
* [Hugo documentation](https://gohugo.io/documentation/): Comprehensive reference for Hugo.

content/en/docs/contribution-guidelines/local-docs.md

Lines changed: 17 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -5,52 +5,47 @@ linkTitle: Local Docs
55

66
## Prerequisites
77

8-
Clone the repository:
8+
For running local dev server you will only need to install stable version of [Go](https://go.dev/)
9+
and clone the repository:
910

1011
```bash
1112
git clone https://github.com/operator-framework/olm-docs/
1213
```
1314

14-
The docs are built with [Hugo](https://gohugo.io/) which can be installed along with the
15-
required extensions by following the [docsy install
16-
guide](https://www.docsy.dev/docs/getting-started/).
15+
For other tasks such as building production version of the site
16+
and linting you will also need to:
17+
* Install Node.js LTS
18+
* Install Docker or Podman
1719

18-
We use `git submodules` to install the docsy theme. From the
19-
root directory, update the submodules to install the theme.
20-
21-
```bash
22-
git submodule update --init --recursive
23-
```
2420

2521
## Build and Serve
2622

27-
You can build and serve your docs to localhost:1313 with:
23+
You can build and serve your docs to <http://localhost:1313/> with:
2824

2925
```bash
30-
hugo server
26+
make serve
3127
```
3228

3329
Any changes will be included in real time.
3430

3531
## Running the Linting Script Locally
3632

37-
The `hack/ci/link-check.sh` script is responsible for building the site and running [html-proofer](https://github.com/gjtorikian/html-proofer) that validates the generated HTML output.
38-
39-
Before running the linting script, ensure you have the correct environment variable sets locally:
33+
To run linting locally you will need to run the following command:
4034

41-
- `$CONTAINER_ENGINE`: controls what container engine will be used. Defaults to `docker`.
42-
- `$CONTAINER_RUN_EXTRA_OPTIONS`: allows you to specify any additional run options to the container engine. Defaults to an empty string.
35+
```bash
36+
make lint
37+
```
4338

44-
In order to run the linting script locally using `podman`, run the following command from the root directory:
39+
This assumes `docker` command is available. If you want to specify different engine such as `podman`:
4540

4641
```bash
47-
export CONTAINER_ENGINE="podman"
48-
${PWD}/hack/ci/link-check.sh
42+
make lint CONTAINER_ENGINE=podman
4943
```
5044

45+
Behind this target, the `hack/ci/link-check.sh` script is responsible for running [html-proofer](https://github.com/gjtorikian/html-proofer) that validates the generated HTML output.
46+
5147
**Note**: In the case you're getting permission denied errors when reading from that mounted volume, set the following environment variable and re-run the linting script:
5248

5349
```bash
54-
export CONTAINER_RUN_EXTRA_OPTIONS="--security-opt label=disable"
55-
${PWD}/hack/ci/link-check.sh
50+
make lint CONTAINER_RUN_EXTRA_OPTIONS="--security-opt label=disable"
5651
```

0 commit comments

Comments
 (0)