From be544e8e6a78360d87315ada9695cc6d70c3617c Mon Sep 17 00:00:00 2001 From: guillep2k <18600385+guillep2k@users.noreply.github.com> Date: Wed, 4 Mar 2020 21:37:19 -0300 Subject: [PATCH] Versions (#10597) Signed-off-by: jolheiser --- docs/config.yaml | 2 ++ docs/content/doc/advanced/hacking-on-gitea.en-us.md | 11 +++-------- docs/content/doc/installation/from-source.en-us.md | 6 +++--- docs/content/doc/installation/from-source.zh-cn.md | 2 +- docs/layouts/shortcodes/go-version.html | 1 + docs/layouts/shortcodes/min-go-version.html | 1 + 6 files changed, 11 insertions(+), 12 deletions(-) create mode 100644 docs/layouts/shortcodes/go-version.html create mode 100644 docs/layouts/shortcodes/min-go-version.html diff --git a/docs/config.yaml b/docs/config.yaml index 5f0de324cf61..18433696d3d3 100644 --- a/docs/config.yaml +++ b/docs/config.yaml @@ -19,6 +19,8 @@ params: author: The Gitea Authors website: https://docs.gitea.io version: 1.11.0 + minGoVersion: 1.11 + goVersion: 1.13 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 9c865ebf1118..1e792d39c117 100644 --- a/docs/content/doc/advanced/hacking-on-gitea.en-us.md +++ b/docs/content/doc/advanced/hacking-on-gitea.en-us.md @@ -36,17 +36,12 @@ necessary. To be able to use these you must have the `"$GOPATH"/bin` directory on the executable path. If you don't add the go bin directory to the executable path you will have to manage this yourself. -**Note 2**: Go version 1.11 or higher is required; however, it is important +**Note 2**: Go version {{< min-go-version >}} or higher is required; however, it is important to note that our continuous integration will check that the formatting of the source code is not changed by `gofmt` using `make fmt-check`. Unfortunately, the results of `gofmt` can differ by the version of `go`. It is therefore -recommended to install the version of go that our continuous integration is -running. At the time of writing this is Go version 1.12; however, this can be -checked by looking at the -[master `.drone.yml`](https://github.com/go-gitea/gitea/blob/master/.drone.yml) -(At the time of writing -[line 67](https://github.com/go-gitea/gitea/blob/8917d66571a95f3da232a0c27bc1300210d10fde/.drone.yml#L67) -is the relevant line - but this may change.) +recommended to install the version of Go that our continuous integration is +running. As of last update, it should be Go version {{< go-version >}}. ## Downloading and cloning the Gitea source code diff --git a/docs/content/doc/installation/from-source.en-us.md b/docs/content/doc/installation/from-source.en-us.md index 861d6113911e..3f767308f7a3 100644 --- a/docs/content/doc/installation/from-source.en-us.md +++ b/docs/content/doc/installation/from-source.en-us.md @@ -31,7 +31,7 @@ necessary. To be able to use these, you must have the `"$GOPATH/bin"` directory on the executable path. If you don't add the go bin directory to the executable path, you will have to manage this yourself. -**Note 2**: Go version 1.11 or higher is required. However, it is recommended to +**Note 2**: Go version {{< min-go-version >}} or higher is required. However, it is recommended to obtain the same version as our continuous integration, see the advice given in Hacking on Gitea @@ -81,7 +81,7 @@ git checkout v{{< version >}} # or git checkout pr-xyz To build from source, the following programs must be present on the system: -- `go` 1.11.0 or higher, see [here](https://golang.org/dl/) +- `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/) - `make`, see here @@ -116,7 +116,7 @@ TAGS="bindata sqlite sqlite_unlock_notify" make build The `build` target is split into two sub-targets: -- `make backend` which requires [Go 1.11](https://golang.org/dl/) or greater. +- `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. 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 b9b5be2b5f50..dc6cae151d26 100644 --- a/docs/content/doc/installation/from-source.zh-cn.md +++ b/docs/content/doc/installation/from-source.zh-cn.md @@ -46,7 +46,7 @@ git checkout v{{< version >}} 要从源代码进行编译,以下依赖程序必须事先安装好: -- `go` 1.11.0 或以上版本, 详见 [here](https://golang.org/dl/) +- `go` {{< min-go-version >}} 或以上版本, 详见 [here](https://golang.org/dl/) - `node` 10.0.0 或以上版本,并且安装 `npm`, 详见 [here](https://nodejs.org/en/download/) - `make`, 详见 这里 diff --git a/docs/layouts/shortcodes/go-version.html b/docs/layouts/shortcodes/go-version.html new file mode 100644 index 000000000000..7f846683d84f --- /dev/null +++ b/docs/layouts/shortcodes/go-version.html @@ -0,0 +1 @@ +{{ .Site.Params.goVersion }} diff --git a/docs/layouts/shortcodes/min-go-version.html b/docs/layouts/shortcodes/min-go-version.html new file mode 100644 index 000000000000..50b880d1d563 --- /dev/null +++ b/docs/layouts/shortcodes/min-go-version.html @@ -0,0 +1 @@ +{{ .Site.Params.minGoVersion }}