|
1 |
| -# JOSDK comments: |
| 1 | +# Java Operator SDK Documentation |
2 | 2 |
|
3 |
| -see: sample github action: https://gohugo.io/hosting-and-deployment/hosting-on-github/ |
| 3 | +This repository contains the documentation website for the Java Operator SDK (JOSDK), built using Hugo and the Docsy theme. |
4 | 4 |
|
5 |
| -currently use hugo version v0.125.7 |
| 5 | +## About Java Operator SDK |
6 | 6 |
|
7 |
| -# Docsy Example |
| 7 | +Java Operator SDK is a framework that makes it easy to build Kubernetes operators in Java. It provides APIs designed to feel natural to Java developers and handles common operator challenges automatically, allowing you to focus on your business logic. |
8 | 8 |
|
9 |
| -[Docsy][] is a [Hugo theme module][] for technical documentation sites, providing easy |
10 |
| -site navigation, structure, and more. This **Docsy Example Project** uses the Docsy |
11 |
| -theme component as a hugo module and provides a skeleton documentation structure for you to use. |
12 |
| -You can clone/copy this project and edit it with your own content, or use it as an example. |
| 9 | +## Development Setup |
13 | 10 |
|
14 |
| -In this project, the Docsy theme is pulled in as a Hugo module, together with |
15 |
| -its dependencies: |
| 11 | +This documentation site uses Hugo v0.125.7 with the Docsy theme. |
16 | 12 |
|
17 |
| -```console |
18 |
| -$ hugo mod graph |
19 |
| -... |
20 |
| -``` |
21 |
| - |
22 |
| -For Docsy documentation, see [Docsy user guide][]. |
23 |
| - |
24 |
| -This Docsy Example Project is hosted on [Netlify][] at [example.docsy.dev][]. |
25 |
| -You can view deploy logs from the [deploy section of the project's Netlify |
26 |
| -dashboard][deploys], or this [alternate dashboard][]. |
27 |
| - |
28 |
| -This is not an officially supported Google product. This project is currently maintained. |
29 |
| - |
30 |
| -## Using the Docsy Example Project as a template |
31 |
| - |
32 |
| -A simple way to get started is to use this project as a template, which gives you a site project that is set up and ready to use. To do this: |
33 |
| - |
34 |
| -1. Use the dropdown for switching branches/tags to change to the **latest** released tag. |
35 |
| - |
36 |
| -2. Click **Use this template**. |
37 |
| - |
38 |
| -3. Select a name for your new project and click **Create repository from template**. |
39 |
| - |
40 |
| -4. Make your own local working copy of your new repo using git clone, replacing https://github.com/me/example.git with your repo’s web URL: |
41 |
| - |
42 |
| -```bash |
43 |
| -git clone --depth 1 https://github.com/me/example.git |
44 |
| -``` |
| 13 | +## Prerequisites |
45 | 14 |
|
46 |
| -You can now edit your own versions of the site’s source files. |
| 15 | +- Hugo v0.125.7 or later (extended version required) |
| 16 | +- Node.js and npm (for PostCSS processing) |
| 17 | +- Git |
47 | 18 |
|
48 |
| -If you want to do SCSS edits and want to publish these, you need to install `PostCSS` |
| 19 | +## Local Development |
49 | 20 |
|
50 |
| -```bash |
51 |
| -npm install |
52 |
| -``` |
53 |
| - |
54 |
| -## Running the website locally |
55 |
| - |
56 |
| -Building and running the site locally requires a recent `extended` version of [Hugo](https://gohugo.io). |
57 |
| -You can find out more about how to install Hugo for your environment in our |
58 |
| -[Getting started](https://www.docsy.dev/docs/getting-started/#prerequisites-and-installation) guide. |
59 |
| - |
60 |
| -Once you've made your working copy of the site repo, from the repo root folder, run: |
61 |
| - |
62 |
| -```bash |
63 |
| -hugo server |
64 |
| -``` |
| 21 | +### Quick Start |
65 | 22 |
|
66 |
| -## Running a container locally |
| 23 | +1. Clone this repository |
| 24 | +2. Install dependencies: |
| 25 | + ```bash |
| 26 | + npm install |
| 27 | + ``` |
| 28 | +3. Start the development server: |
| 29 | + ```bash |
| 30 | + hugo server |
| 31 | + ``` |
| 32 | +4. Open your browser to `http://localhost:1313` |
67 | 33 |
|
68 |
| -You can run docsy-example inside a [Docker](https://docs.docker.com/) |
69 |
| -container, the container runs with a volume bound to the `docsy-example` |
70 |
| -folder. This approach doesn't require you to install any dependencies other |
71 |
| -than [Docker Desktop](https://www.docker.com/products/docker-desktop) on |
72 |
| -Windows and Mac, and [Docker Compose](https://docs.docker.com/compose/install/) |
73 |
| -on Linux. |
| 34 | +### Using Docker |
74 | 35 |
|
75 |
| -1. Build the docker image |
| 36 | +You can also run the documentation site using Docker: |
76 | 37 |
|
| 38 | +1. Build the container: |
77 | 39 | ```bash
|
78 | 40 | docker-compose build
|
79 | 41 | ```
|
80 |
| - |
81 |
| -1. Run the built image |
82 |
| - |
| 42 | +2. Run the container: |
83 | 43 | ```bash
|
84 | 44 | docker-compose up
|
85 | 45 | ```
|
| 46 | + > **Note**: You can combine both commands with `docker-compose up --build` |
86 | 47 |
|
87 |
| - > NOTE: You can run both commands at once with `docker-compose up --build`. |
| 48 | +3. Access the site at `http://localhost:1313` |
88 | 49 |
|
89 |
| -1. Verify that the service is working. |
90 |
| - |
91 |
| - Open your web browser and type `http://localhost:1313` in your navigation bar, |
92 |
| - This opens a local instance of the docsy-example homepage. You can now make |
93 |
| - changes to the docsy example and those changes will immediately show up in your |
94 |
| - browser after you save. |
95 |
| - |
96 |
| -### Cleanup |
97 |
| - |
98 |
| -To stop Docker Compose, on your terminal window, press **Ctrl + C**. |
99 |
| - |
100 |
| -To remove the produced images run: |
| 50 | +To stop the container, press **Ctrl + C** in your terminal. |
101 | 51 |
|
| 52 | +To clean up Docker resources: |
102 | 53 | ```bash
|
103 | 54 | docker-compose rm
|
104 | 55 | ```
|
105 |
| -For more information see the [Docker Compose documentation][]. |
106 |
| - |
107 |
| -## Using a local Docsy clone |
108 |
| - |
109 |
| -Make sure your installed go version is `1.18` or higher. |
110 |
| - |
111 |
| -Clone the latest version of the docsy theme into the parent folder of your project. The newly created repo should now reside in a sibling folder of your site's root folder. |
112 |
| - |
113 |
| -```shell |
114 |
| -cd root-of-your-site |
115 |
| -git clone --branch v0.7.2 https://github.com/google/docsy.git ../docsy |
116 |
| -``` |
117 |
| - |
118 |
| -Now run: |
119 |
| - |
120 |
| -```shell |
121 |
| -HUGO_MODULE_WORKSPACE=docsy.work hugo server --ignoreVendorPaths "**" |
122 |
| -``` |
123 |
| - |
124 |
| -or, when using npm, prepend `local` to the script you want to invoke, e.g.: |
125 |
| - |
126 |
| -```shell |
127 |
| -npm run local serve |
128 |
| -``` |
129 |
| - |
130 |
| -By using the `HUGO_MODULE_WORKSPACE` directive (either directly or via prefix `local` when using npm), the server now watches all files and directories inside the sibling directory `../docsy` , too. Any changes inside the local `docsy` theme clone are now immediately picked up (hot reload), you can instantly see the effect of your local edits. |
131 | 56 |
|
132 |
| -In the command above, we used the environment variable `HUGO_MODULE_WORKSPACE` to tell hugo about the local workspace file `docsy.work`. Alternatively, you can declare the workspace file inside your settings file `hugo.toml`: |
133 |
| - |
134 |
| -```toml |
135 |
| -[module] |
136 |
| - workspace = "docsy.work" |
137 |
| -``` |
| 57 | +## Contributing |
138 | 58 |
|
139 |
| -Your project's `hugo.toml` file already contains these lines, the directive for workspace assignment is commented out, however. Remove the two trailing comment characters '//' so that this line takes effect. |
| 59 | +We welcome contributions to improve the documentation! Please see our [contribution guidelines](CONTRIBUTING.md) for details on how to get started. |
140 | 60 |
|
141 | 61 | ## Troubleshooting
|
142 | 62 |
|
143 |
| -As you run the website locally, you may run into the following error: |
144 |
| - |
145 |
| -```console |
146 |
| -$ hugo server |
147 |
| -WARN 2023/06/27 16:59:06 Module "project" is not compatible with this Hugo version; run "hugo mod graph" for more information. |
148 |
| -Start building sites … |
149 |
| -hugo v0.101.0-466fa43c16709b4483689930a4f9ac8add5c9f66+extended windows/amd64 BuildDate=2022-06-16T07:09:16Z VendorInfo=gohugoio |
150 |
| -Error: Error building site: "C:\Users\foo\path\to\docsy-example\content\en\_index.md:5:1": failed to extract shortcode: template for shortcode "blocks/cover" not found |
151 |
| -Built in 27 ms |
152 |
| -``` |
153 |
| - |
154 |
| -This error occurs if you are running an outdated version of Hugo. As of docsy theme version `v0.7.0`, hugo version `0.110.0` or higher is required. |
155 |
| -See this [section](https://www.docsy.dev/docs/get-started/docsy-as-module/installation-prerequisites/#install-hugo) of the user guide for instructions on how to install Hugo. |
156 |
| - |
157 |
| -Or you may be confronted with the following error: |
158 |
| - |
| 63 | +### Module Compatibility Error |
| 64 | +If you see an error about module compatibility, ensure you're using Hugo v0.110.0 or higher: |
159 | 65 | ```console
|
160 |
| -$ hugo server |
161 |
| - |
162 |
| -INFO 2021/01/21 21:07:55 Using config file: |
163 |
| -Building sites … INFO 2021/01/21 21:07:55 syncing static files to / |
164 |
| -Built in 288 ms |
165 |
| -Error: Error building site: TOCSS: failed to transform "scss/main.scss" (text/x-scss): resource "scss/scss/main.scss_9fadf33d895a46083cdd64396b57ef68" not found in file cache |
| 66 | +Error: Error building site: failed to extract shortcode: template for shortcode "blocks/cover" not found |
166 | 67 | ```
|
167 | 68 |
|
168 |
| -This error occurs if you have not installed the extended version of Hugo. |
169 |
| -See this [section](https://www.docsy.dev/docs/get-started/docsy-as-module/installation-prerequisites/#install-hugo) of the user guide for instructions on how to install Hugo. |
170 |
| - |
171 |
| -Or you may encounter the following error: |
172 |
| - |
| 69 | +### SCSS Processing Error |
| 70 | +If you encounter SCSS-related errors, make sure you have the extended version of Hugo installed: |
173 | 71 | ```console
|
174 |
| -$ hugo server |
175 |
| - |
176 |
| -Error: failed to download modules: binary with name "go" not found |
| 72 | +Error: TOCSS: failed to transform "scss/main.scss" |
177 | 73 | ```
|
178 | 74 |
|
179 |
| -This error occurs if you have not installed the `go` programming language on your system. |
180 |
| -See this [section](https://www.docsy.dev/docs/get-started/docsy-as-module/installation-prerequisites/#install-go-language) of the user guide for instructions on how to install `go`. |
| 75 | +### Go Binary Not Found |
| 76 | +If you see "binary with name 'go' not found", install the Go programming language from [golang.org](https://golang.org). |
181 | 77 |
|
| 78 | +## Links |
182 | 79 |
|
183 |
| -[alternate dashboard]: https://app.netlify.com/sites/goldydocs/deploys |
184 |
| -[deploys]: https://app.netlify.com/sites/docsy-example/deploys |
185 |
| -[Docsy user guide]: https://docsy.dev/docs |
186 |
| -[Docsy]: https://github.com/google/docsy |
187 |
| -[example.docsy.dev]: https://example.docsy.dev |
188 |
| -[Hugo theme module]: https://gohugo.io/hugo-modules/use-modules/#use-a-module-for-a-theme |
189 |
| -[Netlify]: https://netlify.com |
190 |
| -[Docker Compose documentation]: https://docs.docker.com/compose/gettingstarted/ |
| 80 | +- [Hugo Documentation](https://gohugo.io/documentation/) |
| 81 | +- [Docsy Theme Documentation](https://www.docsy.dev/docs/) |
| 82 | +- [Java Operator SDK GitHub Repository](https://github.com/operator-framework/java-operator-sdk) |
0 commit comments