You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+49Lines changed: 49 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -26,3 +26,52 @@ information on using pull requests.
26
26
27
27
This project follows
28
28
[Google's Open Source Community Guidelines](https://opensource.google.com/conduct/).
29
+
30
+
## Local Development
31
+
32
+
To develop this theme locally, you can link it to a Hugo site (like the [academy starter template](https://github.com/layer5io/academy-example)) using a `replace` directive in the site's `go.mod` file.
33
+
34
+
1.**Directory Setup**
35
+
36
+
Ensure you have cloned both this theme repository and your Hugo site repository into the same parent directory. Your folder structure should look like this:
37
+
```
38
+
my-academy-content/
39
+
├── academy-example/ <-- Your content project
40
+
└── academy-theme/ <-- This theme project
41
+
```
42
+
43
+
2. **Modify `go.mod`**
44
+
45
+
In your site's (`academy-example/`) `go.mod` file, add the following `replace` directive to point to your local theme folder:
Now, when you run `make site` from within your site's directory, Hugo will use your local theme files instead of fetching the remote module, allowing you to see your changes live.
52
+
53
+
## Updating the Theme
54
+
55
+
To ensure you have the latest version of the theme or to upgrade to a newer release, follow these steps:
56
+
57
+
1. **Update Go Module**
58
+
Navigate to your Hugo site's root directory (e.g., `academy-example/`) in your terminal. Run the following command to update the theme module:
59
+
```bash
60
+
go get -u github.com/layer5io/academy-theme
61
+
```
62
+
This command will fetch the latest version of the theme and update your `go.mod` and `go.sum` files accordingly.
63
+
64
+
2. **Clean Cache (Optional but Recommended)**
65
+
Sometimes, Hugo's cache might prevent the latest changes from being fully reflected. To clear the cache and ensure a fresh build:
66
+
```bash
67
+
hugo mod clean
68
+
```
69
+
70
+
3. **Rebuild Your Site**
71
+
After updating the theme, rebuild your Hugo site to incorporate the changes:
72
+
73
+
```bash
74
+
make site
75
+
```
76
+
77
+
Your site should now be running with the updated theme.
0 commit comments