_content/blog: mark Go code blocks as Go
Label every Go code block in the blog with the "go" language,
in preparation for client-side coloring of Go comments and
string literals, which will key on these labels:
- Indented code blocks containing Go are converted to fenced
```go blocks (or ~~~go within {{raw `...`}} template strings,
where a backquote would end the string).
- Fences labeled "Go" are changed to "go", for consistency and
so that a case-sensitive class selector (language-go) matches.
- Raw <pre> elements containing Go (in gofix.md and inliner.md)
get lang=go.
Blocks were classified using go/scanner-based heuristics
(snippets are often fragments, so go/parser was unsuitable),
then reviewed by hand. Shell sessions, tool output, C code,
protobuf, JSON, and the math notation of type-inference.md
are left unlabeled.
turkey-doodle.md's <pre> is deliberately left unlabeled,
since it contains hyperlinks that a token colorizer that
replaces the element's content would discard.
The rendered HTML of every affected post is unchanged apart
from the added class/lang attributes.
Change-Id: I3696d88c55ba80205417dcfbff554d2153486612
Reviewed-on: https://go-review.googlesource.com/c/website/+/842285
LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Austin Clements <austin@google.com>
This repo holds content and serving programs for the go.dev and golang.org web sites.
Content is in _content/ (go.dev) and tour/ (go.dev/tour). Server code is in cmd/ and internal/.
To run the combined go.dev+golang.org server to preview local content changes, use:
go run ./cmd/golangorg
The supporting programs cmd/admingolangorg and cmd/googlegolangorg are the servers for admin.golang.org and google.golang.org. (They do not use the _content/ directories.)
Each command directory has its own README.md explaining deployment.
This repository uses eslint to format JS and TS files, and stylelint to format CSS files.
See also:
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.
./npm install./npx eslint [options] [file] [dir]
./npx stylelint [input] [options]
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">
Write unit tests for TypeScript code using the jest testing framework.
./npx jest [TestPathPattern]
Each time a CL is reviewed and submitted, the code is deployed to App Engine. See cmd/golangorg/README.md for details.
This repository uses Gerrit for code changes. To learn how to submit changes to this repository, see https://go.dev/doc/contribute.
The git repository is https://go.googlesource.com/website.
The main issue tracker for the website repository is located at https://go.dev/issues. Prefix your issue with “x/website:” in the subject line, so it is easy to find.