From a0852ca57a8fb61c3e40cd898305179342b8364f Mon Sep 17 00:00:00 2001 From: Stephan Lachnit Date: Mon, 13 Jun 2022 12:30:52 +0200 Subject: [PATCH 1/2] remove GitHub logo for creating docs issue (#1045) GitLab uses the same link as GitHub, so this is an easy change to also support GitHub repositories. Signed-off-by: Stephan Lachnit Co-authored-by: LisaFC --- layouts/partials/page-meta-links.html | 2 +- userguide/content/en/docs/Adding content/repository-links.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/layouts/partials/page-meta-links.html b/layouts/partials/page-meta-links.html index c7e64bde16..3ec82d830f 100644 --- a/layouts/partials/page-meta-links.html +++ b/layouts/partials/page-meta-links.html @@ -40,7 +40,7 @@ {{ T "post_view_this" }} {{ T "post_edit_this" }} {{ T "post_create_child_page" }} - {{ T "post_create_issue" }} + {{ T "post_create_issue" }} {{ with $gh_project_repo -}} {{ $project_issueURL := printf "%s/issues/new" . -}} {{ T "post_create_project_issue" }} diff --git a/userguide/content/en/docs/Adding content/repository-links.md b/userguide/content/en/docs/Adding content/repository-links.md index d701115304..07ebc05501 100644 --- a/userguide/content/en/docs/Adding content/repository-links.md +++ b/userguide/content/en/docs/Adding content/repository-links.md @@ -14,7 +14,7 @@ The Docsy [docs and blog layouts](/docs/adding-content/content/#adding-docs-and- This page shows you how to configure these links. -Currently, Docsy supports only GitHub repository links "out of the box". If you are using another repository such as Bitbucket and would like generated repository links, feel free to [add a feature request or update our theme](/docs/contribution-guidelines/). +Currently, Docsy supports only GitHub repository links "out of the box". Since GitLab can handle the same link scheme, it should work as well. If you are using another repository such as Bitbucket and would like generated repository links, feel free to [add a feature request or update our theme](/docs/contribution-guidelines/). ## Link configuration From 436ae8700eeb7ea63278b9d1a410ea03d32bf156 Mon Sep 17 00:00:00 2001 From: Geri Ochoa Date: Mon, 13 Jun 2022 07:08:37 -0400 Subject: [PATCH 2/2] Add Docker to run docsy user guide locally (#1016) Add support to run the docsy website server locally inside a container. With support for both `docker` and `docker-compose`. The folder is mounted as a shared volume, allowing changes to be picked up by the container. The `node_modules` folder is kept in a volume, to avoid surfacing those files in the host folder. The documentation explains how to run the container as the host user, so you don't end up with files like `package.json` and `.hugo-build.lock` owned by root on the host os. Co-authored-by: LisaFC --- Dockerfile | 9 ++++ docker-compose.yaml | 14 ++++++ .../en/docs/Contribution guidelines/_index.md | 45 +++++++++++++++++++ 3 files changed, 68 insertions(+) create mode 100644 Dockerfile create mode 100644 docker-compose.yaml diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000000..54b4a7af84 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,9 @@ +FROM klakegg/hugo:0.95.0-ext-alpine as docsy-user-guide + +RUN apk update +RUN apk add git +COPY package.json /app/docsy/userguide/ +WORKDIR /app/docsy/userguide/ +RUN npm install --production=false + +CMD ["serve", "--cleanDestinationDir", "--themesDir ../..", "--baseURL http://localhost:1313/", "--buildDrafts", "--buildFuture", "--disableFastRender", "--ignoreCache", "--watch"] diff --git a/docker-compose.yaml b/docker-compose.yaml new file mode 100644 index 0000000000..5c3a5e3955 --- /dev/null +++ b/docker-compose.yaml @@ -0,0 +1,14 @@ +version: "3.3" + +services: + + site: + image: docsy/user-guide + build: + context: . + ports: + - "1313:1313" + user: "${DOCSY_USER}" + volumes: + - /app/docsy/userguide/node_modules + - .:/app/docsy diff --git a/userguide/content/en/docs/Contribution guidelines/_index.md b/userguide/content/en/docs/Contribution guidelines/_index.md index 3e09b07d45..899b79d7b2 100644 --- a/userguide/content/en/docs/Contribution guidelines/_index.md +++ b/userguide/content/en/docs/Contribution guidelines/_index.md @@ -100,6 +100,51 @@ If you want to run your own local Hugo server to preview your changes as you wor 1. Continue with the usual GitHub workflow to edit files, commit them, push the changes up to your fork, and create a pull request. +#### Preview your changes using a Docker container + +Docsy comes with `Dockerfile` and `docker-compose` files to run the server +locally with Docker, without installing any additional dependencies. + +- Using [Docker]: + + 1. Build the Docker container: + + ```bash + docker build -t docsy/user-guide + ``` + + 1. Run the container, mounting the repository as a shared volume: + + ```bash + docker run -it --user=$(id -u):$(id -g) -p 1313:1313 \ + -v $(pwd):/app/docsy -v /app/docsy/userguide/node_modules \ + docsy/user-guide + ``` + +- Using [Docker Compose][docker-compose]: + + 1. Build the container: + + ```bash + docker-compose build + ``` + + 1. Run the container: + + ```bash + DOCSY_USER=$(id -u):$(id -g) docker-compose up + ``` + +Open `http://localhost:1313` in your web browser to load the docsy user guide. +In most cases, docsy will automatically reload the site to reflect any changes +to the documentation or the code. Changes to some parts of the docsy code may +require manually reloading the page or re-starting the container. + +Press **Ctrl + C** to stop the container. + +[docker]: https://docs.docker.com/get-docker/ +[docker-compose]: https://docs.docker.com/compose/install/ + ### Creating an issue If there's something you'd like to see in the docs, but you're not sure how to fix it yourself, please create an issue in [this repository](https://github.com/google/docsy). 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.