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: docs/local_previews.md
+19-5Lines changed: 19 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,10 +1,10 @@
1
1
# Working with the repo locally
2
2
3
-
Content-only changes can often be done directly on the GitHub website. Changes affecting the function or structure of the site should be previewed fully locally before being submitted via PR.
3
+
Content-only changes can often be done directly on the GitHub website. Changes affecting the function or structure of the site should be previewed fully locally before being submitted via PR.
4
4
5
5
## Jekyll
6
6
7
-
To preview the site locally, clone it.
7
+
To preview the site locally, clone it.
8
8
9
9
Then you'll need to [install jekyll](https://jekyllrb.com/docs/installation/).
10
10
@@ -14,9 +14,9 @@ Then go to the root of the site and issue (just once):
14
14
$ bundle install
15
15
```
16
16
17
-
which will install the necessary Ruby gems (the info for this is included in the repo files).
17
+
which will install the necessary Ruby gems (the info for this is included in the repo files).
18
18
19
-
And then (also in the top level directory of your forked repository) to be able to see the rendered website, run
19
+
And then (also in the top level directory of your forked repository) to be able to see the rendered website, run
20
20
21
21
```bash
22
22
$ jekyll serve
@@ -32,6 +32,8 @@ If you are having trouble try `rm -rf _site`, followed by `bundle update`, then
32
32
33
33
You can build and run a Docker container to preview the site locally and support a local development workflow. If you do not already have Docker installed, please visit https://docs.docker.com/get-docker/ and follow the links to get started with Docker on your operating system.
34
34
35
+
These instructions also work with the [Podman](https://podman.io/) container management tool simply by substituting `podman` for `docker` in the commands below. This can either be done manually, by creating a shell alias (e.g., `alias podman=docker`), or by installing a package such as `podman-docker` to automatically handle this translation.
36
+
35
37
Build the container image:
36
38
37
39
```bash
@@ -59,9 +61,21 @@ To develop the website, launch the container using the following command, where
59
61
60
62
```bash
61
63
docker run --rm -it -p 4000:4000 \
62
-
-v $(pwd):/srv/jekyll \
64
+
-u $(id -u):$(id -g) \
65
+
-v $(pwd):/srv/jekyll:Z \
63
66
us-rse-website:latest
64
67
```
65
68
69
+
or, if using Podman in a rootless environment:
70
+
71
+
```bash
72
+
podman run --rm -it -p 4000:4000 \
73
+
--userns=keep-id \
74
+
-v $(pwd):/srv/jekyll:Z \
75
+
us-rse-website:latest
76
+
```
77
+
78
+
If these commands fail, you may need to address any discrepancies between the user/group mapping in your container runtime and the permissions on the directory where the volume mount resides.
79
+
66
80
Edit a source file and save the changes. You will see Jekyll automatically regenerate the site, after which you can reload the page in your browser to see the rendered changes.
0 commit comments