Update docs state (#1284)

This commit is contained in:
Sergey Vilgelm 2020-08-03 00:51:50 -05:00 committed by GitHub
parent 0d2da56da5
commit 20083f78d3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 5668 additions and 5632 deletions

View File

@ -27,3 +27,9 @@ updates:
interval: weekly
reviewers:
- "golangci/team"
- package-ecosystem: npm
directory: "/docs"
schedule:
interval: weekly
reviewers:
- "golangci/team"

11204
docs/package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -8,40 +8,40 @@
"dependencies": {
"@emotion/core": "^10.0.27",
"@emotion/styled": "^10.0.27",
"@mdx-js/mdx": "^1.5.5",
"@mdx-js/react": "^1.5.5",
"@mdx-js/mdx": "^1.6.16",
"@mdx-js/react": "^1.6.16",
"emotion-theming": "^10.0.27",
"gatsby": "^2.19.10",
"gatsby": "^2.24.23",
"gatsby-alias-imports": "^1.0.4",
"gatsby-plugin-canonical-urls": "^2.1.19",
"gatsby-plugin-catch-links": "^2.1.24",
"gatsby-plugin-emotion": "^4.1.21",
"gatsby-plugin-google-analytics": "^2.1.34",
"gatsby-plugin-manifest": "^2.2.37",
"gatsby-plugin-mdx": "^1.0.68",
"gatsby-plugin-netlify": "^2.3.2",
"gatsby-plugin-canonical-urls": "^2.3.10",
"gatsby-plugin-catch-links": "^2.3.11",
"gatsby-plugin-emotion": "^4.3.10",
"gatsby-plugin-google-analytics": "^2.3.13",
"gatsby-plugin-manifest": "^2.4.21",
"gatsby-plugin-mdx": "^1.2.30",
"gatsby-plugin-netlify": "^2.3.11",
"gatsby-plugin-netlify-cache": "^1.2.0",
"gatsby-plugin-offline": "^3.0.32",
"gatsby-plugin-react-helmet": "^3.1.16",
"gatsby-plugin-offline": "^3.2.21",
"gatsby-plugin-react-helmet": "^3.3.10",
"gatsby-plugin-react-svg": "^3.0.0",
"gatsby-plugin-robots-txt": "^1.5.0",
"gatsby-plugin-sharp": "^2.4.0",
"gatsby-plugin-sitemap": "^2.2.26",
"gatsby-remark-autolink-headers": "^2.1.23",
"gatsby-remark-copy-linked-files": "^2.1.36",
"gatsby-plugin-robots-txt": "^1.5.1",
"gatsby-plugin-sharp": "^2.6.24",
"gatsby-plugin-sitemap": "^2.4.11",
"gatsby-remark-autolink-headers": "^2.3.11",
"gatsby-remark-copy-linked-files": "^2.3.12",
"gatsby-remark-embedder": "^1.8.0",
"gatsby-remark-external-links": "0.0.4",
"gatsby-remark-images": "^3.1.42",
"gatsby-remark-images": "^3.3.23",
"gatsby-remark-mermaid": "^2.0.0",
"gatsby-remark-responsive-iframe": "^2.2.31",
"gatsby-source-filesystem": "^2.1.46",
"gatsby-transformer-remark": "^2.8.8",
"gatsby-transformer-sharp": "^2.3.13",
"gatsby-transformer-yaml": "^2.2.23",
"polished": "^3.4.2",
"prism-react-renderer": "^1.0.2",
"gatsby-remark-responsive-iframe": "^2.4.12",
"gatsby-source-filesystem": "^2.3.23",
"gatsby-transformer-remark": "^2.8.27",
"gatsby-transformer-sharp": "^2.5.12",
"gatsby-transformer-yaml": "^2.4.10",
"polished": "^3.6.5",
"prism-react-renderer": "^1.1.1",
"prop-types": "^15.7.2",
"puppeteer": "^3.0.4",
"puppeteer": "^3.3.0",
"react": "^16.12.0",
"react-dom": "^16.12.0",
"react-headroom": "^3.0.0",

View File

@ -1,2 +1,2 @@
This file stores hash of website templates to trigger Netlify rebuild when something changes, e.g. new linter is added.
88f4106ba6b5eb0ba3f7a4cfbe648ca028ba6563f387270f4e56cc26d0e473a1
95eba94ed15a1cb58c64566468096ffcfb916b6b717e64d7fe126b26d8d81411

View File

@ -9,6 +9,7 @@ import (
"fmt"
"io/ioutil"
"log"
"net/http"
"os"
"os/exec"
"path/filepath"
@ -123,18 +124,35 @@ func processDoc(path string, replacements map[string]string, madeReplacements ma
return nil
}
type latestRelease struct {
TagName string `json:"tag_name"`
}
func getLatestVersion() (string, error) {
if gitTag := os.Getenv("GIT_TAG"); gitTag != "" {
return gitTag, nil
}
out, err := exec.Command("git", "tag", "-l", "--sort=-v:refname").Output()
req, err := http.NewRequest( // nolint:noctx
http.MethodGet,
"https://api.github.com/repos/golangci/golangci-lint/releases/latest",
nil,
)
if err != nil {
return "", fmt.Errorf("failed to run git tag: %s", err)
return "", fmt.Errorf("failed to prepare a http request: %s", err)
}
lines := bytes.Split(out, []byte("\n"))
return string(lines[0]), nil
req.Header.Add("Accept", "application/vnd.github.v3+json")
resp, err := http.DefaultClient.Do(req)
if err != nil {
return "", fmt.Errorf("failed to get http response for the latest tag: %s", err)
}
defer resp.Body.Close()
body, err := ioutil.ReadAll(resp.Body)
if err != nil {
return "", fmt.Errorf("failed to read a body for the latest tag: %s", err)
}
release := latestRelease{}
err = json.Unmarshal(body, &release)
if err != nil {
return "", fmt.Errorf("failed to unmarshal the body for the latest tag: %s", err)
}
return release.TagName, nil
}
func buildTemplateContext() (map[string]string, error) {