From f5a20250ae65c422a8f5de3415f484bca087abe1 Mon Sep 17 00:00:00 2001 From: John Olheiser Date: Thu, 5 Mar 2020 16:36:22 -0600 Subject: [PATCH] Add node version variable to docs (#10620) Also adjusted other version mentions so go version is always mentioned as major.minor and node only as major. Co-authored-by: silverwind --- Makefile | 4 ++-- README.md | 2 +- docs/config.yaml | 1 + docs/content/doc/advanced/hacking-on-gitea.en-us.md | 2 +- docs/content/doc/installation/from-source.en-us.md | 6 +++--- docs/content/doc/installation/from-source.zh-cn.md | 2 +- docs/layouts/shortcodes/min-node-version.html | 1 + 7 files changed, 10 insertions(+), 8 deletions(-) create mode 100644 docs/layouts/shortcodes/min-node-version.html diff --git a/Makefile b/Makefile index 13626be50df..7c529e79beb 100644 --- a/Makefile +++ b/Makefile @@ -145,7 +145,7 @@ help: go-check: $(eval GO_VERSION := $(shell printf "%03d%03d%03d" $(shell go version | grep -Eo '[0-9]+\.?[0-9]+?\.?[0-9]?[[:space:]]' | tr '.' ' ');)) @if [ "$(GO_VERSION)" -lt "001011000" ]; then \ - echo "Gitea requires Go 1.11.0 or greater to build. You can get it at https://golang.org/dl/"; \ + echo "Gitea requires Go 1.11 or greater to build. You can get it at https://golang.org/dl/"; \ exit 1; \ fi @@ -161,7 +161,7 @@ node-check: $(eval NODE_VERSION := $(shell printf "%03d%03d%03d" $(shell node -v | grep -Eo '[0-9]+\.?[0-9]+?\.?[0-9]?' | tr '.' ' ');)) $(eval NPM_MISSING := $(shell hash npm > /dev/null 2>&1 || echo 1)) @if [ "$(NODE_VERSION)" -lt "010000000" -o "$(NPM_MISSING)" = "1" ]; then \ - echo "Gitea requires Node.js 10.0.0 or greater and npm to build. You can get it at https://nodejs.org/en/download/"; \ + echo "Gitea requires Node.js 10 or greater and npm to build. You can get it at https://nodejs.org/en/download/"; \ exit 1; \ fi diff --git a/README.md b/README.md index 3a9e6f0ed60..7ce5de3a23c 100644 --- a/README.md +++ b/README.md @@ -40,7 +40,7 @@ or if sqlite support is required: The `build` target is split into two sub-targets: - `make backend` which requires [Go 1.11](https://golang.org/dl/) or greater. -- `make frontend` which requires [Node.js 10.0.0](https://nodejs.org/en/download/) or greater. +- `make frontend` which requires [Node.js 10](https://nodejs.org/en/download/) or greater. If pre-built frontend files are present it is possible to only build the backend: diff --git a/docs/config.yaml b/docs/config.yaml index 18433696d3d..a50e23fa172 100644 --- a/docs/config.yaml +++ b/docs/config.yaml @@ -21,6 +21,7 @@ params: version: 1.11.0 minGoVersion: 1.11 goVersion: 1.13 + minNodeVersion: 10 outputs: home: diff --git a/docs/content/doc/advanced/hacking-on-gitea.en-us.md b/docs/content/doc/advanced/hacking-on-gitea.en-us.md index 1e792d39c11..902bf8473f0 100644 --- a/docs/content/doc/advanced/hacking-on-gitea.en-us.md +++ b/docs/content/doc/advanced/hacking-on-gitea.en-us.md @@ -25,7 +25,7 @@ environment variable and to add the go bin directory or directories Next, [install Node.js with npm](https://nodejs.org/en/download/) which is required to build the JavaScript and CSS files. The minimum supported Node.js -version is 10 and the latest LTS version is recommended. +version is {{< min-node-version >}} and the latest LTS version is recommended. You will also need make. (See here how to get Make) diff --git a/docs/content/doc/installation/from-source.en-us.md b/docs/content/doc/installation/from-source.en-us.md index 3f767308f7a..2089a5df391 100644 --- a/docs/content/doc/installation/from-source.en-us.md +++ b/docs/content/doc/installation/from-source.en-us.md @@ -23,7 +23,7 @@ environment variable and to add the go bin directory or directories Next, [install Node.js with npm](https://nodejs.org/en/download/) which is required to build the JavaScript and CSS files. The minimum supported Node.js -version is 10 and the latest LTS version is recommended. +version is {{< min-node-version >}} and the latest LTS version is recommended. **Note**: When executing make tasks that require external tools, like `make misspell-check`, Gitea will automatically download and build these as @@ -82,7 +82,7 @@ git checkout v{{< version >}} # or git checkout pr-xyz To build from source, the following programs must be present on the system: - `go` {{< min-go-version >}} or higher, see [here](https://golang.org/dl/) -- `node` 10.0.0 or higher with `npm`, see [here](https://nodejs.org/en/download/) +- `node` {{< min-node-version >}} or higher with `npm`, see [here](https://nodejs.org/en/download/) - `make`, see here Various [make tasks](https://github.com/go-gitea/gitea/blob/master/Makefile) @@ -117,7 +117,7 @@ TAGS="bindata sqlite sqlite_unlock_notify" make build The `build` target is split into two sub-targets: - `make backend` which requires [Go {{< min-go-version >}}](https://golang.org/dl/) or greater. -- `make frontend` which requires [Node.js 10.0.0](https://nodejs.org/en/download/) or greater. +- `make frontend` which requires [Node.js {{< min-node-version >}}](https://nodejs.org/en/download/) or greater. If pre-built frontend files are present it is possible to only build the backend: diff --git a/docs/content/doc/installation/from-source.zh-cn.md b/docs/content/doc/installation/from-source.zh-cn.md index dc6cae151d2..cbae5218a36 100644 --- a/docs/content/doc/installation/from-source.zh-cn.md +++ b/docs/content/doc/installation/from-source.zh-cn.md @@ -47,7 +47,7 @@ git checkout v{{< version >}} 要从源代码进行编译,以下依赖程序必须事先安装好: - `go` {{< min-go-version >}} 或以上版本, 详见 [here](https://golang.org/dl/) -- `node` 10.0.0 或以上版本,并且安装 `npm`, 详见 [here](https://nodejs.org/en/download/) +- `node` {{< min-node-version >}} 或以上版本,并且安装 `npm`, 详见 [here](https://nodejs.org/en/download/) - `make`, 详见 这里 各种可用的 [make 任务](https://github.com/go-gitea/gitea/blob/master/Makefile) diff --git a/docs/layouts/shortcodes/min-node-version.html b/docs/layouts/shortcodes/min-node-version.html new file mode 100644 index 00000000000..7885f4ea19d --- /dev/null +++ b/docs/layouts/shortcodes/min-node-version.html @@ -0,0 +1 @@ +{{ .Site.Params.minNodeVersion }}