2020-08-27 23:34:57 +03:00
|
|
|
# Go website
|
2019-01-04 17:06:45 +03:00
|
|
|
|
2020-12-04 01:43:40 +03:00
|
|
|
[![Go Reference](https://pkg.go.dev/badge/golang.org/x/website.svg)](https://pkg.go.dev/golang.org/x/website)
|
|
|
|
|
2021-12-02 22:15:39 +03:00
|
|
|
This repo holds content and serving programs for the go.dev and golang.org web sites.
|
2019-01-04 17:06:45 +03:00
|
|
|
|
2022-01-07 22:26:13 +03:00
|
|
|
Content is in \_content/ (go.dev) and tour/ (go.dev/tour).
|
2021-08-03 07:54:24 +03:00
|
|
|
Server code is in cmd/ and internal/.
|
2019-01-04 17:06:45 +03:00
|
|
|
|
2021-12-02 22:15:39 +03:00
|
|
|
To run the combined go.dev+golang.org server to preview local content changes, use:
|
2020-08-27 23:34:57 +03:00
|
|
|
|
2022-01-07 22:26:13 +03:00
|
|
|
go run ./cmd/golangorg
|
2020-08-27 23:34:57 +03:00
|
|
|
|
2021-02-12 22:32:52 +03:00
|
|
|
The supporting programs cmd/admingolangorg and cmd/googlegolangorg
|
|
|
|
are the servers for admin.golang.org and google.golang.org.
|
2022-01-07 22:26:13 +03:00
|
|
|
(They do not use the \_content/ directories.)
|
2020-08-27 23:34:57 +03:00
|
|
|
|
2021-02-12 22:32:52 +03:00
|
|
|
Each command directory has its own README.md explaining deployment.
|
2019-01-04 17:06:45 +03:00
|
|
|
|
2022-01-07 22:26:13 +03:00
|
|
|
## JS/TS/CSS Formatting
|
2019-06-26 12:03:53 +03:00
|
|
|
|
2022-01-07 22:26:13 +03:00
|
|
|
This repository uses [eslint](https://eslint.org/) to format JS and TS files,
|
|
|
|
and [stylelint](https://stylelint.io/) to format CSS files.
|
2019-06-26 12:03:53 +03:00
|
|
|
|
2021-11-18 06:51:08 +03:00
|
|
|
See also:
|
|
|
|
|
2021-12-02 22:15:39 +03:00
|
|
|
- [CSS](https://go.dev/wiki/CSSStyleGuide)
|
2021-11-18 06:51:08 +03:00
|
|
|
- [JavaScript](https://google.github.io/styleguide/jsguide.html)
|
2022-01-07 22:26:13 +03:00
|
|
|
- [TypeScript](https://google.github.io/styleguide/tsguide.html)
|
2021-11-18 06:51:08 +03:00
|
|
|
|
2022-01-07 22:26:13 +03:00
|
|
|
It is encouraged that all JS, TS, and CSS code be run through formatters before
|
|
|
|
submitting a change. However, it is not a strict requirement enforced by CI.
|
2019-06-26 12:03:53 +03:00
|
|
|
|
2022-01-07 22:26:13 +03:00
|
|
|
### Installing npm Dependencies:
|
|
|
|
|
|
|
|
1. Install [docker](https://docs.docker.com/get-docker/)
|
|
|
|
2. Create a .gitignore file at repo root
|
|
|
|
3. Add .gitignore and node_modules to .gitignore
|
|
|
|
4. Run `./npm install`
|
|
|
|
|
|
|
|
### Run ESlint
|
|
|
|
|
|
|
|
./npx eslint [options] [file] [dir]
|
|
|
|
|
|
|
|
### Run Stylelint
|
|
|
|
|
|
|
|
./npx stylelint [input] [options]
|
|
|
|
|
|
|
|
## TypeScript Support
|
|
|
|
|
|
|
|
TypeScript files served from _content are transformed into JavaScript.
|
|
|
|
Reference .ts files in html templates as module code.
|
|
|
|
|
|
|
|
`<script type="module" src="/ts/filename.ts">`
|
2019-06-26 12:03:53 +03:00
|
|
|
|
2022-01-11 20:56:41 +03:00
|
|
|
Write unit tests for TypeScript code using the [jest](https://jestjs.io/)
|
|
|
|
testing framework.
|
|
|
|
|
|
|
|
### Run Jest
|
|
|
|
|
|
|
|
./npx jest [TestPathPattern]
|
|
|
|
|
2021-11-18 06:51:08 +03:00
|
|
|
## Deploying
|
|
|
|
|
2021-12-02 22:15:39 +03:00
|
|
|
Each time a CL is reviewed and submitted, the code is deployed to App Engine.
|
|
|
|
See [cmd/golangorg/README.md](cmd/golangorg/README.md#deploying-to-go_dev-and-golang_org) for details.
|
2021-11-18 06:51:08 +03:00
|
|
|
|
2019-01-04 17:06:45 +03:00
|
|
|
## Report Issues / Send Patches
|
|
|
|
|
|
|
|
This repository uses Gerrit for code changes. To learn how to submit changes to
|
2021-12-02 22:15:39 +03:00
|
|
|
this repository, see https://go.dev/doc/contribute.
|
2019-01-04 17:06:45 +03:00
|
|
|
|
2024-11-05 22:38:17 +03:00
|
|
|
The git repository is https://go.googlesource.com/website.
|
|
|
|
|
2019-02-27 03:15:19 +03:00
|
|
|
The main issue tracker for the website repository is located at
|
2024-11-05 22:38:17 +03:00
|
|
|
https://go.dev/issues. Prefix your issue with "x/website:" in the
|
2019-01-04 17:06:45 +03:00
|
|
|
subject line, so it is easy to find.
|