Граф коммитов

296 Коммитов

Автор SHA1 Сообщение Дата
David Chase 9478f6c83f internal/history: document Go 1.16.5 and Go 1.15.13
Second security+dot release, another custom summary.

Change-Id: Ic36179259896f06cdbe7958f8d45628dc41f2ac3
Reviewed-on: https://go-review.googlesource.com/c/website/+/324772
Trust: David Chase <drchase@google.com>
Run-TryBot: David Chase <drchase@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Carlos Amedee <carlos@golang.org>
2021-06-03 20:40:35 +00:00
Russ Cox 1a32f50734 internal/godoc: delete Corpus
There's nothing left in Corpus but the file system and the API database.
Hoist them into Presentation and delete the Corpus itself.

Change-Id: I2cb61b77122b2f7216b0b2a96fd6b48e29eae189
Reviewed-on: https://go-review.googlesource.com/c/website/+/317651
Trust: Russ Cox <rsc@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2021-06-01 14:44:26 +00:00
Russ Cox d8909ee5a6 all: remove Path metadata-based redirects
Back when the entire site had to live in $GOROOT/doc, we needed
some way to specify content that was served from URLs outside of golang.org/doc,
so we added the ability for a doc to declare its own URL (the Path metadata).
That meant the file system layout did not match the URL layout.
That meant the content for any particular URL could be anywhere in the file system.
That meant the entire file system had to be scanned to serve a URL.
That meant an index of the file system had to be built and updated.

Now that we have a file tree (_content) for the whole of golang.org,
we can move files to make the file system layout match the URL space.
Then each URL can be served by just reading the right file.
Then the index and its updater can be deleted.

And now if you want to edit /doc/gdb it's obvious which file to open.

Change-Id: I3357f275e61a31c8de3091af580cac80753e71a4
Reviewed-on: https://go-review.googlesource.com/c/website/+/296383
Trust: Russ Cox <rsc@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2021-05-26 13:31:17 +00:00
Russ Cox 6edac51689 cmd/golangorg: remove special cases for /project/, /doc/devel/release
The special cases were simulating the normal template execution
and passing extra data (the release history).
We have a standard way to pass extra data (template functions),
so use one and delete the special case code.

Also change date format to standard yyyy-mm-dd.
The yyyy/mm/dd we have been using is kind of made up
and certainly unusual (see https://xkcd.com/1179/).

Change-Id: I59f4f67259381dd43cd53c0f6120f87d8f8c77d9
Reviewed-on: https://go-review.googlesource.com/c/website/+/296429
Trust: Russ Cox <rsc@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2021-05-18 15:19:37 +00:00
Heschi Kreinick c1bd207ca8 cmd/golangorg,internal/history: document Go 1.16.4 and Go 1.15.12
1.16.4 and 1.15.12 are our first releases containing public security
fixes. As such, the existing template doesn't work well for them, so use
a CustomSummary.

Change-Id: Ib70990425b1a2963030b1034295a20b4c105c630
Reviewed-on: https://go-review.googlesource.com/c/website/+/317609
Trust: Heschi Kreinick <heschi@google.com>
Trust: Carlos Amedee <carlos@golang.org>
Run-TryBot: Heschi Kreinick <heschi@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Carlos Amedee <carlos@golang.org>
2021-05-06 18:38:36 +00:00
yangwenmai 61aee95efe internal/dl: simplify featured macOS file regexp
The current macOS release filenames no longer include a "-osx10.8"
suffix, so the featured file regexp can made shorter and simpler.

Change-Id: Ia6a1b58e20909ba9485e02b51ee4b0297f6ff20e
Reviewed-on: https://go-review.googlesource.com/c/website/+/293589
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Trust: Cherry Zhang <cherryyz@google.com>
2021-04-30 16:32:06 +00:00
Yu, Li-Yu 1eaa20f5b9 internal/pkgdoc: fix synopsis pkg name == dir name matching
file.Name.Name should match the directory name not the filename.

In CL 296378, newDirTree's name parameter was removed and synopsis
matched against the filename of the source code, e.g. "*.go".

Fixes golang/go#45042
Fixes golang/go#45614

Change-Id: Ifa4c8a70429e277efb1f9f726de9249509cbcee0
Reviewed-on: https://go-review.googlesource.com/c/website/+/311089
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Trust: Cherry Zhang <cherryyz@google.com>
2021-04-26 16:24:13 +00:00
Sean Liao 97803416bb internal/dl: include old unstable release in archive
Updates golang/go#17574
Fixes golang/go#37581
Fixes golang/go#43975

Change-Id: I31cab4b8f8277b3c83ddde001f2649bb5f0bc9c7
Reviewed-on: https://go-review.googlesource.com/c/website/+/290310
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Trust: Carlos Amedee <carlos@golang.org>
Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
2021-04-05 21:38:05 +00:00
Carlos Amedee a49366dd89 internal/dl: remove unlikely releasers from validUser
This change removes adg, bradfitz, cbro, andybons and julieqiu from
the list of valid users. They are not expected to be releasing Go at
any point in the near future.

Change-Id: I38fd878f4c9487402ad61bab8b3d8c6437dd9763
Reviewed-on: https://go-review.googlesource.com/c/website/+/305689
Trust: Carlos Amedee <carlos@golang.org>
Run-TryBot: Carlos Amedee <carlos@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2021-04-02 18:39:17 +00:00
Dmitri Shuralyov 363b0256a3 internal/history: document Go 1.16.3 and Go 1.15.11
For golang/go#45334.
For golang/go#45333.

Change-Id: I7928cf48bad658ca7dd391b84802e0c8bb788617
Reviewed-on: https://go-review.googlesource.com/c/website/+/306670
Trust: Dmitri Shuralyov <dmitshur@golang.org>
Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: David Chase <drchase@google.com>
2021-04-01 21:26:54 +00:00
Carlos Amedee ae515ad5b7 internal/dl: add cherryyz, drchase and mknyszek to validUser
Change-Id: I22025263b8d33e236671748fad9ef46ebc4441d1
Reviewed-on: https://go-review.googlesource.com/c/website/+/305531
Trust: Carlos Amedee <carlos@golang.org>
Run-TryBot: Carlos Amedee <carlos@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2021-03-29 18:21:25 +00:00
Alberto Donizetti 5c0ab37769 internal/dl: fix links to module proxy configuration
The downloads page has a link pointing to a section about module proxy
servers in the cmd/go doc that was removed in CL 282615. Remove the
anchor.

Fixes golang/go#44780

Change-Id: Ifb7f4f991b3314a3cda6d00d77925401a8830456
Reviewed-on: https://go-review.googlesource.com/c/website/+/299129
Trust: Alberto Donizetti <alb.donizetti@gmail.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2021-03-18 09:49:56 +00:00
Russ Cox 7fe51e8c4a internal/godoc: split package docs into new package pkgdoc [generated]
Isolate package docs scanning and extraction into a new package.
Generated by script below.

[git-generate]
cd internal/godoc
rf '
	# We want to end up with each package having its own toFS,
	# but to keep each step leaving a valid package, export toFS as ToFSPath
	# so it can be used as pkgdoc.ToFSPath after the move.
	# We will rewrite the uses left behind after the move.
	mv toFS ToFSPath

	mv newDirTree newDir
	mv Directory Dir
	mv Dir.listing Dir.List
	mv Dir.lookup Dir.Lookup
	mv \
		ToFSPath \
		Dir \
		Dir.Name \
		DirList \
		DirEntry \
		DirEntry.Name \
		Dir.Lookup \
		Dir.List \
		newDir \
		isPkgFile \
		isPkgDir \
		Dir.walk \
		walkDirs \
		parseFile \
		parseFiles \
		linePrefix \
		replaceLinePrefixCommentsWithBlankLine \
		dir.go

	mv stripExampleSuffix TrimExampleSuffix
	mv splitExampleName SplitExampleName
	mv poorMansImporter simpleImporter

	mv dirtrees_test.go dir_test.go

	mv \
		DocTree \
		NewDocTree \
		PageInfo \
		PageInfo.IsEmpty \
		PageInfoMode \
		NoFiltering \
		modeNames \
		PageInfoMode.String \
		GetPageInfoMode \
		DocTree.GetPageInfo \
		DocTree.includePath \
		simpleImporter \
		packageExports \
		funcsByName \
		funcsByName.Len \
		funcsByName.Swap \
		funcsByName.Less \
		collectExamples \
		globalNames \
		addNames \
		SplitExampleName \
		TrimExampleSuffix \
		startsWithUppercase \
		doc.go

	mv \
		TestIgnoredGoFiles \
		TestIssue5247 \
		doc_test.go

	mv dir.go dir_test.go doc.go doc_test.go golang.org/x/website/internal/pkgdoc

	# Add a new toFS and rewrite the uses left behind.
	add server.go:/^\)/ \
		// toFS returns the io/fs name for path (no leading slash). \
		func toFS(name string) string { \
			if name == "/" { \
				return "." \
			} \
			return path.Clean(strings.TrimPrefix(name, "/")) \
		}

	ex {
		import "golang.org/x/website/internal/pkgdoc"
		var x string
		pkgdoc.ToFSPath(x) -> toFS(x)
	}
