website

package module
Version: v0.0.0-...-05f0660 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 28, 2022 License: BSD-3-Clause Imports: 2 Imported by: 0

README

Go website

Go Reference

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.

JS/TS/CSS Formatting

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.

Installing npm Dependencies:
  1. Install 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">

Write unit tests for TypeScript code using the jest testing framework.

Run Jest
./npx jest [TestPathPattern]

Deploying

Each time a CL is reviewed and submitted, the code is deployed to App Engine. See cmd/golangorg/README.md for details.

Report Issues / Send Patches

This repository uses Gerrit for code changes. To learn how to submit changes to this repository, see https://go.dev/doc/contribute.

The main issue tracker for the website repository is located at https://github.com/golang/go/issues. Prefix your issue with "x/website:" in the subject line, so it is easy to find.

Documentation

Overview

Package website exports the static content as an embed.FS.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Content

func Content() fs.FS

Content returns the go.dev website's static content.

func TourOnly

func TourOnly() fs.FS

TourOnly returns the content needed only for the standalone tour.

Types

This section is empty.

Source Files

Directories

Path Synopsis
_content
blog/appengine
This server can run on App Engine.
This server can run on App Engine.
blog/h2push/server
The server command demonstrates a server with HTTP/2 Server Push support.
The server command demonstrates a server with HTTP/2 Server Push support.
doc/codewalk
Generating random text: a Markov chain algorithm
Generating random text: a Markov chain algorithm
doc/play
You can edit this code! Click here and start typing.
You can edit this code! Click here and start typing.
talks/2014/go4java/runner
Package runner provides a Runner type that is used to define both RunCounter and EmbeddedRunCounter to show examples of how to use composition in Go.
Package runner provides a Runner type that is used to define both RunCounter and EmbeddedRunCounter to show examples of how to use composition in Go.
blog module
cmd
admingolangorg
The admingolangorg command serves an administrative interface for owners of the golang-org Google Cloud project.
The admingolangorg command serves an administrative interface for owners of the golang-org Google Cloud project.
golangorg
Golangorg serves the golang.org web sites.
Golangorg serves the golang.org web sites.
googlegolangorg
A trivial redirector for google.golang.org.
A trivial redirector for google.golang.org.
locktrigger
Locktrigger “locks” a given build trigger, making sure that the currently running build is the only trigger running.
Locktrigger “locks” a given build trigger, making sure that the currently running build is the only trigger running.
screentest
Command screentest runs the screentest check for a set of scripts.
Command screentest runs the screentest check for a set of scripts.
versionprune
Versionprune prunes stale AppEngine versions for a specified service.
Versionprune prunes stale AppEngine versions for a specified service.
go.dev module
internal
api
backport/fmtsort
Package fmtsort provides a general stable ordering mechanism for maps, on behalf of the fmt and text/template packages.
Package fmtsort provides a general stable ordering mechanism for maps, on behalf of the fmt and text/template packages.
backport/go/ast
Package ast declares the types used to represent syntax trees for Go packages.
Package ast declares the types used to represent syntax trees for Go packages.
backport/go/build
Package build gathers information about Go packages.
Package build gathers information about Go packages.
backport/go/doc
Package doc extracts source code documentation from a Go AST.
Package doc extracts source code documentation from a Go AST.
backport/go/doc/comment
Package comment implements parsing and reformatting of Go doc comments, (documentation comments), which are comments that immediately precede a top-level declaration of a package, const, func, type, or var.
Package comment implements parsing and reformatting of Go doc comments, (documentation comments), which are comments that immediately precede a top-level declaration of a package, const, func, type, or var.
backport/go/format
Package format implements standard formatting of Go source.
Package format implements standard formatting of Go source.
backport/go/internal/typeparams
Package typeparams provides functions to work with type parameter data stored in the AST, while these AST changes are guarded by a build constraint.
Package typeparams provides functions to work with type parameter data stored in the AST, while these AST changes are guarded by a build constraint.
backport/go/parser
Package parser implements a parser for Go source files.
Package parser implements a parser for Go source files.
backport/go/printer
Package printer implements printing of AST nodes.
Package printer implements printing of AST nodes.
backport/go/scanner
Package scanner implements a scanner for Go source text.
Package scanner implements a scanner for Go source text.
backport/go/token
Package token defines constants representing the lexical tokens of the Go programming language and basic operations on tokens (printing, predicates).
Package token defines constants representing the lexical tokens of the Go programming language and basic operations on tokens (printing, predicates).
backport/html/template
Package template (html/template) implements data-driven templates for generating HTML output safe against code injection.
Package template (html/template) implements data-driven templates for generating HTML output safe against code injection.
backport/text/template
Package template implements data-driven templates for generating textual output.
Package template implements data-driven templates for generating textual output.
backport/text/template/parse
Package parse builds parse trees for templates as defined by text/template and html/template.
Package parse builds parse trees for templates as defined by text/template and html/template.
blog/atom
Package atom defines XML data structures for an Atom feed.
Package atom defines XML data structures for an Atom feed.
codewalk
Package codewalk implements support for codewalk documents.
Package codewalk implements support for codewalk documents.
dl
Package dl implements a simple Go downloads frontend server.
Package dl implements a simple Go downloads frontend server.
env
Package env provides environment information for the golangorg server running on golang.org.
Package env provides environment information for the golangorg server running on golang.org.
gitfs
Package gitfs presents a file tree downloaded from a remote Git repo as an in-memory fs.FS.
Package gitfs presents a file tree downloaded from a remote Git repo as an in-memory fs.FS.
history
Package history holds the Go project release history.
Package history holds the Go project release history.
memcache
Package memcache provides a minimally compatible interface for google.golang.org/appengine/memcache and stores the data in Redis (e.g., via Cloud Memorystore).
Package memcache provides a minimally compatible interface for google.golang.org/appengine/memcache and stores the data in Redis (e.g., via Cloud Memorystore).
pkgdoc
Package pkgdoc serves package documentation.
Package pkgdoc serves package documentation.
redirect
Package redirect provides hooks to register HTTP handlers that redirect old godoc paths to their new equivalents and assist in accessing the issue tracker, wiki, code review system, etc.
Package redirect provides hooks to register HTTP handlers that redirect old godoc paths to their new equivalents and assist in accessing the issue tracker, wiki, code review system, etc.
screentest
Package screentest implements script-based visual diff testing for webpages.
Package screentest implements script-based visual diff testing for webpages.
short
Package short implements a simple URL shortener, serving shortened urls from /s/key.
Package short implements a simple URL shortener, serving shortened urls from /s/key.
spec
Package spec implements hyperlinking of the Go language specification.
Package spec implements hyperlinking of the Go language specification.
texthtml
Package texthtml formats text files to HTML.
Package texthtml formats text files to HTML.
tmplfunc
Package tmplfunc provides an extension of Go templates in which templates can be invoked as if they were functions.
Package tmplfunc provides an extension of Go templates in which templates can be invoked as if they were functions.
web
Package web implements a basic web site serving framework.
Package web implements a basic web site serving framework.
webtest
Package webtest implements script-based testing for web servers.
Package webtest implements script-based testing for web servers.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL