website/_content/blog
Dmitri Shuralyov 2da4c8976c _content/blog: don't load godocs.js (and other scripts) more than once
By now, the /js/godocs.js and /js/playground.js scripts are already
loaded on all go.dev pages because they're included at the bottom of
the root site.tmpl template. The layout template for blog pages also
loads those scripts.

That means /js/godocs.js runs twice, and that causes duplicate anchor
links to be added to article headings.

Remove the duplicate scripts, keeping only play.js which isn't already
present in site.html. Update it to reuse the existing window.initFuncs
mechanism.

For golang/go#68596.
For golang/go#69816.

Change-Id: I709f4b8df30500bddbbf16f4ddd95f266f290472
Reviewed-on: https://go-review.googlesource.com/c/website/+/619015
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2024-10-17 14:51:19 +00:00
..
2years
4years
5years
6years
7years
8years
9years
10years
11years
appengine
chacha8rand
constants
context
contributor-workshop
contributors-summit
contributors-summit-2019
cover
cwg
debug-opt
docker
examples
execution-traces-2024
experiment
first-go-program
generic-slice-functions
gif-decoder
go-brand
go-fonts
go.dev
go1
go1.1
go1.7-binary-size
go1.9
gopher
gopherchina
gophercon
gophercon2015
gophergala
gopls
gopls-scalability
gotelemetry
gothamgo
gouk15
h2push
http-tracing
image
image-draw
intro-generics
io2011
io2014
ismmkeynote
llmpowered
maps
matchlang
module-mirror-launch
modules2019
normalization
osconreport
pipelines
pkgsite-redesign
pkgsite-search-redesign
playground
playground-intro
pprof
qihoo
race-detector
rebuild
slices
slices-intro
stackoverflow
stathat
store
strings
survey2016
survey2017
survey2018
survey2019
survey2020
survey2021
survey2022q2
survey2023h2
survey2023q1
survey2024h1
toward-go2
turkey-doodle
vuln
1year.md
2years.md
3years.md
4years.md
5years.md
6years.md
7years.md
8years.md
9years.md
10years.md
11years.md
12years.md
13years.md
14years.md
README.md
a-conversation-with-the-go-team.md
a-new-go-api-for-protocol-buffers.md
advanced-go-concurrency-patterns.md
alias-names.md _content/blog: use correct type name in article on generic aliases (typo) 2024-10-10 18:21:31 +00:00
all.md
appengine-155.md
appengine-171.md
appengine-dec2013.md
appengine-ga.md
appengine-go111.md
appengine-gopath.md
appengine-scalable.md
appengine.md
bossie.md
building-stathat-with-go.md
c-go-cgo.md
cgo.md
chacha8rand.md
codelab-share.md
community-outreach-working-group.md
company-questionnaire2018.md
comparable.md
compat.md
concurrency-is-not-parallelism.md
concurrency-timeouts.md
conduct-2018.md
conduct-2021.md
constants.md
context-and-structs.md
context.md
contributor-workshop.md
contributors-summit-2019.md
contributors-summit.md
cover.md
cwg.md
deadcode-rta.svg
deadcode.md
debug-gdb.md
debug-opt.md
debug-status.md
debugging-go-code-status-report.md
debugging-go-programs-with-gnu-debugger.md
debugging-what-you-deploy.md
declaration-syntax.md
deconstructing-type-parameters.md
default.tmpl _content/blog: don't load godocs.js (and other scripts) more than once 2024-10-17 14:51:19 +00:00
defer-panic-and-recover.md
developer-experience.md
docker.md
error-handling-and-go.md
errors-are-values.md
examples.md
execution-traces-2024.md
experiment.md
external-libraries.md
first-class-functions-in-go-and-new-go.md
first-go-program.md
fosdem14.md
from-zero-to-go-launching-on-google.md
functions-codewalk.md
fuzz-beta.md
gccgo-in-gcc-471.md
gcdk-whats-new-in-march-2019.md
generate.md
generic-slice-functions.md
generics-next-step.md
generics-proposal.md
get-familiar-with-workspaces.md
getthee-to-go-meetup.md
getting-to-know-go-community.md
gif-decoder-exercise-in-go-interfaces.md
gif-decoder.md
go-11-is-released.md
go-and-google-app-engine.md
go-and-google-cloud-platform.md
go-app-engine-sdk-155-released.md
go-at-google-io-2011-videos.md
go-at-heroku.md
go-at-io-frequently-asked-questions.md
go-becomes-more-stable.md
go-brand.md
go-cloud.md
go-cloud2019.md
go-concurrency-patterns-timing-out-and.md
go-developer-network.md
go-fmt-your-code.md
go-fonts.md
go-for-app-engine-is-now-generally.md
go-image-package.md
go-imagedraw-package.md
go-maps-in-action.md
go-one-year-ago-today.md
go-programming-language-turns-two.md
go-programming-session-video-from.md
go-slices-usage-and-internals.md
go-turns-three.md
go-updates-in-app-engine-171.md
go-videos-from-google-io-2012.md
go-whats-new-in-march-2010.md
go-wins-2010-bossie-award.md
go.dev.md
go1-path.md
go1-preview.md
go1.1.md
go1.2.md
go1.3.md
go1.4.md
go1.5.md
go1.6.md
go1.7-binary-size.md
go1.7.md
go1.8.md
go1.9.md
go1.10.md
go1.11.md
go1.12.md
go1.13-errors.md
go1.13.md
go1.14.md
go1.15-proposals.md
go1.15.md
go1.16.md
go1.17.md
go1.18.md
go1.18beta1.md
go1.18beta2.md
go1.19.md
go1.20.md
go1.21.md
go1.21rc.md
go1.22.md
go1.23.md
go1.md
go2-here-we-come.md
go2-next-steps.md
go2draft.md
go12.md
go15gc.md
go116-module-changes.md
go119runtime.md
gob.md
gobs-of-data.md
godoc-documenting-go-code.md
godoc.md
godoc.org-redirect.md
gofmt.md
gonew.md
gopher.md
gopherchina.md
gophercon.md
gophercon2015.md
gophergala.md
gopls-scalability.md
gopls-vscode-go.md
gos-declaration-syntax.md
gotelemetry.md
gothamgo.md
gouk15.md
govulncheck.md
h2push.md
hello-china.md
hello-world.md
heroku.md
http-tracing.md
image-draw.md
image.md
index.md
integration-test-coverage.md
intro-generics.md
introducing-go-playground.md
introducing-gofix.md
io2010-faq.md
io2010-preview.md
io2010.md
io2011.md
io2012-videos.md
io2013-chat.md
io2013-talk-concurrency.md
io2013-talks-cloud.md
io2014.md
ismmkeynote.md
json-and-go.md
json-rpc-tale-of-interfaces.md
json-rpc.md
json.md
laws-of-reflection.md
learn-go-from-your-browser.md
llmpowered.md
loopvar-preview.md
maps.md
matchlang.md
meetups.md
migrating-to-go-modules.md
module-compatibility.md
module-mirror-launch.md
modules2019.md
new-talk-and-tutorials.md
normalization.md
open-source.md
organizing-go-code.md
oscon.md
osconreport.md
package-names.md
pandemic.md
path-security.md
pgo-preview.md
pgo.md
pipelines.md
pkg.go.dev-2020.md
pkgsite-redesign.md
pkgsite-search-redesign.md
pkgsite.md
playground-intro.md
playground.md
ports.md
pprof.md
preview-of-go-version-1.md
profiling-go-programs.md
protobuf-apiv2.md
protobuf.md
publishing-go-modules.md
qihoo.md
race-detector.md
randv2.md
range-functions.md
real-go-projects-smarttwitter-and-webgo.md
rebuild.md
routing-enhancements.md
share-memory-by-communicating.md
slices-intro.md
slices.md
slog.md
smarttwitter.md
spotlight-on-external-go-libraries.md
stable-releases.md
stackoverflow.md
stathat.md
store.md
strings.md
subtests.md
supply-chain.md
survey2011.md
survey2016-results.md
survey2016.md
survey2017-results.md
survey2017.md
survey2018-company.md
survey2018-results.md
survey2018.md
survey2019-results.md
survey2019.md
survey2020-results.md
survey2020.md
survey2021-results.md
survey2021.md
survey2022-q2-results.md
survey2022-q2.md
survey2023-h2-results.md
survey2023-h2.md
survey2023-q1-results.md
survey2023-q1.md
survey2024-h1-results.md
survey2024-h1.md
survey2024-h2.md
sydney-gtug.md
the-app-engine-sdk-and-workspaces-gopath.md
the-path-to-go-1.md
the-vs-code-go-extension-joins-the-go-project.md
third-party-libraries-goprotobuf-and.md
tidy-web.md
tls-cipher-suites.md
toolchain.md
tour.md
toward-go2.md
turkey-doodle.md
tutorials-go1.18.md
two-go-talks-lexical-scanning-in-go-and.md
two-recent-go-articles.md
two-recent-go-talks.md
type-inference.md
unique.md
upcoming-google-io-go-events.md
using-go-modules.md
v2-go-modules.md
versioning-proposal.md
vscode-go.md
vuln.md
wasi.md
waza-talk.md
when-generics.md
why-generics.md
wire.md
wrap.go
writing-scalable-app-engine.md

README.md

This directory holds Go blog articles, in *.article. See https://pkg.go.dev/golang.org/x/tools/present?tab=doc for documentation of the file format or look at any of the articles for examples.

Article file names should be short, amenable to being typed by hand in URLs. Typically article file names are up to three words, separated by dashes. A trailing year in the name typically does not have a dash before it.

All supporting files for an article, even if there's only one, should be placed in a directory named for the article (minus the .article suffix).

If your article has code that is meant to be a working program, please use .code, or ideally .play, to load the lines from a supporting .go file. That way you can easily check that the .go file, and therefore the code in your article, still works.

Please use .image and .video to embed images and videos, instead of using raw HTML tags. The .image and .video commands provide a way to adjust the implementation of those embeddings all in one place.

Please use .html when it is necessary to add large blocks of HTML, keeping article text in the main .article file. Another important use of .html is to factor out an HTML snippet that appears multiple times. Short HTML sequences, like

or
, are fine to put directly in the article files.