'
rm dirtrees.go parser.go
cd ../pkgdoc
rf '
	# Finish toFS split
	mv ToFSPath toFS

	# Clean up API for package pkgdoc
	mv PageInfo Page
	mv DocTree.GetPageInfo Doc.Page

	mv DocTree Docs
	mv NewDocTree NewDocs

	mv PageInfoMode Mode
	mv GetPageInfoMode ParseMode
	mv NoFiltering ModeAll
	mv FlatDir ModeFlat
	mv AllMethods ModeMethods
	mv ShowSource ModeSrc
	mv NoTypeAssoc ModeBuiltin
'

Change-Id: I24384f40739af286c528beb06aa153843005a870
Reviewed-on: https://go-review.googlesource.com/c/website/+/296380
Trust: Russ Cox <rsc@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2021-03-12 19:58:10 +00:00
Russ Cox a4e42960dc internal/godoc: remove pathpkg renaming
This makes various other code movement a bit nicer.

Change-Id: I89c46dcbf3019eead4922f4db301bf0ea82b697e
Reviewed-on: https://go-review.googlesource.com/c/website/+/296379
Trust: Russ Cox <rsc@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2021-03-12 19:58:08 +00:00
Russ Cox a3455e4f5b internal/godoc: simplify, isolate pkg docs tree code
- IsGOROOT is always true (the only docs we serve)
- SummarizePackage is unused
- newDirectory is only called on the root with unlimited depth
- Name is redundant with Path
- Directory.Depth is unused
- only DirEntry is assigned to dirEntryOrFileInfo
- parallel walk is only needed for huge trees (GOROOT is not)
- separate entirely from Corpus
- pull new DocTree out of handlerServer

This will let us better separate the package doc tree from HTTP service
and from the general document server.

Change-Id: Iac667a0ff624306cdd535a33dd22dcb04062b46c
Reviewed-on: https://go-review.googlesource.com/c/website/+/296378
Trust: Russ Cox <rsc@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2021-03-12 19:58:07 +00:00
Russ Cox b09c5abe08 internal/godoc: remove unused configuration
There is lots of dead flexibility in this code.
Remove it, to make the control flow and data dependencies
easier to understand.

Change-Id: Ie9aa7bc96afc64d2a07677a73f8fb311808ef307
Reviewed-on: https://go-review.googlesource.com/c/website/+/296377
Trust: Russ Cox <rsc@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2021-03-12 19:58:06 +00:00
Russ Cox f46db3cc1a internal/godoc: split out API version database [generated]
Extract API database into a standalone package.
Generated with rf script below.

[git-generate]
cd internal/godoc
rf '
	mv apiVersions DB
	mv DB.sinceVersionFunc DB.Func
	mv pkgAPIVersions PkgDB
	mv PkgDB.typeSince PkgDB.Type
	mv PkgDB.methodSince PkgDB.Method
	mv PkgDB.funcSince PkgDB.Func
	mv PkgDB.fieldSince PkgDB.Field
	mv parsePackageAPIInfo Load
	mv versionedRow row
	mv versionParser dbParser

	mv DB PkgDB \
		DB.Func \
		Load \
		dbParser \
		dbParser.parseFile \
		row \
		parseRow \
		api.go

	mv versions_test.go api_test.go

	mv api.go api_test.go golang.org/x/website/internal/api
'
cd ../api
rf '
	mv dbParser parser
'

Change-Id: I1bf57608345ae39eb217024c9c4bf1ae6543bd98
Reviewed-on: https://go-review.googlesource.com/c/website/+/296376
Trust: Russ Cox <rsc@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2021-03-12 19:58:05 +00:00
Russ Cox 4e76d9d0e0 internal/godoc: factor out example, ast support funcs
Moved with

rf '
	mv \
		Presentation.example_htmlFunc \
		replaceLeadingIndentation \
		exampleOutputRx \
		filterOutBuildAnnotations \
		Presentation.example_nameFunc \
		Presentation.example_suffixFunc \
		splitExampleName \
		stripExampleSuffix \
		startsWithUppercase \
		examplefuncs.go

	mv \
		slashSlash \
		Presentation.nodeFunc \
		Presentation.node_htmlFunc \
		Presentation.writeNode \
		firstIdent \
		comment_htmlFunc \
		sanitizeFunc \
		astfuncs.go
	rm Presentation.WriteNode

'

plus deleting the doc comments and import path comments,
which didn't move well.

Change-Id: I71b1dd58527938cafccfc901a0dadcc6dff34664
Reviewed-on: https://go-review.googlesource.com/c/website/+/296375
Trust: Russ Cox <rsc@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2021-03-12 19:58:03 +00:00
Russ Cox 28d7606f40 internal/godoc: introduce TabSpacer
Mainly just isolate it from Presentation, but give it a nice API too.

