|
| 1 | +# OLM Documentation |
| 2 | + |
| 3 | +We use [Hugo](https://gohugo.io/) to format and generate our website, the |
| 4 | +[Docsy](https://github.com/google/docsy) theme for styling and site structure, |
| 5 | +and [Netlify](https://www.netlify.com/) to manage the deployment of the site. |
| 6 | +Hugo is an open-source static site generator that provides us with templates, |
| 7 | +content organisation in a standard directory structure, and a website generation |
| 8 | +engine. You write the pages in Markdown (or HTML if you want), and Hugo wraps them up into a website. |
| 9 | + |
| 10 | +All submissions, including submissions by project members, require review. We |
| 11 | +use GitHub pull requests for this purpose. Consult |
| 12 | +[GitHub Help](https://help.github.com/articles/about-pull-requests/) for more |
| 13 | +information on using pull requests. |
| 14 | + |
| 15 | +## Quick start with Netlify |
| 16 | + |
| 17 | +Here's a quick guide to updating the docs. It assumes you're familiar with the |
| 18 | +GitHub workflow and you're happy to use the automated preview of your doc |
| 19 | +updates: |
| 20 | + |
| 21 | +1. Fork [olm-docs](https://github.com/operator-framework/olm-docs) on GitHub. |
| 22 | +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.) |
| 27 | +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!** |
| 29 | +1. Click **Details** to the right of "Deploy preview ready" to see a preview |
| 30 | + of your updates. |
| 31 | +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. |
| 35 | + |
| 36 | +## Updating a single page |
| 37 | + |
| 38 | +If you've just spotted something you'd like to change while using the docs, Docsy has a shortcut for you: |
| 39 | + |
| 40 | +1. Click **Edit this page** in the top right hand corner of the page. |
| 41 | +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. |
| 42 | +1. Follow the rest of the [Quick start with Netlify](#quick-start-with-netlify) process above to make, preview, and propose your changes. |
| 43 | + |
| 44 | +## Previewing your changes locally |
| 45 | + |
| 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. |
| 58 | +
|
| 59 | +## Creating an issue |
| 60 | +
|
| 61 | +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. |
| 62 | +
|
| 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 | +
|
| 92 | +## Useful resources |
| 93 | +
|
| 94 | +* [Docsy user guide](wherever it goes): All about Docsy, including how it manages navigation, look and feel, and multi-language support. |
| 95 | +* [Hugo documentation](https://gohugo.io/documentation/): Comprehensive reference for Hugo. |
0 commit comments