From 27564d82847883e159c06803fa72481e0e91e36a Mon Sep 17 00:00:00 2001 From: Marc Duiker Date: Fri, 5 Jan 2024 14:13:23 +0000 Subject: [PATCH 01/11] Add devcontainer with Hugo Signed-off-by: Marc Duiker --- .devcontainer/devcontainer.json | 31 +++++++++++++++++++++++++++++++ .gitattributes | 3 +++ 2 files changed, 34 insertions(+) create mode 100644 .devcontainer/devcontainer.json create mode 100644 .gitattributes diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 00000000000..f9cacc301c4 --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,31 @@ +// For format details, see https://aka.ms/devcontainer.json. For config options, see the +// README at: https://github.com/devcontainers/templates/tree/main/src/ubuntu +{ + "name": "Ubuntu", + // Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile + "image": "mcr.microsoft.com/devcontainers/base:jammy", + "features": { + "ghcr.io/devcontainers/features/go:1": { + "version": "latest" + }, + "ghcr.io/devcontainers/features/hugo:1": { + "extended": true, + "version": "latest" + } + }, + "customizations": { + "vscode": { + "extensions": [ + "streetsidesoftware.code-spell-checker", + "tamasfe.even-better-toml", + "davidanson.vscode-markdownlint", + "budparr.language-hugo-vscode" + ], + "settings": { + "git.alwaysSignOff": true + } + } + }, + "forwardPorts": [1313], + "postAttachCommand": "git config --global --add safe.directory '*'" +} diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 00000000000..5dc46e6b38b --- /dev/null +++ b/.gitattributes @@ -0,0 +1,3 @@ +* text=auto eol=lf +*.{cmd,[cC][mM][dD]} text eol=crlf +*.{bat,[bB][aA][tT]} text eol=crlf \ No newline at end of file From ad0eedb4291aa298b9e5326af81b29b58271f130 Mon Sep 17 00:00:00 2001 From: Marc Duiker Date: Fri, 5 Jan 2024 14:44:40 +0000 Subject: [PATCH 02/11] Add Node and install script Signed-off-by: Marc Duiker --- .devcontainer/devcontainer.json | 7 ++++++- scripts/init-container.sh | 4 ++++ 2 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 scripts/init-container.sh diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index f9cacc301c4..9c2c295f023 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -11,6 +11,11 @@ "ghcr.io/devcontainers/features/hugo:1": { "extended": true, "version": "latest" + }, + "ghcr.io/devcontainers/features/node:1": { + "nodeGypDependencies": true, + "version": "lts", + "nvmVersion": "latest" } }, "customizations": { @@ -27,5 +32,5 @@ } }, "forwardPorts": [1313], - "postAttachCommand": "git config --global --add safe.directory '*'" + "postAttachCommand": "bash scripts/init-container.sh" } diff --git a/scripts/init-container.sh b/scripts/init-container.sh new file mode 100644 index 00000000000..61f6a8dccc3 --- /dev/null +++ b/scripts/init-container.sh @@ -0,0 +1,4 @@ +git config --global --add safe.directory '*' +cd ./daprdocs +git submodule update --init --recursive +npm install From f77ab844915bab87544234768df6c44f97bc721b Mon Sep 17 00:00:00 2001 From: Marc Duiker Date: Fri, 5 Jan 2024 15:44:53 +0000 Subject: [PATCH 03/11] Update README with devcontainer Signed-off-by: Marc Duiker --- README.md | 42 ++++++++++++++++++++++++++++++++---------- 1 file changed, 32 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index a189c74f09e..39d36e4ef94 100644 --- a/README.md +++ b/README.md @@ -29,20 +29,43 @@ The Dapr docs are built using [Hugo](https://gohugo.io/) with the [Docsy](https: The [daprdocs](./daprdocs) directory contains the hugo project, markdown files, and theme configurations. -## Pre-requisites +## Setup with a devcontainer -- [Hugo extended version](https://gohugo.io/getting-started/installing) -- [Node.js](https://nodejs.org/en/) +This repository comes with a [devcontainer](/.devcontainer/devcontainer.json) configuration that will automatically install all the required dependencies and tools to build and run the docs. -## Environment setup +This devcontainer can be used to develop locally with VSCode or via GitHub Codespaces completely in the browser. -1. Ensure pre-requisites are installed -2. Clone this repository +### Pre-requisites + +- [Docker Desktop](https://www.docker.com/products/docker-desktop) +- [VSCode](https://code.visualstudio.com/download) + +### Environment setup + +1. [Fork](https://github.com/dapr/docs/fork) and clone this repository. + +2. Open the forked repository in VS Code ```sh -git clone https://github.com/dapr/docs.git +code . ``` +3. When prompted, click "Reopen in Container" to open the repository in the devcontainer. + +Continue with the [Run local server](#run-local-server) steps. + +## Setup without a devcontainer + +### Pre-requisites + +- [Hugo extended version](https://gohugo.io/getting-started/installing) +- [Node.js](https://nodejs.org/en/) + +### Environment setup + +1. Ensure pre-requisites are installed +2. [Fork](https://github.com/dapr/docs/fork) and clone this repository. + 3. Change to daprdocs directory: ```sh @@ -63,7 +86,7 @@ npm install ## Run local server -1. Make sure you're still in the `daprdocs` directory +1. Make sure you're in the `daprdocs` directory 2. Run ```sh @@ -72,10 +95,9 @@ hugo server 3. Navigate to `http://localhost:1313/` - ## Update docs -1. Fork repo into your account +1. Ensure you are in your forked repo 1. Create new branch 1. Commit and push changes to forked branch 1. Submit pull request from downstream branch to the upstream branch for the correct version you are targeting From fab4e41ab76e3df8d9fee649aa5b2622630ffe6c Mon Sep 17 00:00:00 2001 From: Marc Duiker Date: Fri, 5 Jan 2024 16:11:44 +0000 Subject: [PATCH 04/11] Add . Signed-off-by: Marc Duiker --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 39d36e4ef94..907ddbabdc3 100644 --- a/README.md +++ b/README.md @@ -63,7 +63,7 @@ Continue with the [Run local server](#run-local-server) steps. ### Environment setup -1. Ensure pre-requisites are installed +1. Ensure pre-requisites are installed. 2. [Fork](https://github.com/dapr/docs/fork) and clone this repository. 3. Change to daprdocs directory: From 5940bb207fea376afb75c9619de3b6799692ceca Mon Sep 17 00:00:00 2001 From: Marc Duiker Date: Sat, 6 Jan 2024 12:02:14 +0100 Subject: [PATCH 05/11] Update README.md Co-authored-by: Mark Fussell Signed-off-by: Marc Duiker --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 907ddbabdc3..cecf5b20be2 100644 --- a/README.md +++ b/README.md @@ -31,7 +31,7 @@ The [daprdocs](./daprdocs) directory contains the hugo project, markdown files, ## Setup with a devcontainer -This repository comes with a [devcontainer](/.devcontainer/devcontainer.json) configuration that will automatically install all the required dependencies and tools to build and run the docs. +This repository comes with a [devcontainer](/.devcontainer/devcontainer.json) configuration that automatically installs all the required dependencies and tools to build and run the docs. This devcontainer can be used to develop locally with VSCode or via GitHub Codespaces completely in the browser. From 9d74c3dc0f81abfec58519bff9ba7ebb5e9dc517 Mon Sep 17 00:00:00 2001 From: Marc Duiker Date: Sat, 6 Jan 2024 12:04:26 +0100 Subject: [PATCH 06/11] Increment step numbers Signed-off-by: Marc Duiker --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index cecf5b20be2..26295d621a7 100644 --- a/README.md +++ b/README.md @@ -98,10 +98,10 @@ hugo server ## Update docs 1. Ensure you are in your forked repo -1. Create new branch -1. Commit and push changes to forked branch -1. Submit pull request from downstream branch to the upstream branch for the correct version you are targeting -1. Staging site will automatically get created and linked to PR to review and test +2. Create new branch +3. Commit and push changes to forked branch +4. Submit pull request from downstream branch to the upstream branch for the correct version you are targeting +5. Staging site will automatically get created and linked to PR to review and test ## Code of Conduct From 1da4f30c11ff134e163603e1a583470e8bdeed0f Mon Sep 17 00:00:00 2001 From: Marc Duiker Date: Wed, 10 Jan 2024 11:01:17 +0100 Subject: [PATCH 07/11] Clarify devcontainer in other IDEs Signed-off-by: Marc Duiker --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 26295d621a7..789d6c0bb5f 100644 --- a/README.md +++ b/README.md @@ -31,9 +31,9 @@ The [daprdocs](./daprdocs) directory contains the hugo project, markdown files, ## Setup with a devcontainer -This repository comes with a [devcontainer](/.devcontainer/devcontainer.json) configuration that automatically installs all the required dependencies and tools to build and run the docs. +This repository comes with a [devcontainer](/.devcontainer/devcontainer.json) configuration that automatically installs all the required dependencies and VSCode extensions to build and run the docs. -This devcontainer can be used to develop locally with VSCode or via GitHub Codespaces completely in the browser. +This devcontainer can be used to develop locally with VSCode or via GitHub Codespaces completely in the browser. Other IDEs that support [devcontainers](https://containers.dev/) can be used but won't have the extensions preconfigured and will likely have different performance characteristics. ### Pre-requisites From daa647d69f0801b2041084b564b273983cbdd5d4 Mon Sep 17 00:00:00 2001 From: Marc Duiker Date: Wed, 10 Jan 2024 18:51:02 +0100 Subject: [PATCH 08/11] revert back to old numbering Co-authored-by: Hannah Hunter <94493363+hhunter-ms@users.noreply.github.com> Signed-off-by: Marc Duiker --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 789d6c0bb5f..2c574f28b18 100644 --- a/README.md +++ b/README.md @@ -44,7 +44,7 @@ This devcontainer can be used to develop locally with VSCode or via GitHub Codes 1. [Fork](https://github.com/dapr/docs/fork) and clone this repository. -2. Open the forked repository in VS Code +1. Open the forked repository in VS Code ```sh code . From 125556f343f71c0b476b5972500b399c66c4551f Mon Sep 17 00:00:00 2001 From: Marc Duiker Date: Wed, 10 Jan 2024 18:51:13 +0100 Subject: [PATCH 09/11] revert back to old numbering Co-authored-by: Hannah Hunter <94493363+hhunter-ms@users.noreply.github.com> Signed-off-by: Marc Duiker --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 2c574f28b18..01247b79478 100644 --- a/README.md +++ b/README.md @@ -50,7 +50,7 @@ This devcontainer can be used to develop locally with VSCode or via GitHub Codes code . ``` -3. When prompted, click "Reopen in Container" to open the repository in the devcontainer. +1. When prompted, click "Reopen in Container" to open the repository in the devcontainer. Continue with the [Run local server](#run-local-server) steps. From 5dcaeb04dfcc2a4a179dc5a15af683580794fe4a Mon Sep 17 00:00:00 2001 From: Marc Duiker Date: Wed, 10 Jan 2024 18:51:24 +0100 Subject: [PATCH 10/11] revert back to old numbering Co-authored-by: Hannah Hunter <94493363+hhunter-ms@users.noreply.github.com> Signed-off-by: Marc Duiker --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 01247b79478..446b5fe1aa7 100644 --- a/README.md +++ b/README.md @@ -64,7 +64,7 @@ Continue with the [Run local server](#run-local-server) steps. ### Environment setup 1. Ensure pre-requisites are installed. -2. [Fork](https://github.com/dapr/docs/fork) and clone this repository. +1. [Fork](https://github.com/dapr/docs/fork) and clone this repository. 3. Change to daprdocs directory: From 97901ca030da195ed490604d9d7d66478c5d5743 Mon Sep 17 00:00:00 2001 From: Marc Duiker Date: Wed, 10 Jan 2024 18:51:42 +0100 Subject: [PATCH 11/11] revert back to old numbering Co-authored-by: Hannah Hunter <94493363+hhunter-ms@users.noreply.github.com> Signed-off-by: Marc Duiker --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 446b5fe1aa7..98bc0a4c4ff 100644 --- a/README.md +++ b/README.md @@ -66,7 +66,7 @@ Continue with the [Run local server](#run-local-server) steps. 1. Ensure pre-requisites are installed. 1. [Fork](https://github.com/dapr/docs/fork) and clone this repository. -3. Change to daprdocs directory: +1. Change to daprdocs directory: ```sh cd ./daprdocs