Change-Id: I9650bf650a15bfd814fe4da58de6fa133a858d90
Reviewed-on: https://go-review.googlesource.com/c/website/+/296374
Trust: Russ Cox <rsc@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2021-03-12 19:58:02 +00:00
Russ Cox d72b0a78e3 internal/godoc: split spec markup into internal/spec
Change-Id: Ife4429f4c75a50fdd1caae72db5cdb0d876e78e6
Reviewed-on: https://go-review.googlesource.com/c/website/+/295410
Trust: Russ Cox <rsc@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2021-03-12 19:58:01 +00:00
Russ Cox 4eb9b856a3 internal/godoc: split text formatting into internal/texthtml
Change-Id: Iaef43e66c32dbeb7c3fc3a4a769112d153c57ce1
Reviewed-on: https://go-review.googlesource.com/c/website/+/295409
Trust: Russ Cox <rsc@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2021-03-12 19:58:00 +00:00
Russ Cox 2d643c47ce internal/godoc/golangorgenv: delete
Now that all the references are internal
(the direct playground reference is gone),
we can use internal/env instead.

Change-Id: I10d323a5e08bee153bd921cffe79fb4eb9e8b29c
Reviewed-on: https://go-review.googlesource.com/c/website/+/293426
Trust: Russ Cox <rsc@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2021-03-12 19:57:59 +00:00
Russ Cox bcc60328ef cmd/golangorg: move googleCN code out of internal/godoc
Change-Id: I24140d73ca375cd624d852a2653c0a8bb0af9e2d
Reviewed-on: https://go-review.googlesource.com/c/website/+/293492
Trust: Russ Cox <rsc@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2021-03-12 19:57:57 +00:00
Carlos Amedee b24263deb8 internal/history: document Go 1.16.2 and Go 1.15.10
Updates golang/go#44943
Updates golang/go#44944

Change-Id: Ic8391e46d039ece835791ad0a13a5ccfa41ff7e5
Reviewed-on: https://go-review.googlesource.com/c/website/+/301009
Trust: Carlos Amedee <carlos@golang.org>
Run-TryBot: Carlos Amedee <carlos@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Jeremy Faller <jeremy@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2021-03-11 19:47:19 +00:00
Filippo Valsorda 0fbcfa0516 internal/history: document Go 1.16.1 and Go 1.15.9
Change-Id: I74784f4520661b580741ee3219a776cc17d6effd
Reviewed-on: https://go-review.googlesource.com/c/website/+/300589
Trust: Filippo Valsorda <filippo@golang.org>
Run-TryBot: Filippo Valsorda <filippo@golang.org>
Reviewed-by: Alexander Rakoczy <alex@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
2021-03-10 21:26:05 +00:00
Michael Pratt 7e301e09e5 internal/redirect: bump bigEnoughAssumeRietveld
Gerrit CL numbers now exceed 300k, so new CL numbers are landing on the
Gerrit/Rietveld disambiguation page.

Bump bigEnoughAssumeRietveld to 4M (approximately the max before we need
to handle subrepos) and update the table. Now we won't need to deal with
this again for quite a while.

Change-Id: I6ddd8cdd19012f0b58e39c2df76ff23f376c2f1b
Reviewed-on: https://go-review.googlesource.com/c/website/+/300089
Trust: Michael Pratt <mpratt@google.com>
Run-TryBot: Michael Pratt <mpratt@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
2021-03-09 18:38:05 +00:00
Dmitri Shuralyov a95e02bdd7 internal/history: document upcoming Go 1.16.1 and 1.15.9 security releases
They have been pre-announced¹.

¹ https://groups.google.com/g/golang-announce/c/UERZo89zw8o

Change-Id: Ief02b0a7ced6b69a2aef7b1b0cf288b8df7116f8
Reviewed-on: https://go-review.googlesource.com/c/website/+/299270
Trust: Dmitri Shuralyov <dmitshur@golang.org>
Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Katie Hockman <katie@golang.org>
2021-03-05 23:19:41 +00:00
Russ Cox 7118d0ea1d cmd/golangorg: clean up directory listings
The time stamps are unlikely to be useful or correct.
Today golang.org shows the release time for all files,
which has zero information content. Drop them.

Do not show size for directories - it's meaningless.

Show all directories before all files for easier navigation
and to keep package sources listed more compactly.

Change-Id: I06247988003e310aa19ecec7399b94f315e323bd
Reviewed-on: https://go-review.googlesource.com/c/website/+/293495
Trust: Russ Cox <rsc@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2021-02-24 17:36:25 +00:00
Russ Cox 6a70b35e83 internal/godoc/util: merge into internal/godoc
Only used by godoc, so just move the utility code into the main package.
Down to a single directory.

Change-Id: I1bef28ce932372d748dd062eb6597d8979a26b08
Reviewed-on: https://go-review.googlesource.com/c/website/+/293491
Trust: Russ Cox <rsc@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2021-02-24 17:36:18 +00:00
Russ Cox 9c12cfa1fe internal/godoc: remove vfs
Change-Id: I508d92508553be76e42b4066e540c146e1c9ba53
Reviewed-on: https://go-review.googlesource.com/c/website/+/293490
Trust: Russ Cox <rsc@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2021-02-24 17:36:13 +00:00
Russ Cox 6dc0141a6d cmd/golangorg, internal/godoc: switch from vfs to io/fs
Change-Id: Idf55bca5c9ee20d6612e463ad7fc59ef212171e6
Reviewed-on: https://go-review.googlesource.com/c/website/+/293489
Trust: Russ Cox <rsc@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2021-02-24 17:36:08 +00:00
Russ Cox b20f6e4e47 internal/godoc: delete RootType
We no longer use GOPATH at all, so all that matters is whether
the directory is GOROOT or not. We don't need the file system
to tell us - we can check whether a known file exists, like
src/math/abs.go.

Change-Id: I9d4efb9d0d3882a4875aa7176ce21ed24ede3f4d
Reviewed-on: https://go-review.googlesource.com/c/website/+/293428
Trust: Russ Cox <rsc@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2021-02-24 17:36:03 +00:00
Russ Cox 6fbd1cb9fd internal/godoc: delete indexing code
We no longer serve search from the golang.org site.

Change-Id: I8b855cf664f175c0dc46a91e3017df1bebb28281
Reviewed-on: https://go-review.googlesource.com/c/website/+/293427
Trust: Russ Cox <rsc@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2021-02-24 17:35:58 +00:00
Russ Cox d6a1a7b134 internal/redirect: add minor fixes from golang.org/x/tools/godoc/redirect
Change-Id: I7436b87c2fd952ad71f25affaf74944b6ec51e6f
Reviewed-on: https://go-review.googlesource.com/c/website/+/293425
Trust: Russ Cox <rsc@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2021-02-24 17:35:54 +00:00
Russ Cox 5bbf007a6d internal/godoc/redirect: remove unused package
Change-Id: I671c64ff191520395bb68430a51dab73cc9e0a30
Reviewed-on: https://go-review.googlesource.com/c/website/+/293424
Trust: Russ Cox <rsc@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2021-02-24 17:35:49 +00:00
Russ Cox e2e5d76fea internal/godoc: remove analysis
We have never run this code on golang.org.

