blog: update to use new Go branding guidelines
Additionally makes some small changes to abide by best practices.
Updates golang/go#9936
Change-Id: I88263ef78548365b3cfb3f14bae48deb01d30f4f
Reviewed-on: https://go-review.googlesource.com/c/blog/+/189457
Reviewed-by: Katie Hockman <katie@golang.org>
diff --git a/README.md b/README.md
index 363f6db..e0af7a3 100644
--- a/README.md
+++ b/README.md
@@ -5,7 +5,7 @@
## Download/Install
The easiest way to install is to run `go get -u golang.org/x/blog`. You can also
-manually git clone the repository to $GOPATH/src/golang.org/x/blog.
+manually git clone the repository to \$GOPATH/src/golang.org/x/blog.
## Running Locally
@@ -34,5 +34,5 @@
this repository, see https://golang.org/doc/contribute.html.
The main issue tracker for the blog is located at
-https://github.com/golang/go/issues. Prefix your issue with "blog:" in the
+https://github.com/golang/go/issues. Prefix your issue with "x/blog:" in the
subject line, so it is easy to find.
diff --git a/blog.go b/blog.go
index b1cd9bd..9277c76 100644
--- a/blog.go
+++ b/blog.go
@@ -12,7 +12,7 @@
"time"
"golang.org/x/tools/blog"
- "golang.org/x/tools/godoc/static"
+ "golang.org/x/website/content/static"
_ "golang.org/x/tools/playground"
)
diff --git a/go.mod b/go.mod
index f9f0077..4a27c21 100644
--- a/go.mod
+++ b/go.mod
@@ -4,8 +4,9 @@
require (
github.com/gorilla/context v1.1.1
- golang.org/x/net v0.0.0-20190311183353-d8887717615a
- golang.org/x/text v0.3.0
- golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846
+ golang.org/x/net v0.0.0-20190620200207-3b0461eec859
+ golang.org/x/text v0.3.1-0.20181227161524-e6919f6577db
+ golang.org/x/tools v0.0.0-20190807223507-b346f7fd45de
+ golang.org/x/website v0.0.0-20190807165153-36703a14eb82
gopkg.in/tomb.v2 v2.0.0-20161208151619-d5d1b5820637
)
diff --git a/go.sum b/go.sum
index c32fd03..9e84424 100644
--- a/go.sum
+++ b/go.sum
@@ -1,12 +1,95 @@
-github.com/gorilla/context v1.1.1 h1:AWwleXJkX/nhcU9bZSnZoi3h/qGYqQAGhq6zZe/aQW8=
+cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
+cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
+git.apache.org/thrift.git v0.0.0-20180902110319-2566ecd5d999/go.mod h1:fPE2ZNJGynbRyZ4dJvy6G277gSllfV2HJqblrnkyeyg=
+git.apache.org/thrift.git v0.0.0-20181218151757-9b75e4fe745a/go.mod h1:fPE2ZNJGynbRyZ4dJvy6G277gSllfV2HJqblrnkyeyg=
+github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q=
+github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw=
+github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04=
+github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q=
+github.com/golang/lint v0.0.0-20180702182130-06c8688daad7/go.mod h1:tluoj9z5200jBnyusfRPU2LqT6J+DAorxEvtC7LHB+E=
+github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A=
+github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A=
+github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
+github.com/gomodule/redigo v2.0.0+incompatible/go.mod h1:B4C85qUVwatsJoIUNIfCRsp7qO0iAmpGFZ4EELWSbC4=
+github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M=
+github.com/googleapis/gax-go v2.0.0+incompatible/go.mod h1:SFVmujtThgffbyetf+mdk2eWhX2bMyUtNHzFKcPA9HY=
github.com/gorilla/context v1.1.1/go.mod h1:kBGZzfjB9CEq2AlWe17Uuf7NDRt0dE0s8S51q0aT7Yg=
+github.com/grpc-ecosystem/grpc-gateway v1.5.0/go.mod h1:RSKVYQBd5MCa4OVpNdGskqpgL2+G+NZTnrVHpWWfpdw=
+github.com/grpc-ecosystem/grpc-gateway v1.6.2/go.mod h1:RSKVYQBd5MCa4OVpNdGskqpgL2+G+NZTnrVHpWWfpdw=
+github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
+github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0=
+github.com/openzipkin/zipkin-go v0.1.1/go.mod h1:NtoC/o8u3JlF1lSlyPNswIbeQH9bJTmOf0Erfk+hxe8=
+github.com/openzipkin/zipkin-go v0.1.3/go.mod h1:NtoC/o8u3JlF1lSlyPNswIbeQH9bJTmOf0Erfk+hxe8=
+github.com/prometheus/client_golang v0.8.0/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw=
+github.com/prometheus/client_golang v0.9.2/go.mod h1:OsXs2jCmiKlQ1lTBmv21f2mNfw4xf/QclQDMrYNZzcM=
+github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo=
+github.com/prometheus/common v0.0.0-20180801064454-c7de2306084e/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro=
+github.com/prometheus/common v0.0.0-20181126121408-4724e9255275/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro=
+github.com/prometheus/common v0.0.0-20181218105931-67670fe90761/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro=
+github.com/prometheus/procfs v0.0.0-20180725123919-05ee40e3a273/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk=
+github.com/prometheus/procfs v0.0.0-20181204211112-1dc9a6cbc91a/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk=
+go.opencensus.io v0.18.0/go.mod h1:vKdFvxhtzZ9onBp9VKHK8z/sRpBMnKAsufL7wlDrCOA=
+go.opencensus.io v0.19.0/go.mod h1:AYeH0+ZxYyghG8diqaaIq/9P3VgCCt5GF2ldCY4dkFg=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
-golang.org/x/net v0.0.0-20190311183353-d8887717615a h1:oWX7TPOiFAMXLq8o0ikBYfCJVlRHBcsciT5bXOrH628=
+golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
+golang.org/x/lint v0.0.0-20180702182130-06c8688daad7/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
+golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
+golang.org/x/lint v0.0.0-20181217174547-8f45f776aaf1/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
+golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
+golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
+golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
+golang.org/x/net v0.0.0-20181106065722-10aee1819953/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
+golang.org/x/net v0.0.0-20181201002055-351d144fa1fc/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
+golang.org/x/net v0.0.0-20181217023233-e147a9138326/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
+golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
+golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
+golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
+golang.org/x/oauth2 v0.0.0-20181203162652-d668ce993890/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
+golang.org/x/oauth2 v0.0.0-20190115181402-5dab4167f31c/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
+golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
+golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
+golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
+golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
+golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
+golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
+golang.org/x/sys v0.0.0-20181218192612-074acd46bca6/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
-golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
-golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846 h1:0oJP+9s5Z3MT6dym56c4f7nVeujVpL1QyD2Vp/bTql0=
-golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
-gopkg.in/tomb.v2 v2.0.0-20161208151619-d5d1b5820637 h1:yiW+nvdHb9LVqSHQBXfZCieqV4fzYhNBql77zY0ykqs=
+golang.org/x/text v0.3.1-0.20181227161524-e6919f6577db/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
+golang.org/x/tools v0.0.0-20180828015842-6cd1fcedba52/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
+golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
+golang.org/x/tools v0.0.0-20181219222714-6e267b5cc78e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
+golang.org/x/tools v0.0.0-20190516015132-d1a3278ee749 h1:L1RW4r06KGFktOvNizsWNBWHn4V2I/p9SNRLhNn6hzM=
+golang.org/x/tools v0.0.0-20190516015132-d1a3278ee749/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
+golang.org/x/tools v0.0.0-20190727173135-db2fa46ec33c h1:NrEU3v+Wvf1J+Ne0gtb6OYmJiCDC4GDcup2dtt2ldPo=
+golang.org/x/tools v0.0.0-20190727173135-db2fa46ec33c/go.mod h1:jcCCGcm9btYwXyDqrUWc6MKQKKGJCWEQ3AfLSRIbEuI=
+golang.org/x/tools v0.0.0-20190807223507-b346f7fd45de h1:VNumCimp/Bwk6fRqgPHkjiUPZ/vzlpi23/kQTuQ4gBA=
+golang.org/x/tools v0.0.0-20190807223507-b346f7fd45de/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
+golang.org/x/website v0.0.0-20190727171005-df01d8eb50ad h1:A09fOXM2ZA0d+KiPBqzzs7PCHa7cg69ymgYLGZin2fU=
+golang.org/x/website v0.0.0-20190727171005-df01d8eb50ad/go.mod h1:u5ggTGJo4PIUwslQgf8ht7hkVPx0lFfuOcJUNVQZB3g=
+golang.org/x/website v0.0.0-20190807165153-36703a14eb82 h1:+VdJF6Jg4GijGDV8qeSqL4zIDBk9r98faxEXxoQHbbU=
+golang.org/x/website v0.0.0-20190807165153-36703a14eb82/go.mod h1:u5ggTGJo4PIUwslQgf8ht7hkVPx0lFfuOcJUNVQZB3g=
+golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
+google.golang.org/api v0.0.0-20180910000450-7ca32eb868bf/go.mod h1:4mhQ8q/RsB7i+udVvVy5NUi08OU8ZlA0gRVgrF7VFY0=
+google.golang.org/api v0.0.0-20181220000619-583d854617af/go.mod h1:4mhQ8q/RsB7i+udVvVy5NUi08OU8ZlA0gRVgrF7VFY0=
+google.golang.org/api v0.1.0/go.mod h1:UGEZY7KEX120AnNLIHFMKIo4obdJhkp2tPbaPlQx13Y=
+google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM=
+google.golang.org/appengine v1.3.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
+google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
+google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc=
+google.golang.org/genproto v0.0.0-20180831171423-11092d34479b/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc=
+google.golang.org/genproto v0.0.0-20181202183823-bd91e49a0898/go.mod h1:7Ep/1NZk928CDR8SjdVbjWNpdIf6nzjE3BTgJDr2Atg=
+google.golang.org/genproto v0.0.0-20181219182458-5a97ab628bfb/go.mod h1:7Ep/1NZk928CDR8SjdVbjWNpdIf6nzjE3BTgJDr2Atg=
+google.golang.org/genproto v0.0.0-20190123001331-8819c946db44/go.mod h1:L3J43x8/uS+qIUoksaLKe6OS3nUKxOKuIFz1sl2/jx4=
+google.golang.org/grpc v1.14.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw=
+google.golang.org/grpc v1.16.0/go.mod h1:0JHn/cJsOMiMfNA9+DeHDlAU7KAAB5GDlYFpa9MZMio=
+google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs=
+google.golang.org/grpc v1.18.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs=
+gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
+gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/tomb.v2 v2.0.0-20161208151619-d5d1b5820637/go.mod h1:BHsqpu/nsuzkT5BpiH1EMZPLyqSMM8JbIavyFACoFNk=
+gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
+gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
+honnef.co/go/tools v0.0.0-20180728063816-88497007e858/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
+honnef.co/go/tools v0.0.0-20180920025451-e3ad64cb4ed3/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
diff --git a/local.go b/local.go
index 1dba26c..cb79bd1 100644
--- a/local.go
+++ b/local.go
@@ -24,22 +24,22 @@
contentPath = flag.String("content", "content/", "path to content files")
templatePath = flag.String("template", "template/", "path to template files")
staticPath = flag.String("static", "static/", "path to static files")
- godocPath = flag.String("godoc", defaultGodocPath(), "path to lib/godoc static files")
+ websitePath = flag.String("website", defaultWebsitePath(), "path to lib/godoc static files")
reload = flag.Bool("reload", false, "reload content on each page load")
)
-func defaultGodocPath() string {
- out, err := exec.Command("go", "list", "-f", "{{.Dir}}", "golang.org/x/tools/godoc").CombinedOutput()
+func defaultWebsitePath() string {
+ out, err := exec.Command("go", "list", "-f", "{{.Dir}}", "golang.org/x/website/content/static").CombinedOutput()
if err != nil {
- log.Printf("warning: locating -godoc directory: %v", err)
+ log.Printf("warning: locating -website directory: %v", err)
return ""
}
dir := strings.TrimSpace(string(out))
- return filepath.Join(dir, "static")
+ return dir
}
// maybeStatic serves from one of the two static directories
-// (-static and -godoc) if possible, or else defers to the fallback handler.
+// (-static and -website) if possible, or else defers to the fallback handler.
func maybeStatic(fallback http.Handler) http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
p := r.URL.Path
@@ -51,7 +51,7 @@
}
}
if strings.HasPrefix(p, "/lib/godoc/") {
- f := filepath.Join(*godocPath, p[len("/lib/godoc/"):])
+ f := filepath.Join(*websitePath, p[len("/lib/godoc/"):])
if _, err := os.Stat(f); err == nil {
http.ServeFile(w, r, f)
return
@@ -61,7 +61,7 @@
}
}
-func newServer(reload bool, staticPath string, config blog.Config) (http.Handler, error) {
+func newServer(reload bool, config blog.Config) (http.Handler, error) {
mux := http.NewServeMux()
var h http.Handler
if reload {
@@ -88,7 +88,7 @@
config.ContentPath = *contentPath
config.TemplatePath = *templatePath
- mux, err := newServer(*reload, *staticPath, config)
+ mux, err := newServer(*reload, config)
if err != nil {
log.Fatal(err)
}
diff --git a/local_test.go b/local_test.go
index a848b27..3df3bbe 100644
--- a/local_test.go
+++ b/local_test.go
@@ -19,7 +19,10 @@
if runtime.GOOS == "android" {
t.Skip("skipping on android; can't run go tool")
}
- mux, err := newServer(false, "/static", blog.Config{
+ oldStatic := *staticPath
+ *staticPath = "/static"
+ defer func() { *staticPath = oldStatic }()
+ mux, err := newServer(false, blog.Config{
TemplatePath: "./template",
})
if err != nil {
diff --git a/template/doc.tmpl b/template/doc.tmpl
index cb80af7..f7f5f5b 100644
--- a/template/doc.tmpl
+++ b/template/doc.tmpl
@@ -1,7 +1,6 @@
{{/* This doc template is given to the present tool to format articles. */}}
{{define "root"}}
-
{{with .Subtitle}}<h2>{{.}}</h2>{{end}}
{{if .Doc | sectioned}}
{{range .Sections}}
@@ -14,7 +13,6 @@
{{end}}
{{end}}
{{end}}
-
{{end}}
{{define "TOC"}}
@@ -64,7 +62,7 @@
{{define "image"}}
<div class="image">
- <img src="{{.URL}}"{{with .Height}} height="{{.}}"{{end}}{{with .Width}} width="{{.}}"{{end}}>
+ <img src="{{.URL}}"{{with .Height}} height="{{.}}"{{end}}{{with .Width}} width="{{.}}"{{end}} alt="">
</div>
{{end}}
@@ -79,7 +77,7 @@
<iframe src="{{.URL}}"{{with .Height}} height="{{.}}"{{end}}{{with .Width}} width="{{.}}"{{end}} frameborder="0" allowfullscreen mozallowfullscreen webkitallowfullscreen></iframe>
</div>
{{end}}
-
-{{define "link"}}<p class="link"><a href="{{.URL}}" target="_blank">{{style .Label}}</a></p>{{end}}
-{{define "html"}}{{.HTML}}{{end}}
\ No newline at end of file
+{{define "link"}}<p class="link"><a href="{{.URL}}" target="_blank" rel="noopener">{{style .Label}}</a></p>{{end}}
+
+{{define "html"}}{{.HTML}}{{end}}
diff --git a/template/root.tmpl b/template/root.tmpl
index ea297a1..c31fb2d 100644
--- a/template/root.tmpl
+++ b/template/root.tmpl
@@ -2,176 +2,210 @@
{{define "root"}}
<!DOCTYPE html>
-<html>
-<head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
- <meta name="viewport" content="width=device-width">
- <meta name="theme-color" content="#375EAB">
- <title>{{template "title" .}}</title>
- <link type="text/css" rel="stylesheet" href="/lib/godoc/style.css">
- <link type="text/css" rel="stylesheet" href="/fonts.css">
- <link rel="alternate" type="application/atom+xml" title="blog.golang.org - Atom Feed" href="https://blog.golang.org/feed.atom" />
- <script type="text/javascript">window.initFuncs = [];</script>
- <style>
- #sidebar {
- float: right;
- padding-left: 20px;
- width: 40%;
- max-width: 250px;
- background: #F3F3F3;
- margin: 20px 0 20px 20px;
- }
- #sidebar ul {
- padding: 0;
- }
- #sidebar li {
- list-style-type: none;
- }
- #content .author {
- font-style: italic;
- }
- #content .article {
- margin-bottom: 50px;
- }
- #content .date {
- color: #999;
- }
- #content .tags {
- color: #999;
- font-size: smaller;
- }
- #content .iframe, #content .image {
- margin: 20px;
- }
- #content .title {
- margin: 20px 0;
- }
- #content img {
- max-width: 100%;
- }
- .article[data-slug='/go-fonts'] {
- font-family: Go, sans-serif;
- }
- .article[data-slug='/go-fonts'] pre,
- .article[data-slug='/go-fonts'] code {
- font-family: Go Mono, monospace;
- }
- </style>
-</head>
-<body>
+<html lang="en">
+<meta charset="utf-8">
+<meta name="viewport" content="width=device-width, initial-scale=1">
+<meta name="theme-color" content="#00ADD8">
+<meta name="description" content="Go is an open source programming language that makes it easy to build simple, reliable, and efficient software.">
+<title>{{template "title" .}}</title>
+<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Work+Sans:600|Roboto:400,700|Source+Code+Pro">
+<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Product+Sans&text=Supported%20by%20Google&display=swap">
+<link rel="stylesheet" href="/lib/godoc/style.css">
+<link rel="stylesheet" href="/fonts.css">
+<link rel="alternate" type="application/atom+xml" title="blog.golang.org - Atom Feed" href="https://blog.golang.org/feed.atom" />
+<script>window.initFuncs = [];</script>
+<style>
+ h1,
+ h2,
+ h3,
+ h4,
+ h5,
+ h6 {
+ font-family: 'Work Sans', sans-serif;
+ font-weight: 600;
+ }
+ h2 { /* Reset from style.js in x/website */
+ background: none;
+ clear: none;
+ font-size: 1.5em;
+ font-weight: 600;
+ line-height: inherit;
+ overflow-wrap: normal;
+ padding: 0;
+ }
+ #sidebar {
+ float: right;
+ padding-left: 20px;
+ width: 40%;
+ max-width: 250px;
+ background: #f8f9f9;
+ margin: 20px 0 20px 20px;
+ }
+ #sidebar h2 {
+ font-size: 1rem;
+ }
+ #sidebar ul {
+ padding: 0;
+ }
+ #sidebar li {
+ list-style-type: none;
+ }
+ #content .author {
+ font-style: italic;
+ }
+ #content .article {
+ margin-bottom: 50px;
+ }
+ #content .date {
+ color: #6e7072;
+ }
+ #content .tags {
+ color: #999;
+ font-size: smaller;
+ }
+ #content .iframe, #content .image {
+ margin: 20px;
+ }
+ #content .title {
+ margin: 20px 0;
+ }
+ #content img {
+ max-width: 100%;
+ }
+ .article[data-slug='/go-fonts'] {
+ font-family: Go, sans-serif;
+ }
+ .article[data-slug='/go-fonts'] pre,
+ .article[data-slug='/go-fonts'] code {
+ font-family: 'Go Mono', monospace;
+ }
+</style>
+<header class="Header js-header">
+ <nav class="Header-nav">
+ <a href="/"><img class="Header-logo" src="/lib/godoc/images/go-logo-blue.svg" alt="Go"></a>
+ <button class="Header-menuButton js-headerMenuButton" aria-label="Main menu" aria-expanded="false">
+ <div class="Header-menuButtonInner">
+ </button>
+ <ul class="Header-menu">
+ <li class="Header-menuItem"><a href="{{.GodocURL}}/doc/">Documents</a></li>
+ <li class="Header-menuItem"><a href="{{.GodocURL}}/pkg/">Packages</a></li>
+ <li class="Header-menuItem"><a href="{{.GodocURL}}/project/">The Project</a></li>
+ <li class="Header-menuItem"><a href="{{.GodocURL}}/help/">Help</a></li>
+ <li class="Header-menuItem"><a href="{{.BasePath}}/">Blog</a></li>
+ <li class="Header-menuItem"><a href="https://play.golang.org/">Play</a></li>
+ <li class="Header-menuItem Header-menuItem--search">
+ <form class="HeaderSearch" role="search" action="{{.GodocURL}}/search">
+ <input class="HeaderSearch-input"
+ type="search"
+ name="q"
+ placeholder="Search"
+ aria-label="Search"
+ autocapitalize="off"
+ autocomplete="off"
+ autocorrect="off"
+ spellcheck="false"
+ required>
+ <button class="HeaderSearch-submit" aria-label="Search">
+ <!-- magnifying glass: --><svg class="HeaderSearch-icon" width="24" height="24" viewBox="0 0 24 24"><title>Search</title><path d="M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"/><path d="M0 0h24v24H0z" fill="none"/></svg>
+ </button>
+ </form>
+ </li>
+ </ul>
+ </nav>
+</header>
-<div id="topbar"><div class="container">
+<main id="page">
+ <div class="container">
+ <aside id="sidebar">
+ {{with .Doc}}
+ {{with .Newer}}
+ <h2>Next article</h2>
+ <p><a href="{{.Path}}">{{.Title}}</a></p>
+ {{end}}
-<div class="top-heading" id="heading-wide"><a href="{{.GodocURL}}/">The Go Programming Language</a></div>
-<div class="top-heading" id="heading-narrow"><a href="{{.GodocURL}}/">Go</a></div>
-<a href="#" id="menu-button"><span id="menu-button-arrow">▽</span></a>
-<form method="GET" action="{{.GodocURL}}/search">
-<div id="menu">
-<a href="{{.GodocURL}}/doc/">Documents</a>
-<a href="{{.GodocURL}}/pkg/">Packages</a>
-<a href="{{.GodocURL}}/project/">The Project</a>
-<a href="{{.GodocURL}}/help/">Help</a>
-<a href="{{.BasePath}}/">Blog</a>
-<span class="search-box"><input type="search" id="search" name="q" placeholder="Search" aria-label="Search" required><button type="submit"><span><!-- magnifying glass: --><svg width="24" height="24" viewBox="0 0 24 24"><title>submit search</title><path d="M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"/><path d="M0 0h24v24H0z" fill="none"/></svg></span></button></span>
-</div>
-</form>
+ {{with .Older}}
+ <h2>Previous article</h2>
+ <p><a href="{{.Path}}">{{.Title}}</a></p>
+ {{end}}
+ {{end}}
-</div></div>
+ <h2>Links</h2>
+ <ul>
+ <li><a href='//golang.org/'>golang.org</a></li>
+ <li><a href='//golang.org/doc/install.html'>Install Go</a></li>
+ <li><a href='//tour.golang.org/'>A Tour of Go</a></li>
+ <li><a href='//golang.org/doc/'>Go Documentation</a></li>
+ <li><a href='//groups.google.com/group/golang-nuts'>Go Mailing List</a></li>
+ <li><a href='//twitter.com/golang'>Go on Twitter</a></li>
+ </ul>
-<div id="page">
-<div class="container">
+ <p><a href="{{.BasePath}}/index">Blog index</a></p>
+ </aside><!-- #sidebar -->
-<div id="sidebar">
- {{with .Doc}}
- {{with .Newer}}
- <h4>Next article</h4>
- <p><a href="{{.Path}}">{{.Title}}</a></p>
- {{end}}
+ <div id="content">
+ <h1><a href="{{.BasePath}}/">The Go Blog</a></h1>
+ {{template "content" .}}
+ </div><!-- #content -->
- {{with .Older}}
- <h4>Previous article</h4>
- <p><a href="{{.Path}}">{{.Title}}</a></p>
- {{end}}
- {{end}}
+ </div><!-- .container -->
+</main><!-- #page -->
- <h4>Links</h4>
- <ul>
- <li><a href='//golang.org/'>golang.org</a></li>
- <li><a href='//golang.org/doc/install.html'>Install Go</a></li>
- <li><a href='//tour.golang.org/'>A Tour of Go</a></li>
- <li><a href='//golang.org/doc/'>Go Documentation</a></li>
- <li><a href='//groups.google.com/group/golang-nuts'>Go Mailing List</a></li>
- <li><a href='//twitter.com/golang'>Go on Twitter</a></li>
- </ul>
+<footer>
+ <div class="Footer">
+ <img class="Footer-gopher" src="/lib/godoc/images/footer-gopher.jpg" alt="The Go Gopher">
+ <ul class="Footer-links">
+ <li class="Footer-link"><a href="{{.GodocURL}}/doc/copyright.html">Copyright</a></li>
+ <li class="Footer-link"><a href="{{.GodocURL}}/doc/tos.html">Terms of Service</a></li>
+ <li class="Footer-link"><a href="http://www.google.com/intl/en/policies/privacy/">Privacy Policy</a></li>
+ <li class="Footer-link"><a href="http://golang.org/issues/new?title=x/blog:" target="_blank" rel="noopener">Report issue</a></li>
+ </ul>
+ <a class="Footer-supportedBy" href="https://google.com">Supported by Google</a>
+ </div>
+</footer>
- <p><a href="{{.BasePath}}/index">Blog index</a></p>
-</div><!-- #sidebar -->
-
-<div id="content">
- <h1><a href="{{.BasePath}}/">The Go Blog</a></h1>
- {{template "content" .}}
-</div><!-- #content -->
-
-<div id="footer">
- <p>
- Except as
- <a href="https://developers.google.com/site-policies#restrictions">noted</a>,
- the content of this page is licensed under the Creative Commons
- Attribution 3.0 License,<br>
- and code is licensed under a <a href="https://golang.org/LICENSE">BSD license</a>.<br>
- <a href="https://golang.org/doc/tos.html">Terms of Service</a> |
- <a href="https://www.google.com/intl/en/policies/privacy/">Privacy Policy</a> |
- <a href="https://go.googlesource.com/blog/">View the source code</a>
- </p>
-</div><!-- #footer -->
-
-</div><!-- .container -->
-</div><!-- #page -->
-
-</body>
<script src="/lib/godoc/jquery.js"></script>
<script src="/lib/godoc/playground.js"></script>
<script src="/lib/godoc/play.js"></script>
<script src="/lib/godoc/godocs.js"></script>
<script>
$(function() {
- // Insert line numbers for all playground elements.
- $('.playground > pre.numbers, .code > pre.numbers').each(function() {
- var $spans = $(this).find('> span');
+ // Insert line numbers for all playground elements.
+ $('.playground > pre.numbers, .code > pre.numbers').each(function() {
+ var $spans = $(this).find('> span');
- // Compute width of number column (including trailing space).
- var max = 0;
- $spans.each(function() {
- var n = $(this).attr('num')*1;
- if (n > max) max = n;
- });
- var width = 2;
- while (max > 10) {
- max = max / 10;
- width++;
- }
+ // Compute width of number column (including trailing space).
+ var max = 0;
+ $spans.each(function() {
+ var n = $(this).attr('num')*1;
+ if (n > max) max = n;
+ });
+ var width = 2;
+ while (max > 10) {
+ max = max / 10;
+ width++;
+ }
- // Insert line numbers with space padding.
- $spans.each(function() {
- var n = $(this).attr('num')+' ';
- while (n.length < width) n = ' '+n;
- $('<span class="number">').text(n).insertBefore(this);
- });
- });
+ // Insert line numbers with space padding.
+ $spans.each(function() {
+ var n = $(this).attr('num')+' ';
+ while (n.length < width) n = ' '+n;
+ $('<span class="number">').text(n).insertBefore(this);
+ });
+ });
- initPlayground(new HTTPTransport());
+ initPlayground(new HTTPTransport());
});
</script>
</html>
{{end}}
{{define "doc"}}
- <div class="article" data-slug="{{.Path}}">
- <h3 class="title"><a href="{{.Path}}">{{.Title}}</a></h3>
- <p class="author">
- {{with .Authors}}{{authors .}}<br>{{end}}
- {{.Time.Format "2 January 2006"}}
- </p>
- {{.HTML}}
- </div>
+ <div class="article" data-slug="{{.Path}}">
+ <h2 class="title"><a href="{{.Path}}">{{.Title}}</a></h2>
+ <p class="author">
+ {{with .Authors}}{{authors .}}<br>{{end}}
+ {{.Time.Format "2 January 2006"}}
+ </p>
+ {{.HTML}}
+ </div>
{{end}}