Change-Id: Iba632f00ea055308c036f389e3af56ab11781832
Reviewed-on: https://go-review.googlesource.com/c/website/+/293423
Trust: Russ Cox <rsc@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2021-02-24 17:35:44 +00:00
Russ Cox 79dd487121 internal/godoc/static: delete unused package
Change-Id: I6427b5030e2d4a56b1e6d9075ca3c94ec3dd802c
Reviewed-on: https://go-review.googlesource.com/c/website/+/293422
Trust: Russ Cox <rsc@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2021-02-24 17:35:39 +00:00
Russ Cox 31042d3351 cmd/golangorg: change imports to use internal/godoc
Change-Id: I48498e0c045d4c4d97ac54d3204165adc71133a6
Reviewed-on: https://go-review.googlesource.com/c/website/+/293421
Trust: Russ Cox <rsc@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2021-02-24 17:35:34 +00:00
Russ Cox 6cf1d5f27d internal/godoc: fork golang.org/x/tools/godoc@123adc86bc
This is a straight copy of golang.org/x/tools/godoc@123adc86bc
(CL 291669) with internal import paths updated, gofmt run,
and go17_test.go folded into godoc_test.go (we are well past Go 1.7 now).

The next CL will change cmd/golangorg to use it, and then
we can start making adjustments to delete lots of unused code,
without worrying about affecting any external importers of
the original.

This CL brings in 16,290 lines of code, but less than 2,000
will actually remain once all the no-longer-needed code is
deleted in followup CLs.

Change-Id: I40ff57fe610b252df8bd6bb5de1114cdd7a750a2
Reviewed-on: https://go-review.googlesource.com/c/website/+/293420
Trust: Russ Cox <rsc@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2021-02-24 17:35:29 +00:00
Russ Cox de781e571e _content: delete search box from home page
The search feature is not used much and does not give terribly useful answers.
It accounts for under 2% of golang.org traffic and about one real query per minute.

Looking through a log of 1,592 search queries over a 28-hour period last week,
almost all of them would have found better answers using Google or pkg.go.dev.

Just a few examples of queries for which we had no good answers:

 - 1.16
 - 1.16beta
 - GOPATH
 - k8s.io/api/settings/v1alpha1
 - language and capacity
 - linux installation
 - logical operators
 - mocking struct
 - naming convention
 - remove element from slice
 - sirupsen/logrus
 - string template
 - struct field tag
 - tutorial
 - update go
 - using go modules
 - visual studio code

Removing the search box on the main site will stop acting as though it gives
useful information for queries like these. Then hopefully people will find their
way to Google or pkg.go.dev instead.

Fixes #44357.

Change-Id: I400157e478a9faaf35c3fdb60380336ee0b135a3
Reviewed-on: https://go-review.googlesource.com/c/website/+/292590
Trust: Russ Cox <rsc@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2021-02-18 03:22:27 +00:00
Alexander Rakoczy baa8c5f593 internal/history: document Go 1.16
Change-Id: Ieb559df248ea4c7bdf23ef199e0520caf06a6de2
Reviewed-on: https://go-review.googlesource.com/c/website/+/292591
Trust: Alexander Rakoczy <alex@golang.org>
Run-TryBot: Alexander Rakoczy <alex@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Carlos Amedee <carlos@golang.org>
2021-02-16 19:29:53 +00:00
Russ Cox aefff79d07 content/static: use embed and io/fs
This lets us delete the generated static.go.

For golang/go#41102

Change-Id: Ie09f34a83f114592eec4ba2dd9263285169374ae
Reviewed-on: https://go-review.googlesource.com/c/website/+/291690
Trust: Russ Cox <rsc@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2021-02-16 02:04:16 +00:00
Carlos Amedee 7fa68de391 internal/history: document Go 1.15.8 and Go 1.14.15
Updates golang/go#44105
Updates golang/go#44104

Change-Id: I4a870f91e24fac060f14f7798bd53706a9108ebe
Reviewed-on: https://go-review.googlesource.com/c/website/+/289702
Trust: Carlos Amedee <carlos@golang.org>
Run-TryBot: Carlos Amedee <carlos@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Alexander Rakoczy <alex@golang.org>
2021-02-04 22:27:25 +00:00
Jamal Carvalho 0c2f86a568 content,internal: move HaTS trigger to download doc pages
Moves the HaTS trigger to the install doc pages so
that surveys will prompt while file downloads are
in progress.

Change-Id: I9437909c96907740fa21a0176d86b6adfe45d574
Reviewed-on: https://go-review.googlesource.com/c/website/+/286775
Reviewed-by: Alexander Rakoczy <alex@golang.org>
Trust: Jamal Carvalho <jamal@golang.org>
2021-01-27 16:46:14 +00:00
Jamal Carvalho 1007538d29 internal/dl: add HaTS to golang.org downloads page
Adds a script to trigger HaTS on the download page in an
effort to track developer happiness with the core Go
distribution. Uses the same bucketing and rate limiting
logic as go.dev and pkg.go.dev.

Change-Id: I73cdb4577eaf71a77f09b94965e12871296a6699
Reviewed-on: https://go-review.googlesource.com/c/website/+/286293
Trust: Jamal Carvalho <jamal@golang.org>
Run-TryBot: Jamal Carvalho <jamal@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Julie Qiu <julie@golang.org>
2021-01-25 20:53:07 +00:00
Roland Shoemaker d4a1d39661 internal/history: document Go 1.15.7 and Go 1.14.14
Change-Id: I1bbd0808fc43479a9fd84cc8e61dd8163aec96cf
Reviewed-on: https://go-review.googlesource.com/c/website/+/284872
Trust: Roland Shoemaker <roland@golang.org>
Run-TryBot: Roland Shoemaker <roland@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2021-01-20 15:50:25 +00:00
Roland Shoemaker c818595f3d internal/history: document upcoming Go 1.15.7 and 1.14.14 security releases
They have been pre-announced¹.

¹ https://groups.google.com/g/golang-announce/c/KvrRblbXp_w

Change-Id: I6c55559a8598b8417f92bc1e8c69fd974270f462
Reviewed-on: https://go-review.googlesource.com/c/website/+/283536
Run-TryBot: Roland Shoemaker <roland@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Trust: Roland Shoemaker <roland@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2021-01-13 19:40:17 +00:00
Dmitri Shuralyov 8d60aee9a6 internal/dl: categorize new darwin/arm64 binaries better
We want the new darwin/arm64 installer and archive to be placed next
to the original darwin/amd64 files, not under "Other Ports". Also
highlight (make bold) the darwin/arm64 installer (but not archive).

The "pretty" version of the architecture will be displayed as "ARMv8",
and maybe should be made more macOS-specific in the future.

Updates golang/go#42756.

Change-Id: I5e95a3b93d30253d8fa291d153b3f96f49f9ab5d
Reviewed-on: https://go-review.googlesource.com/c/website/+/278787
Trust: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Alexander Rakoczy <alex@golang.org>
2020-12-17 18:14:27 +00:00
Julie Qiu 9bb0e2307d all: replace godoc.org links with pkg.go.dev
Change links from godoc.org to pkg.go.dev.

For golang/go#36106

Change-Id: Ic3ec03efc265cdc332027d538b0c5d4d91bdac24
Reviewed-on: https://go-review.googlesource.com/c/website/+/275195
Trust: Julie Qiu <julie@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2020-12-07 16:54:58 +00:00
Carlos Amedee 4b0d7aebbb internal/history: document Go 1.15.6 and Go 1.14.13
Updates golang/go#42973
Updates golang/go#42974

Change-Id: I3c6f12238e7b36a079d399f45c0974512badf6a4
Reviewed-on: https://go-review.googlesource.com/c/website/+/275116
Trust: Carlos Amedee <carlos@golang.org>
Run-TryBot: Carlos Amedee <carlos@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2020-12-03 20:45:47 +00:00
Katie Hockman 12a37bd873 internal/history: document Go 1.15.5 and Go 1.14.12
Change-Id: Id06cb288888847ff4bb9251681b6d7a6d1f9381b
Reviewed-on: https://go-review.googlesource.com/c/website/+/269637
Trust: Katie Hockman <katie@golang.org>
Run-TryBot: Katie Hockman <katie@golang.org>
Reviewed-by: Carlos Amedee <carlos@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
2020-11-12 20:37:09 +00:00
Katie Hockman 8d9b1640f9 internal/history: document upcoming Go 1.15.5 and Go 1.14.12 security releases
They have been pre-announced¹.

¹ https://groups.google.com/d/msg/golang-announce/kMa3eup0qhU/O5RSMHO_CAAJ

Change-Id: I90e5844d9f485a45790ad0f39b42091df95ac061
Reviewed-on: https://go-review.googlesource.com/c/website/+/268617
Trust: Katie Hockman <katie@golang.org>
Run-TryBot: Katie Hockman <katie@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Carlos Amedee <carlos@golang.org>
2020-11-09 22:28:51 +00:00
Alexander Rakoczy 7c6e92bff2 internal/history: document Go 1.15.4 and Go 1.14.11
Updates golang/go#42403
Updates golang/go#42404

Change-Id: I3e3809562596945c2e1fab9f61191d01db68120f
Reviewed-on: https://go-review.googlesource.com/c/website/+/267897
Trust: Alexander Rakoczy <alex@golang.org>
Run-TryBot: Alexander Rakoczy <alex@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Carlos Amedee <carlos@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2020-11-05 22:28:00 +00:00
Alexander Rakoczy fa0011f255 internal/history: document Go 1.15.3 and Go 1.14.10
Updates golang/go#41978
Updates golang/go#41977

Change-Id: I939fedfb5d5cb46622fbcbe139734b86ece8215c
Reviewed-on: https://go-review.googlesource.com/c/website/+/262377
Trust: Alexander Rakoczy <alex@golang.org>
Run-TryBot: Alexander Rakoczy <alex@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2020-10-14 20:21:10 +00:00
Dmitri Shuralyov 687f4169bf internal/history: document Go 1.15.2 and Go 1.14.9
For golang/go#41292.
For golang/go#41293.

Change-Id: Ieddb8fc000c49e14e897d5e7077f51cd0754a368
Reviewed-on: https://go-review.googlesource.com/c/website/+/253740
Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Alexander Rakoczy <alex@golang.org>
2020-09-09 20:13:32 +00:00
Filippo Valsorda 1ce20206c4 internal/history: document Go 1.15.1 and Go 1.14.8
Change-Id: I0e319e10f897c1355ce0e24e36c3b6d80ed12419
Reviewed-on: https://go-review.googlesource.com/c/website/+/252197
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2020-09-01 18:00:18 +00:00
Katie Hockman 6247c8602c internal/history: document upcoming Go 1.15.1 and Go 1.14.8 security releases
They have been pre-announced¹.

¹ https://groups.google.com/d/msg/golang-announce/JvvJpgiIfFI/99z802JLAwAJ

Change-Id: I03712ae6af76770970679ea5e53c7f5238cce9f2
Reviewed-on: https://go-review.googlesource.com/c/website/+/251119
Run-TryBot: Katie Hockman <katie@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Filippo Valsorda <filippo@golang.org>
2020-08-27 18:39:52 +00:00
Dmitri Shuralyov 484e0a06ef internal/dl: update minimum macOS version to 10.12
Featured downloads on golang.org/dl use the latest Go release, which
is now Go 1.15. Per golang.org/doc/go1.15#darwin, Go 1.15 requires
macOS 10.12 Sierra or later.

For golang/go#23011.

Change-Id: I9e1fabe459d74bf59661d84e4b40d39d29ce2638
Reviewed-on: https://go-review.googlesource.com/c/website/+/234522
Reviewed-by: Carlos Amedee <carlos@golang.org>
2020-08-12 13:47:32 +00:00
Andrew Bonventre 968e867775 internal/history,cmd/golangorg: add 1.15 and update base ref
Change-Id: I7b3c89f17b9bcaadaed83272950524d28a8be2bf
Reviewed-on: https://go-review.googlesource.com/c/website/+/247682
Run-TryBot: Andrew Bonventre <andybons@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Carlos Amedee <carlos@golang.org>
2020-08-11 21:21:26 +00:00
Katie Hockman 0108f0928b internal/history: document Go 1.14.7 and Go 1.13.15
Change-Id: I573bc8c9278181c1d6651946b1661bac419520c5
Reviewed-on: https://go-review.googlesource.com/c/website/+/247183
Run-TryBot: Katie Hockman <katie@golang.org>
Reviewed-by: Alexander Rakoczy <alex@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2020-08-06 18:21:13 +00:00
Jay Conrod c1742b35e9 content/static/doc: set proper header ids in module documentation
Previously, we used a separate <a> tag before the header. Headers had
temporary ids, and the table of contents linked to those. With this
change, the header elements themselves will have ids.

For golang/go#33637

Change-Id: Ia79048f0db7cc4e8eac3bb5641278acd354fca01
Reviewed-on: https://go-review.googlesource.com/c/website/+/244766
Reviewed-by: Michael Matloob <matloob@golang.org>
2020-08-03 21:34:06 +00:00
Katie Hockman d81f613c3a internal/history: document upcoming Go 1.14.7 and Go 1.13.15 security releases
They have been pre-announced¹.

¹ https://groups.google.com/d/msg/golang-announce/_ulYYcIWg3Q/9zUUX8a9AQAJ

Change-Id: I2356a20be683b4ec8cad2825d33bd118c66be7ee
Reviewed-on: https://go-review.googlesource.com/c/website/+/246500
Run-TryBot: Katie Hockman <katie@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Alexander Rakoczy <alex@golang.org>
2020-08-03 21:16:39 +00:00
Andrew Bonventre 6481bc5d82 internal/history: make minor updates for Go 1.14.6 and 1.13.14
Change-Id: I42a6565660bf476ae8d56539389c85c5be1f71fd
Reviewed-on: https://go-review.googlesource.com/c/website/+/243121
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Carlos Amedee <carlos@golang.org>
Reviewed-by: Alexander Rakoczy <alex@golang.org>
2020-07-16 23:05:05 +00:00
Andrew Bonventre 132774b58c internal/history: document Go 1.14.6 and 1.13.14
Change-Id: I8aa0d04a80a131e928b1e900bf8ea459583e8c28
Reviewed-on: https://go-review.googlesource.com/c/website/+/243120
Reviewed-by: Alexander Rakoczy <alex@golang.org>
Run-TryBot: Andrew Bonventre <andybons@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2020-07-16 19:51:22 +00:00
Andrew Bonventre 51b22ef31a internal/dl: add CORS support to JSON endpoint
This change allows users to request golang.org/dl/?mode=json
via Cross-Origin Resource Sharing (CORS).

It also removes the golangorg build tag as it did not seem
necessary and adds tests for the “include” GET parameter.

Updates golang/go#29206
Fixes golang/go#40253

Change-Id: I5306a264c4ac2a6e6f49cfb53db01eef6b7f4473
Reviewed-on: https://go-review.googlesource.com/c/website/+/243118
Run-TryBot: Andrew Bonventre <andybons@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Alexander Rakoczy <alex@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2020-07-16 19:46:36 +00:00
Katie Hockman a8d8c125b0 internal/history: document Go 1.14.5 and Go 1.13.13
Change-Id: Ic0fc6db12577f1228f1c4f8ff3eda7f320950989
Reviewed-on: https://go-review.googlesource.com/c/website/+/242600
Run-TryBot: Katie Hockman <katie@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Filippo Valsorda <filippo@golang.org>
2020-07-14 18:35:16 +00:00
Dmitri Shuralyov 87e76158b4 internal/history: document upcoming Go 1.14.5 and Go 1.13.13 security releases
They have been pre-announced¹.

Also update the release summary template to not point to the issue
tracker for future releases. The issue tracker is representative of
the final release content only for releases that have been completed.

¹ https://groups.google.com/d/msg/golang-announce/f2c5bqrGH_g/GnH6k56AAAAJ

Change-Id: I1b05a0d6ce3f3f05a441979f529d449a2f49465e
Reviewed-on: https://go-review.googlesource.com/c/website/+/242317
Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Katie Hockman <katie@golang.org>
2020-07-13 17:32:15 +00:00
Dmitri Shuralyov 58a31798e8 internal/dl: use /dl/{file} URLs on /dl/ HTML page
The /dl/{file} URLs have been supported for many years but not well
documented. Start using them on the /dl/ HTML page and document them,
so that it is clear that they can be reliably used in scripts or so.

This causes clients to have to make an extra HTTP request (which gets
redirected to the target location serving the file bytes), but compared
to the total work to download a Go file, this is negligible. Clients
that really want to skip the redirect can do so, but the trade-off is
that they need to update the URL if the CDN used for Go file downloads
happens to change. The /dl/{file} links are not expected to change for
Go 1.

Fixes golang/go#38713.

Change-Id: I9df7d5b761baa6fa657c5dd2063c97b9b457367c
Reviewed-on: https://go-review.googlesource.com/c/website/+/238517
Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Alexander Rakoczy <alex@golang.org>
Reviewed-by: Andrew Bonventre <andybons@golang.org>
2020-06-30 00:42:23 +00:00
Andrew Bonventre 4ae8a49789 cmd/admingolangorg: add command serving an admin interface
This change re-enables the /s/ link shortener admin interface,
running as its own App Engine service on the go111 runtime,
which still supports the “login: admin” option in app.yaml.

+ The golangorg build constraint on the internal/memcache and
  internal/short packages is removed to allow easy import
+ A new function, AdminHandler is introduced in the short package
  to allow for registering the handler outside of it
+ Some page cleanup to leverage modern HTML and JS capabilities,
  obviating the need for jQuery, which has been removed
+ Clients for Redis and Cloud Datastore have been updated to
  the latest versions

Fixes golang/go#29988

Change-Id: If6ca75e85e16a7d86bb5dafcf08b27d2dc36f530
Reviewed-on: https://go-review.googlesource.com/c/website/+/238545
Run-TryBot: Andrew Bonventre <andybons@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2020-06-18 01:33:28 +00:00
Andrew Bonventre d72cde69aa internal/dl: update tmpl.go to be consistent
Change-Id: I215e84876cdd60c6f080eea877399bef05abed3d
Reviewed-on: https://go-review.googlesource.com/c/website/+/237590
Run-TryBot: Andrew Bonventre <andybons@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Julie Qiu <julie@golang.org>
2020-06-11 22:07:21 +00:00
Dmitri Shuralyov c825e8b1e1 internal/history: document Go 1.14.4 and Go 1.13.12
For golang/go#39347.
For golang/go#39346.

Change-Id: Ied6e4f226f1855566ea83bbe64a76a3268870adf
Reviewed-on: https://go-review.googlesource.com/c/website/+/235921
Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
2020-06-01 21:59:02 +00:00
Andrew Bonventre 7fae5531aa internal/history: document Go 1.14.3 and Go 1.13.11
Change-Id: I085358ef9e3e93466eac54c1e26426ea5df32565
Reviewed-on: https://go-review.googlesource.com/c/website/+/234037
Run-TryBot: Andrew Bonventre <andybons@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2020-05-14 22:07:23 +00:00
Andrew Bonventre a8c73cefdc all: update license headers for consistency
There were a few files with different wording in the license header
than is present in the rest of the repository. Update these to say
“BSD-style” instead of “Apache 2.0”.

Change-Id: I24df0e69fbd18728dcf1aec8166c5a52407930f6
Reviewed-on: https://go-review.googlesource.com/c/website/+/231159
Reviewed-by: Alexander Rakoczy <alex@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2020-05-01 20:48:09 +00:00
Hana (Hyang-Ah) Kim 63bb020729 internal/short: allow relative paths from the shortend URLs
golang.org/s/key URL shortener supported only simple redirects
from key to a link. This change allows the short link to have
extra path elements, and computes the redirects by appending
the extra path elements to the resolved link. For example,
if golang.org/s/foo is configured to be resolved to example.com,
golang.org/s/foo/bar will result in a redirects to
example.com/bar.

Change-Id: I6aa9f4aab2d5a74c76fda446a29aae998fe48ad6
Reviewed-on: https://go-review.googlesource.com/c/website/+/227654
Run-TryBot: Andrew Bonventre <andybons@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Andrew Bonventre <andybons@golang.org>
2020-04-30 20:47:54 +00:00
Dmitri Shuralyov b4ea521127 internal/history: rename Version to GoVer
Make it more clear that this type represents a Go-specific version,
rather than a version that follows the Semantic Versioning 2.0.0
specification. The type already has Go-specific methods, for example
IsMajor reports true for "1.14" and IsMinor reports true for "1.14.1".
This is consistent with the terminology used by Go releases, but
very surprising if considered from the perspective of semver.

Document some differences of the Go-specific version convention
compared to semver, and describe the X, Y, Z fields in more detail.

This change makes it viable to add a String method to GoVer type
documented to print a Go-specific version string, which will be
useful in more places in CL 229483.

For golang/go#32450.

Change-Id: If7482fdb4a739ff5b89b7133402d94412057f590
Reviewed-on: https://go-review.googlesource.com/c/website/+/229481
Reviewed-by: Carlos Amedee <carlos@golang.org>
2020-04-23 19:23:00 +00:00
Dmitri Shuralyov e9020e8d94 cmd/golangorg: generate release history page from structured data
Previously, the release history page was a raw HTML file that was
manually edited whenever new Go releases were made. This change
converts release history entries into a structured format in the
new internal/history package, and generates release history entries
from that format.

For now, only Go 1.9 and newer releases are converted, but the
structured format is flexible enough to represent all releases
going back to the original Go 1 release.

Various English grammar rules and special cases are preserved,
so that the release history entries appear in a consistent way.

New release history entries need only to be added to the internal/
history package, making it so that English grammar rules and HTML
tags don't need to go through human code review for each release.
Future work may involve constructing that list from data already
available in the Go issue tracker.

This change makes minimal contributions to reducing the dependence
of x/website on the x/tools/godoc rendering engine for displaying
pages other than Go package documentation. The x/tools/godoc code
is in another module and does not provide flexibility desired for
the general purpose website needs of x/website.

Fixes golang/go#38488.
For golang/go#37090.
For golang/go#29206.

Change-Id: I80864e4f218782e6e3b5fcd5a1d63f3699314c81
Reviewed-on: https://go-review.googlesource.com/c/website/+/229081
Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Alexander Rakoczy <alex@golang.org>
2020-04-21 19:28:23 +00:00
Dmitri Shuralyov ec13687c01 markdown: move to internal/markdown
This package was not made internal in CL 218517 because it was
intended to be used by packages in golang.org/x/blog. However,
golang.org/x/blog ended up taking a different approach that did
not include using golang.org/x/website/markdown; see CL 222846.

Since there isn't a need for this package to be non-internal,
make it internal while it still has 0 known public importers,
to keep future maintenance costs down.

For golang/go#33637.

Change-Id: Ie31264fe14b5cc68d98adbf62d6b824f1df579fb
Reviewed-on: https://go-review.googlesource.com/c/website/+/228418
Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Jay Conrod <jayconrod@google.com>
2020-04-17 16:07:05 +00:00
Alberto Donizetti 84ac603e7c internal/dl: add linux/arm64 to the list of First Class ports
The PrimaryPort function is used in the dl page to split downloads
between first class and "Others". Since linux/arm64 is now a first
class port, it needs to be listed in the primary section.

Updates golang/go#35593
Fixes golang/go#38258

Change-Id: Ib3044b2feaad4b7b415d273fab014d83082c806f
Reviewed-on: https://go-review.googlesource.com/c/website/+/227597
Run-TryBot: Alberto Donizetti <alb.donizetti@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2020-04-15 20:48:53 +00:00
Bradford Lamson-Scribner a2b2cb4a9f website: add two missing </div> closing tags
The HTML5 spec states that while some closing tags can be omitted,
<div> elements are not one of them. They must all include a closing
tag.

Fixes golang/go#37075

Change-Id: I30f8cf2ec9e4b7b626f4954bb64055c5c7462ebd
Reviewed-on: https://go-review.googlesource.com/c/website/+/219507
Run-TryBot: Andrew Bonventre <andybons@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Andrew Bonventre <andybons@golang.org>
2020-02-17 19:44:10 +00:00
Carlos Amedee 61b2c84e66 internal/dl: add amedee to validUser
Change-Id: I12b6e39b4645d0113a0c13dbd2abcf5e6108cae1
Reviewed-on: https://go-review.googlesource.com/c/website/+/209997
Reviewed-by: Alexander Rakoczy <alex@golang.org>
Run-TryBot: Alexander Rakoczy <alex@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2019-12-04 22:47:21 +00:00
Alexander Neumann 3d1bfa15a5 internal/dl: redirect to downloadBaseURL for GPG signatures
Fixes golang/go#35717

Change-Id: I6d063fb1d6c33b60a7bcf34cda832011a2fc120d
GitHub-Last-Rev: 9706ecb20d
GitHub-Pull-Request: golang/website#6
Reviewed-on: https://go-review.googlesource.com/c/website/+/208158
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2019-11-20 20:07:18 +00:00
Andrew Bonventre d2d6abcea4 internal/dl: update webfonts and footer to match base template
Fixes golang/go#33799

Change-Id: I186215068621fd918ee32380fdc7dee4bbd49644
Reviewed-on: https://go-review.googlesource.com/c/website/+/191622
Run-TryBot: Andrew Bonventre <andybons@golang.org>
Reviewed-by: Katie Hockman <katie@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2019-08-23 20:12:32 +00:00
Andrew Bonventre 86a7442ada internal/dl: update minimum macOS version to 10.11
Per golang.org/doc/go1.12#darwin, 10.10 is no longer supported in
Go 1.13.

Change-Id: Id49055398f35791573caf6c5956177481670059a
Reviewed-on: https://go-review.googlesource.com/c/website/+/189617
Run-TryBot: Andrew Bonventre <andybons@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Filippo Valsorda <filippo@golang.org>
2019-08-09 15:33:40 +00:00
Alberto Donizetti 7fe0381767 internal/dl: add missing space after Archived versions title
Fixes golang/go#33084

Change-Id: I82b41f719ffeb8ec240175cc794ec404555e2e1c
Reviewed-on: https://go-review.googlesource.com/c/website/+/186017
Reviewed-by: Andrew Bonventre <andybons@golang.org>
2019-07-14 20:28:08 +00:00
Andrew Bonventre f8af59c092 internal/dl: update download template to use new footer
Also ensures link text for the download buttons matches
the rest of the site.

Updates golang/go#9936

Change-Id: Ic86c3680b055a25649c36de691d629e8d8c2dbe6
Reviewed-on: https://go-review.googlesource.com/c/website/+/185259
Reviewed-by: Alexander Rakoczy <alex@golang.org>
2019-07-09 16:26:22 +00:00
Alexander Rakoczy 61d83737a8 internal/dl: add rakoczy to validUser
Change-Id: Icec97d1de932b645d4024acea33982368af3fc12
Reviewed-on: https://go-review.googlesource.com/c/website/+/184538
Run-TryBot: Alexander Rakoczy <alex@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2019-07-02 17:17:12 +00:00
Katie Hockman a89c418f5d website: describe default mirror and sumdb behavior on Downloads page
Change-Id: I19b0ac2551d7bae9287361b48eb6e05b9cc71680
Reviewed-on: https://go-review.googlesource.com/c/website/+/181957
Reviewed-by: Andrew Bonventre <andybons@golang.org>
2019-06-14 15:29:44 +00:00
Andrew Bonventre 2ab4c0b250 content/static, internal/dl: update header on downloads page
The downloads page does not share the root template as other pages.
Update it to use the new header markup.

Also fixes an issue where static.go did not contain the Go logo and
updates the downloads page to be consistent with others when visiting
from China.

Updates golang/go#9936
Fixes golang/go#32151

Change-Id: Ic6d703ccb8fe5cf93d74256bac41ecad69a78e72
Reviewed-on: https://go-review.googlesource.com/c/website/+/178138
Reviewed-by: Katie Hockman <katie@golang.org>
2019-05-20 21:17:23 +00:00
John Weldon ee561689b9 internal/dl: enhance JSON download with include=all option
This change adds an optional query parameter, include=all, to the
https://godoc.org/dl/?mode=json endpoint. When this parameter is set
the returned JSON will include metadata for Stable, Archive, and
Unstable downloads, rather than the default which only lists Stable.

Fixes golang/go#29380

Change-Id: Id51e839919df9dd967d2f11ba0658f51f61b6d1b
Reviewed-on: https://go-review.googlesource.com/c/website/+/163741
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2019-04-24 16:00:28 +00:00
Dmitri Shuralyov c7db086a28 internal/env: use golangorgenv package from x/tools
This change de-duplicates the same configuration used between
the previous x/tools/godoc/env package and x/website's own
internal/env package. It does so by using the new golangorgenv
package.

This makes it possible to remove the old GODOC_PROD and
GODOC_ENFORCE_HOSTS env vars from app.prod.yaml.

The IsProd configuration value was very generic and yet being
used only in one place. Replace it with a more targeted one.
The new name does a better job of communicating what the
implications of setting or not setting it are.

Apply the same change to logic of googleCN as in CL 165459.

Update the required version of the x/tools module to a newer version
that includes CL 160837, which is required for this change.

Starting with this change, we're changing the x/website policy in that
it's now allowed to start using newer versions of subrepos from the
master branch, rather than only using the release-branches of subrepos.
This is in line with the goal of making x/website more self-contained
and less constrained by the Go release schedule.

Updates golang/go#29206

Change-Id: If8847e9276fb18e3ded56fabbf915cdd19176699
Reviewed-on: https://go-review.googlesource.com/c/website/+/165837
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2019-03-29 17:21:28 +00:00
Rohan Verma 8cde3f76c4 content/static,internal/dl: add links for Creative Commons license
Fixes golang/go#30371

Change-Id: I7a503061d2f5adcf866a7f90eb26d425f732c44a
GitHub-Last-Rev: 2628f6b78e
GitHub-Pull-Request: golang/website#2
Reviewed-on: https://go-review.googlesource.com/c/163746
Reviewed-by: Agniva De Sarker <agniva.quicksilver@gmail.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Agniva De Sarker <agniva.quicksilver@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2019-02-27 16:11:12 +00:00
Channing Kimble-Brown 829c1b065c internal/short: point to new tracking issue for shortlink creation
Applies CL 160377 from the x/tools repo to the x/website repo.

Updates golang/go#29206

Change-Id: I3c8b6a2ef5288cc84378c34a3a768952bf12df08
Reviewed-on: https://go-review.googlesource.com/c/162377
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2019-02-13 16:53:24 +00:00
Channing Kimble-Brown 45f521b524 cmd/golangorg, internal/env: make deployment work for x/website
This change is part of an effort to deploy x/website to its own
subdomain on GCP. Everything needs to be working properly on the
subdomain before x/website can become the canonical website
(golang.org). There is currently a functional deployment of
x/website to the 'new-website' service under golang-org on GCP.

With these specific changes, x/website gets deployed to the
service 'new-website'. By changing both the service field in
app.prod.yaml and the GCP_SERVICE variable in Makefile to
'default', these files could be used to deploy x/website to
the 'default' service as well.

Updates golang/go#29206

Change-Id: I47340333b9e09672e8588c330d629857d1d0bf0d
Reviewed-on: https://go-review.googlesource.com/c/161198
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2019-02-11 23:02:24 +00:00
Channing Kimble-Brown 1459be3397 cmd/golangorg, internal: use newly copied x/website/internal packages
Now that the internal directory contains copies of the packages
from x/tools/godoc the import paths and dependencies can refer
to accessible files. The build now works for both the app engine
and non app engine configurations.

Updates golang/go#29206

Change-Id: I3ac8070b8a3c01d0ca40e3f5586d05fc9b5bb8ff
Reviewed-on: https://go-review.googlesource.com/c/159918
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Katie Hockman <katie@golang.org>
2019-01-29 15:17:29 +00:00
Channing Kimble-Brown b018bd1d29 internal: copy x/tools/godoc/{dl,env,proxy,redirect,short} packages
These files from x/tools commit
0a99049195aff55f007fc4dfd48e3ec2b4d5f602 are being added here
both as a step toward fixing the broken app engine build (using
go build -tags=golangorg requires access to memcache) and towards
the long term goal of removing files and packages that exist solely
to serve the website from x/tools. The next step will be changing
the import paths to get the build working again.

Updates golang/go#29206

Change-Id: Ie30b7776f30cda14c7fe9827941c623bc5c5c587
Reviewed-on: https://go-review.googlesource.com/c/159917
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Katie Hockman <katie@golang.org>
2019-01-29 15:14:25 +00:00
Channing Kimble-Brown da9e5ccbe1 x/website: add code and static files for website
All of the code and static assets that the website uses to run have been
copied to this repo. There was also a few lines of code added telling
the website where the doc directory, favicon.ico and robots.txt are.

go repo change-id: Ife6443c32673b38000b90dd2efb2985db37ab773
x/tools repo change-id: Ia979a8b06d1b4db47d25ffdfdf925ba8a0ac67de

Real new code additions:
- main.go
    * lines 89-95 added getFullPath method
    * lines 217-222 mapped paths to doc/, favicon.ico, robots.txt in vfs
- appinit.go
    * lines 147-153 added getFullPath method
    * lines 80-84 mapped paths to doc/, favicon.ico in vfs

Several files were copied from x/tools and go so paths (and corresponding
import paths) were changed as follows:

"x/tools/cmd/godoc/" --> "x/website/cmd/golangorg/"
"x/tools/godoc/static/" --> "x/website/content/static/"
"x/tools/godoc/" (without godoc/static/) --> "x/website/cmd/golangorg/godoc/"
"x/tools/internal/memcache" --> "x/website/internal/memcache"
"go/doc/" --> "x/website/content/doc/"
"go/favicon.ico" --> "x/website/favicon.ico"
"go/robots.txt" --> "x/website/robots.txt"

Updates golang/go#29206

Change-Id: I53985fc027f73e60c6946038f85133acf1ecb08c
Reviewed-on: https://go-review.googlesource.com/c/156321
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2019-01-08 18:22:29 +00:00