aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRyo Sakuma <ryo.sakuma.public@gmail.com>2026-01-01 14:57:42 +0900
committerGopher Robot <gobot@golang.org>2026-02-02 12:17:52 -0800
commitfd82e1351b3c513e750e028ae21710366483b184 (patch)
tree7c6bf46cdb39f9e51fd1a5b2a3a816521f50c438
parentabbfab71c66250d78554767dae1d5ff386fa92e2 (diff)
downloadgo-x-website-fd82e1351b3c513e750e028ae21710366483b184.tar.xz
internal/web: do not treat Markdown files as templates by default
Markdown files are no longer treated as Go templates by default. Pages that need template processing must explicitly set "template: true" in their front matter. This prevents unintended HTML escaping of template-like syntax (e.g., "<" and ">") in Markdown content. Fixes golang/go#75552 Change-Id: If00328831cd6b119043d9c2055fd21076943e2c4 Reviewed-on: https://go-review.googlesource.com/c/website/+/733500 Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Michael Pratt <mpratt@google.com> Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org> Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
-rw-r--r--_content/blog/10years.md1
-rw-r--r--_content/blog/2years.md1
-rw-r--r--_content/blog/4years.md1
-rw-r--r--_content/blog/5years.md1
-rw-r--r--_content/blog/6years.md1
-rw-r--r--_content/blog/8years.md1
-rw-r--r--_content/blog/9years.md1
-rw-r--r--_content/blog/all.md1
-rw-r--r--_content/blog/appengine-go111.md1
-rw-r--r--_content/blog/chacha8rand.md1
-rw-r--r--_content/blog/codelab-share.md1
-rw-r--r--_content/blog/concurrency-timeouts.md1
-rw-r--r--_content/blog/constants.md1
-rw-r--r--_content/blog/context.md1
-rw-r--r--_content/blog/contributor-workshop.md1
-rw-r--r--_content/blog/contributors-summit-2019.md1
-rw-r--r--_content/blog/contributors-summit.md1
-rw-r--r--_content/blog/cover.md1
-rw-r--r--_content/blog/cwg.md1
-rw-r--r--_content/blog/debug-opt.md1
-rw-r--r--_content/blog/defer-panic-and-recover.md1
-rw-r--r--_content/blog/docker.md1
-rw-r--r--_content/blog/error-handling-and-go.md1
-rw-r--r--_content/blog/examples.md1
-rw-r--r--_content/blog/execution-traces-2024.md1
-rw-r--r--_content/blog/experiment.md1
-rw-r--r--_content/blog/first-go-program.md1
-rw-r--r--_content/blog/flight-recorder.md1
-rw-r--r--_content/blog/fosdem14.md1
-rw-r--r--_content/blog/generate.md1
-rw-r--r--_content/blog/generic-interfaces.md1
-rw-r--r--_content/blog/generic-slice-functions.md1
-rw-r--r--_content/blog/gif-decoder.md1
-rw-r--r--_content/blog/go-brand.md1
-rw-r--r--_content/blog/go-fonts.md1
-rw-r--r--_content/blog/go.dev.md1
-rw-r--r--_content/blog/go1-path.md1
-rw-r--r--_content/blog/go1.1.md1
-rw-r--r--_content/blog/go1.22.md1
-rw-r--r--_content/blog/go1.6.md1
-rw-r--r--_content/blog/go1.7-binary-size.md1
-rw-r--r--_content/blog/go1.8.md1
-rw-r--r--_content/blog/go1.9.md1
-rw-r--r--_content/blog/go1.md1
-rw-r--r--_content/blog/go2draft.md1
-rw-r--r--_content/blog/gopher.md1
-rw-r--r--_content/blog/gopherchina.md1
-rw-r--r--_content/blog/gophercon.md1
-rw-r--r--_content/blog/gophercon2015.md1
-rw-r--r--_content/blog/gophergala.md1
-rw-r--r--_content/blog/gopls-vscode-go.md1
-rw-r--r--_content/blog/gothamgo.md1
-rw-r--r--_content/blog/gouk15.md1
-rw-r--r--_content/blog/greenteagc.md1
-rw-r--r--_content/blog/h2push.md1
-rw-r--r--_content/blog/http-tracing.md1
-rw-r--r--_content/blog/image-draw.md1
-rw-r--r--_content/blog/image.md1
-rw-r--r--_content/blog/index.md1
-rw-r--r--_content/blog/integration-test-coverage.md1
-rw-r--r--_content/blog/intro-generics.md1
-rw-r--r--_content/blog/io2010.md1
-rw-r--r--_content/blog/io2011.md1
-rw-r--r--_content/blog/io2012-videos.md1
-rw-r--r--_content/blog/io2013-chat.md1
-rw-r--r--_content/blog/io2013-talk-concurrency.md1
-rw-r--r--_content/blog/io2013-talks-cloud.md1
-rw-r--r--_content/blog/io2014.md1
-rw-r--r--_content/blog/ismmkeynote.md1
-rw-r--r--_content/blog/laws-of-reflection.md1
-rw-r--r--_content/blog/loopvar-preview.md1
-rw-r--r--_content/blog/maps.md1
-rw-r--r--_content/blog/matchlang.md1
-rw-r--r--_content/blog/module-mirror-launch.md1
-rw-r--r--_content/blog/modules2019.md1
-rw-r--r--_content/blog/normalization.md1
-rw-r--r--_content/blog/osconreport.md1
-rw-r--r--_content/blog/pgo.md1
-rw-r--r--_content/blog/pipelines.md1
-rw-r--r--_content/blog/pkgsite-redesign.md1
-rw-r--r--_content/blog/pkgsite-search-redesign.md1
-rw-r--r--_content/blog/playground-intro.md1
-rw-r--r--_content/blog/playground.md1
-rw-r--r--_content/blog/pprof.md1
-rw-r--r--_content/blog/qihoo.md1
-rw-r--r--_content/blog/race-detector.md1
-rw-r--r--_content/blog/randv2.md1
-rw-r--r--_content/blog/range-functions.md1
-rw-r--r--_content/blog/rebuild.md1
-rw-r--r--_content/blog/slices-intro.md1
-rw-r--r--_content/blog/slices.md1
-rw-r--r--_content/blog/stathat.md1
-rw-r--r--_content/blog/store.md1
-rw-r--r--_content/blog/strings.md1
-rw-r--r--_content/blog/subtests.md1
-rw-r--r--_content/blog/survey2016-results.md1
-rw-r--r--_content/blog/survey2017-results.md1
-rw-r--r--_content/blog/survey2018-results.md1
-rw-r--r--_content/blog/survey2019-results.md1
-rw-r--r--_content/blog/sydney-gtug.md1
-rw-r--r--_content/blog/synctest.md1
-rw-r--r--_content/blog/toward-go2.md1
-rw-r--r--_content/blog/turkey-doodle.md1
-rw-r--r--_content/blog/two-recent-go-talks.md1
-rw-r--r--_content/blog/type-inference.md1
-rw-r--r--_content/blog/waza-talk.md1
-rw-r--r--_content/blog/when-generics.md1
-rw-r--r--_content/blog/why-generics.md1
-rw-r--r--_content/doc/build-cover.md1
-rw-r--r--_content/doc/comment.md1
-rw-r--r--_content/doc/faq.md1
-rw-r--r--_content/doc/go1.1.md1
-rw-r--r--_content/doc/go1.10.md1
-rw-r--r--_content/doc/go1.11.md1
-rw-r--r--_content/doc/go1.12.md1
-rw-r--r--_content/doc/go1.13.md1
-rw-r--r--_content/doc/go1.14.md1
-rw-r--r--_content/doc/go1.15.md1
-rw-r--r--_content/doc/go1.16.md1
-rw-r--r--_content/doc/go1.17.md1
-rw-r--r--_content/doc/go1.18.md1
-rw-r--r--_content/doc/go1.19.md1
-rw-r--r--_content/doc/go1.2.md1
-rw-r--r--_content/doc/go1.20.md1
-rw-r--r--_content/doc/go1.21.md1
-rw-r--r--_content/doc/go1.23.md1
-rw-r--r--_content/doc/go1.24.md1
-rw-r--r--_content/doc/go1.25.md1
-rw-r--r--_content/doc/go1.26.md1
-rw-r--r--_content/doc/go1.3.md1
-rw-r--r--_content/doc/go1.4.md1
-rw-r--r--_content/doc/go1.5.md1
-rw-r--r--_content/doc/go1.6.md1
-rw-r--r--_content/doc/go1.7.md1
-rw-r--r--_content/doc/go1.8.md1
-rw-r--r--_content/doc/go1.9.md1
-rw-r--r--_content/doc/index.html1
-rw-r--r--_content/doc/telemetry.md1
-rw-r--r--_content/doc/tutorial/fuzz.md1
-rw-r--r--_content/index.md1
-rw-r--r--_content/learn/index.md1
-rw-r--r--_content/ref/mod.md1
-rw-r--r--_content/solutions/americanexpress.md1
-rw-r--r--_content/solutions/case-studies.md1
-rw-r--r--_content/solutions/clis.md1
-rw-r--r--_content/solutions/cloud.md1
-rw-r--r--_content/solutions/devops.md1
-rw-r--r--_content/solutions/google/chrome.md1
-rw-r--r--_content/solutions/google/coredata.md1
-rw-r--r--_content/solutions/google/firebase.md1
-rw-r--r--_content/solutions/google/index.md1
-rw-r--r--_content/solutions/google/sitereliability.md1
-rw-r--r--_content/solutions/mercadolibre.md1
-rw-r--r--_content/solutions/paypal.md1
-rw-r--r--_content/solutions/use-cases.md1
-rw-r--r--_content/solutions/webdev.md1
-rw-r--r--cmd/golangorg/testdata/web.txt5
-rw-r--r--internal/web/render.go16
-rw-r--r--internal/web/site.go21
-rw-r--r--internal/web/site_test.go8
160 files changed, 159 insertions, 47 deletions
diff --git a/_content/blog/10years.md b/_content/blog/10years.md
index a69ff4cf..e21aac4a 100644
--- a/_content/blog/10years.md
+++ b/_content/blog/10years.md
@@ -4,6 +4,7 @@ date: 2019-11-08
by:
- Russ Cox, for the Go team
summary: Happy 10th birthday, Go!
+template: true
---
diff --git a/_content/blog/2years.md b/_content/blog/2years.md
index f2fad728..5af326c6 100644
--- a/_content/blog/2years.md
+++ b/_content/blog/2years.md
@@ -8,6 +8,7 @@ tags:
- community
- gopher
summary: Happy 2nd birthday, Go!
+template: true
---
diff --git a/_content/blog/4years.md b/_content/blog/4years.md
index 2e821719..072f1f9f 100644
--- a/_content/blog/4years.md
+++ b/_content/blog/4years.md
@@ -7,6 +7,7 @@ tags:
- community
- birthday
summary: Happy 4th birthday, Go!
+template: true
---
diff --git a/_content/blog/5years.md b/_content/blog/5years.md
index 0b453ecd..bf80957e 100644
--- a/_content/blog/5years.md
+++ b/_content/blog/5years.md
@@ -4,6 +4,7 @@ date: 2014-11-10
by:
- Andrew Gerrand
summary: Happy 5th birthday, Go!
+template: true
---
diff --git a/_content/blog/6years.md b/_content/blog/6years.md
index f49bbcfa..02c762db 100644
--- a/_content/blog/6years.md
+++ b/_content/blog/6years.md
@@ -4,6 +4,7 @@ date: 2015-11-10
by:
- Andrew Gerrand
summary: Happy 6th birthday, Go!
+template: true
---
diff --git a/_content/blog/8years.md b/_content/blog/8years.md
index 03e4bd74..f162bc28 100644
--- a/_content/blog/8years.md
+++ b/_content/blog/8years.md
@@ -7,6 +7,7 @@ tags:
- community
- birthday
summary: Happy 8th birthday, Go!
+template: true
---
diff --git a/_content/blog/9years.md b/_content/blog/9years.md
index 02282c15..8b4e9b9b 100644
--- a/_content/blog/9years.md
+++ b/_content/blog/9years.md
@@ -7,6 +7,7 @@ tags:
- community
- birthday
summary: Happy 9th birthday, Go!
+template: true
---
## Introduction
diff --git a/_content/blog/all.md b/_content/blog/all.md
index b3164049..ce2c18cc 100644
--- a/_content/blog/all.md
+++ b/_content/blog/all.md
@@ -1,5 +1,6 @@
---
title: Blog Index
+template: true
---
<div id="blogindex">
diff --git a/_content/blog/appengine-go111.md b/_content/blog/appengine-go111.md
index f5c02114..4b55967d 100644
--- a/_content/blog/appengine-go111.md
+++ b/_content/blog/appengine-go111.md
@@ -7,6 +7,7 @@ by:
tags:
- appengine
summary: Google Cloud is announcing a new Go 1.11 runtime for App Engine, with fewer limits on app structure.
+template: true
---
diff --git a/_content/blog/chacha8rand.md b/_content/blog/chacha8rand.md
index bb28aa49..d3068ea5 100644
--- a/_content/blog/chacha8rand.md
+++ b/_content/blog/chacha8rand.md
@@ -5,6 +5,7 @@ by:
- Russ Cox
- Filippo Valsorda
summary: ChaCha8Rand is a new cryptographically secure pseudorandom number generator used in Go 1.22.
+template: true
---
Computers aren't random.
diff --git a/_content/blog/codelab-share.md b/_content/blog/codelab-share.md
index 308e0cd4..95929e2f 100644
--- a/_content/blog/codelab-share.md
+++ b/_content/blog/codelab-share.md
@@ -7,6 +7,7 @@ tags:
- concurrency
- technical
summary: A preview of the new Go codelab, Share Memory by Communicating.
+template: true
---
diff --git a/_content/blog/concurrency-timeouts.md b/_content/blog/concurrency-timeouts.md
index ee9ac2b3..1535c792 100644
--- a/_content/blog/concurrency-timeouts.md
+++ b/_content/blog/concurrency-timeouts.md
@@ -7,6 +7,7 @@ tags:
- concurrency
- technical
summary: How to implement timeouts using Go's concurrency support.
+template: true
---
diff --git a/_content/blog/constants.md b/_content/blog/constants.md
index 9219d2ae..4ccae1bd 100644
--- a/_content/blog/constants.md
+++ b/_content/blog/constants.md
@@ -6,6 +6,7 @@ by:
tags:
- constants
summary: An introduction to constants in Go.
+template: true
---
## Introduction
diff --git a/_content/blog/context.md b/_content/blog/context.md
index 1e235a7e..403f63c5 100644
--- a/_content/blog/context.md
+++ b/_content/blog/context.md
@@ -8,6 +8,7 @@ tags:
- cancellation
- context
summary: An introduction to the Go context package.
+template: true
---
## Introduction
diff --git a/_content/blog/contributor-workshop.md b/_content/blog/contributor-workshop.md
index 425fff05..a6daac12 100644
--- a/_content/blog/contributor-workshop.md
+++ b/_content/blog/contributor-workshop.md
@@ -9,6 +9,7 @@ by:
tags:
- community
summary: The Go contributor workshop trained new contributors at GopherCon.
+template: true
---
## Event Overview
diff --git a/_content/blog/contributors-summit-2019.md b/_content/blog/contributors-summit-2019.md
index aca40732..28815c80 100644
--- a/_content/blog/contributors-summit-2019.md
+++ b/_content/blog/contributors-summit-2019.md
@@ -6,6 +6,7 @@ by:
tags:
- community
summary: Reporting from the Go Contributor Summit at GopherCon 2019.
+template: true
---
## Introduction
diff --git a/_content/blog/contributors-summit.md b/_content/blog/contributors-summit.md
index e7bca8eb..c5f7a5c4 100644
--- a/_content/blog/contributors-summit.md
+++ b/_content/blog/contributors-summit.md
@@ -6,6 +6,7 @@ by:
tags:
- community
summary: Reporting from the Go Contributor Summit at GopherCon 2017.
+template: true
---
## Introduction
diff --git a/_content/blog/cover.md b/_content/blog/cover.md
index 97f2ffbd..f05e363e 100644
--- a/_content/blog/cover.md
+++ b/_content/blog/cover.md
@@ -8,6 +8,7 @@ tags:
- coverage
- testing
summary: Introducing Go 1.12's code coverage tool.
+template: true
---
## Introduction
diff --git a/_content/blog/cwg.md b/_content/blog/cwg.md
index 9c9fcb2f..a19d4f04 100644
--- a/_content/blog/cwg.md
+++ b/_content/blog/cwg.md
@@ -6,6 +6,7 @@ by:
tags:
- community
summary: Announcing the Go Community Outreach Working Group (CWG).
+template: true
---
## Announcing the Go Community Outreach Working Group
diff --git a/_content/blog/debug-opt.md b/_content/blog/debug-opt.md
index 92e01bd2..3de678a2 100644
--- a/_content/blog/debug-opt.md
+++ b/_content/blog/debug-opt.md
@@ -7,6 +7,7 @@ tags:
- debug
- technical
summary: Go 1.12 improves support for debugging optimized binaries.
+template: true
---
## Introduction
diff --git a/_content/blog/defer-panic-and-recover.md b/_content/blog/defer-panic-and-recover.md
index 9f82bef5..a3539794 100644
--- a/_content/blog/defer-panic-and-recover.md
+++ b/_content/blog/defer-panic-and-recover.md
@@ -10,6 +10,7 @@ tags:
- technical
- function
summary: An introduction to the Go's defer, panic, and recover control flow mechanisms.
+template: true
---
diff --git a/_content/blog/docker.md b/_content/blog/docker.md
index 9b4a8605..cb2c98bf 100644
--- a/_content/blog/docker.md
+++ b/_content/blog/docker.md
@@ -4,6 +4,7 @@ date: 2014-09-26
by:
- Andrew Gerrand
summary: How to use Docker's new official base images for Go.
+template: true
---
## Introduction
diff --git a/_content/blog/error-handling-and-go.md b/_content/blog/error-handling-and-go.md
index d12df7c5..1250278a 100644
--- a/_content/blog/error-handling-and-go.md
+++ b/_content/blog/error-handling-and-go.md
@@ -9,6 +9,7 @@ tags:
- type
- technical
summary: An introduction to Go errors.
+template: true
---
## Introduction
diff --git a/_content/blog/examples.md b/_content/blog/examples.md
index e65f6e8d..2d17743a 100644
--- a/_content/blog/examples.md
+++ b/_content/blog/examples.md
@@ -7,6 +7,7 @@ tags:
- godoc
- testing
summary: How to add examples, which double as tests, to your packages.
+template: true
---
## Introduction
diff --git a/_content/blog/execution-traces-2024.md b/_content/blog/execution-traces-2024.md
index c1d3d2cc..2db763f6 100644
--- a/_content/blog/execution-traces-2024.md
+++ b/_content/blog/execution-traces-2024.md
@@ -8,6 +8,7 @@ tags:
- technical
- tracing
summary: "New features and improvements to execution traces from the last year."
+template: true
---
The [runtime/trace](/pkg/runtime/trace) package contains a powerful tool for understanding and
diff --git a/_content/blog/experiment.md b/_content/blog/experiment.md
index 176621cb..eab95e69 100644
--- a/_content/blog/experiment.md
+++ b/_content/blog/experiment.md
@@ -8,6 +8,7 @@ tags:
- go2
- proposals
summary: How we develop Go, a talk from GopherCon 2019.
+template: true
---
## Introduction
diff --git a/_content/blog/first-go-program.md b/_content/blog/first-go-program.md
index 981bfed4..4b000b76 100644
--- a/_content/blog/first-go-program.md
+++ b/_content/blog/first-go-program.md
@@ -6,6 +6,7 @@ by:
tags:
- history
summary: Rob Pike dug up the first Go program ever written.
+template: true
---
diff --git a/_content/blog/flight-recorder.md b/_content/blog/flight-recorder.md
index a05d8a18..13ead775 100644
--- a/_content/blog/flight-recorder.md
+++ b/_content/blog/flight-recorder.md
@@ -10,6 +10,7 @@ tags:
- tracing
- flight recorder
summary: Go 1.25 introduces a new tool in the diagnostic toolbox, flight recording.
+template: true
---
In 2024 we introduced the world to
diff --git a/_content/blog/fosdem14.md b/_content/blog/fosdem14.md
index 0a012983..aa006b23 100644
--- a/_content/blog/fosdem14.md
+++ b/_content/blog/fosdem14.md
@@ -8,6 +8,7 @@ tags:
- youtube
- talk
summary: Reporting from the Go Devroom at FOSDEM 2014.
+template: true
---
## Introduction
diff --git a/_content/blog/generate.md b/_content/blog/generate.md
index 50c58e59..ddc274db 100644
--- a/_content/blog/generate.md
+++ b/_content/blog/generate.md
@@ -7,6 +7,7 @@ tags:
- programming
- technical
summary: How to use go generate.
+template: true
---
diff --git a/_content/blog/generic-interfaces.md b/_content/blog/generic-interfaces.md
index 2bd4bed3..32a1e58c 100644
--- a/_content/blog/generic-interfaces.md
+++ b/_content/blog/generic-interfaces.md
@@ -8,6 +8,7 @@ tags:
- generics
- interfaces
summary: Adding type parameters to interface types is surprisingly powerful
+template: true
---
There is an idea that is not obvious until you hear about it for the first time: as interfaces are types themselves, they too can have type parameters.
diff --git a/_content/blog/generic-slice-functions.md b/_content/blog/generic-slice-functions.md
index 914b19f4..9f377eaa 100644
--- a/_content/blog/generic-slice-functions.md
+++ b/_content/blog/generic-slice-functions.md
@@ -4,6 +4,7 @@ date: 2024-02-22
by:
- Valentin Deleplace
summary: Avoiding memory leaks in the slices package.
+template: true
---
The [slices](/pkg/slices) package provides functions that work for slices of any type.
diff --git a/_content/blog/gif-decoder.md b/_content/blog/gif-decoder.md
index e82a1130..64abf2a6 100644
--- a/_content/blog/gif-decoder.md
+++ b/_content/blog/gif-decoder.md
@@ -14,6 +14,7 @@ tags:
- rodent
- technical
summary: How Go's interfaces work nicely in the Go GIF decoder.
+template: true
---
## Introduction
diff --git a/_content/blog/go-brand.md b/_content/blog/go-brand.md
index b45bbbe8..d000db51 100644
--- a/_content/blog/go-brand.md
+++ b/_content/blog/go-brand.md
@@ -6,6 +6,7 @@ by:
tags:
- brand
summary: Go’s new look and logo (don't worry, the mascot isn’t changing!).
+template: true
---
## Introduction
diff --git a/_content/blog/go-fonts.md b/_content/blog/go-fonts.md
index e19e96d4..7305bd0b 100644
--- a/_content/blog/go-fonts.md
+++ b/_content/blog/go-fonts.md
@@ -6,6 +6,7 @@ by:
- Chuck Bigelow
- Rob Pike
summary: Announcing the Go font family, by Bigelow & Holmes.
+template: true
---
<link rel="stylesheet" href="/css/fonts.css">
diff --git a/_content/blog/go.dev.md b/_content/blog/go.dev.md
index 703857f4..d88256af 100644
--- a/_content/blog/go.dev.md
+++ b/_content/blog/go.dev.md
@@ -4,6 +4,7 @@ date: 2019-11-13
by:
- Steve Francia and Julie Qiu
summary: "Announcing go.dev, which answers: who else is using Go, what do they use it for, and how can I find useful Go packages?"
+template: true
---
diff --git a/_content/blog/go1-path.md b/_content/blog/go1-path.md
index 815b0115..bc8d5fa6 100644
--- a/_content/blog/go1-path.md
+++ b/_content/blog/go1-path.md
@@ -8,6 +8,7 @@ tags:
- video
- go1
summary: Watch Rob Pike and Andrew Gerrand's talk, The Path to Go 1.
+template: true
---
diff --git a/_content/blog/go1.1.md b/_content/blog/go1.1.md
index 361d9093..f18d2591 100644
--- a/_content/blog/go1.1.md
+++ b/_content/blog/go1.1.md
@@ -6,6 +6,7 @@ by:
tags:
- release
summary: Go 1.1 is faster, less picky about return statements, and adds method expressions.
+template: true
---
diff --git a/_content/blog/go1.22.md b/_content/blog/go1.22.md
index e4b06726..25945b23 100644
--- a/_content/blog/go1.22.md
+++ b/_content/blog/go1.22.md
@@ -4,6 +4,7 @@ date: 2024-02-06
by:
- Eli Bendersky, on behalf of the Go team
summary: Go 1.22 enhances for loops, brings new standard library functionality and improves performance.
+template: true
---
Today the Go team is thrilled to release Go 1.22,
diff --git a/_content/blog/go1.6.md b/_content/blog/go1.6.md
index d3360e21..d31cf60b 100644
--- a/_content/blog/go1.6.md
+++ b/_content/blog/go1.6.md
@@ -4,6 +4,7 @@ date: 2016-02-17
by:
- Andrew Gerrand
summary: Go 1.6 adds HTTP/2, template blocks, and more.
+template: true
---
diff --git a/_content/blog/go1.7-binary-size.md b/_content/blog/go1.7-binary-size.md
index 98e3659c..7bbb6c73 100644
--- a/_content/blog/go1.7-binary-size.md
+++ b/_content/blog/go1.7-binary-size.md
@@ -4,6 +4,7 @@ date: 2016-08-18
by:
- David Crawshaw
summary: Go 1.7 includes some binary size reductions important for small devices.
+template: true
---
## Introduction
diff --git a/_content/blog/go1.8.md b/_content/blog/go1.8.md
index 34b104a8..179fb730 100644
--- a/_content/blog/go1.8.md
+++ b/_content/blog/go1.8.md
@@ -4,6 +4,7 @@ date: 2017-02-16
by:
- Chris Broadfoot
summary: Go 1.8 adds faster non-x86 compiled code, sub-millisecond garbage collection pauses, HTTP/2 push, and more.
+template: true
---
diff --git a/_content/blog/go1.9.md b/_content/blog/go1.9.md
index 4b5cf6b7..4a233eb9 100644
--- a/_content/blog/go1.9.md
+++ b/_content/blog/go1.9.md
@@ -4,6 +4,7 @@ date: 2017-08-24
by:
- Francesc Campoy
summary: Go 1.9 adds type aliases, bit intrinsics, optimizations, and more.
+template: true
---
diff --git a/_content/blog/go1.md b/_content/blog/go1.md
index 44a658b1..6ee8b69f 100644
--- a/_content/blog/go1.md
+++ b/_content/blog/go1.md
@@ -7,6 +7,7 @@ tags:
- release
- go1
summary: "A major milestone: announcing Go 1, the first stable version of Go."
+template: true
---
diff --git a/_content/blog/go2draft.md b/_content/blog/go2draft.md
index 4bdaf0b4..e5b6e0ed 100644
--- a/_content/blog/go2draft.md
+++ b/_content/blog/go2draft.md
@@ -5,6 +5,7 @@ tags:
- community
- video
summary: Announcing the draft designs for the major Go 2 changes.
+template: true
---
diff --git a/_content/blog/gopher.md b/_content/blog/gopher.md
index 4595822b..2ade054d 100644
--- a/_content/blog/gopher.md
+++ b/_content/blog/gopher.md
@@ -7,6 +7,7 @@ by:
tags:
- gopher
summary: The backstory of the Go gopher.
+template: true
---
diff --git a/_content/blog/gopherchina.md b/_content/blog/gopherchina.md
index df97c4f5..cb7e25d7 100644
--- a/_content/blog/gopherchina.md
+++ b/_content/blog/gopherchina.md
@@ -7,6 +7,7 @@ tags:
- community
- china
summary: Reporting from GopherChina 2015, the first Go conference in China.
+template: true
---
diff --git a/_content/blog/gophercon.md b/_content/blog/gophercon.md
index 31227885..961d1f51 100644
--- a/_content/blog/gophercon.md
+++ b/_content/blog/gophercon.md
@@ -4,6 +4,7 @@ date: 2014-05-28
by:
- Andrew Gerrand
summary: Reporting from GopherCon 2014.
+template: true
---
diff --git a/_content/blog/gophercon2015.md b/_content/blog/gophercon2015.md
index 3e4de143..b655a3ab 100644
--- a/_content/blog/gophercon2015.md
+++ b/_content/blog/gophercon2015.md
@@ -8,6 +8,7 @@ tags:
- report
- gopher
summary: Reporting from GopherCon 2015.
+template: true
---
diff --git a/_content/blog/gophergala.md b/_content/blog/gophergala.md
index abe75748..d03aef89 100644
--- a/_content/blog/gophergala.md
+++ b/_content/blog/gophergala.md
@@ -4,6 +4,7 @@ date: 2015-01-07
by:
- Francesc Campoy
summary: The Gopher Gala, the first global Go hackathon, will take place January 23-25, 2015.
+template: true
---
The [Gopher Gala](http://gophergala.com/) is the first Go hackathon at a
diff --git a/_content/blog/gopls-vscode-go.md b/_content/blog/gopls-vscode-go.md
index 264f6f54..7b9fa57a 100644
--- a/_content/blog/gopls-vscode-go.md
+++ b/_content/blog/gopls-vscode-go.md
@@ -7,6 +7,7 @@ tags:
- tools
- gopls
summary: Gopls, which provides IDE features for Go to many editors, is now used by default in VS Code Go.
+template: true
---
diff --git a/_content/blog/gothamgo.md b/_content/blog/gothamgo.md
index dc2d0d69..c02bf911 100644
--- a/_content/blog/gothamgo.md
+++ b/_content/blog/gothamgo.md
@@ -4,6 +4,7 @@ date: 2015-01-09
by:
- Francesc Campoy
summary: Reporting from GothamGo 2015, the first full-day Go conference in New York City.
+template: true
---
diff --git a/_content/blog/gouk15.md b/_content/blog/gouk15.md
index 8aa65198..89e17718 100644
--- a/_content/blog/gouk15.md
+++ b/_content/blog/gouk15.md
@@ -7,6 +7,7 @@ tags:
- conference
- golanguk
summary: Reporting from GolangUK 2015, the first London Go conference.
+template: true
---
diff --git a/_content/blog/greenteagc.md b/_content/blog/greenteagc.md
index 3089dac4..103056eb 100644
--- a/_content/blog/greenteagc.md
+++ b/_content/blog/greenteagc.md
@@ -8,6 +8,7 @@ tags:
- garbage collection
- performance
summary: Go 1.25 includes a new experimental garbage collector, Green Tea.
+template: true
---
<style type="text/css" scoped>
diff --git a/_content/blog/h2push.md b/_content/blog/h2push.md
index 5aebeeb5..e859e3fc 100644
--- a/_content/blog/h2push.md
+++ b/_content/blog/h2push.md
@@ -8,6 +8,7 @@ tags:
- http
- technical
summary: How to use HTTP/2 server push to reduce page load times.
+template: true
---
## Introduction
diff --git a/_content/blog/http-tracing.md b/_content/blog/http-tracing.md
index fe36df29..ccb37938 100644
--- a/_content/blog/http-tracing.md
+++ b/_content/blog/http-tracing.md
@@ -7,6 +7,7 @@ tags:
- http
- technical
summary: How to use Go 1.7's HTTP tracing to understand your client requests.
+template: true
---
## Introduction
diff --git a/_content/blog/image-draw.md b/_content/blog/image-draw.md
index e3e2a819..5d2fe652 100644
--- a/_content/blog/image-draw.md
+++ b/_content/blog/image-draw.md
@@ -9,6 +9,7 @@ tags:
- libraries
- technical
summary: An introduction to image compositing in Go using the image/draw package.
+template: true
---
## Introduction
diff --git a/_content/blog/image.md b/_content/blog/image.md
index ebfb96c3..f2f89c26 100644
--- a/_content/blog/image.md
+++ b/_content/blog/image.md
@@ -8,6 +8,7 @@ tags:
- libraries
- technical
summary: An introduction to 2-D image processing with the Go image package.
+template: true
---
## Introduction
diff --git a/_content/blog/index.md b/_content/blog/index.md
index e2ee3f84..293f874b 100644
--- a/_content/blog/index.md
+++ b/_content/blog/index.md
@@ -1,5 +1,6 @@
---
title: The Go Blog
+template: true
---
<div id="blogindex">
diff --git a/_content/blog/integration-test-coverage.md b/_content/blog/integration-test-coverage.md
index de99c97f..1b49a4a1 100644
--- a/_content/blog/integration-test-coverage.md
+++ b/_content/blog/integration-test-coverage.md
@@ -4,6 +4,7 @@ date: 2023-03-08
by:
- Than McIntosh
summary: Code coverage for integration tests, available in Go 1.20.
+template: true
---
Code coverage tools help developers determine what fraction of a source code base is executed (covered) when a given test suite is executed.
diff --git a/_content/blog/intro-generics.md b/_content/blog/intro-generics.md
index f68e6bb6..c993faa3 100644
--- a/_content/blog/intro-generics.md
+++ b/_content/blog/intro-generics.md
@@ -8,6 +8,7 @@ tags:
- go2
- generics
summary: An introduction to generics in Go.
+template: true
---
## Introduction
diff --git a/_content/blog/io2010.md b/_content/blog/io2010.md
index 61a54c46..83acd6e6 100644
--- a/_content/blog/io2010.md
+++ b/_content/blog/io2010.md
@@ -7,6 +7,7 @@ tags:
- video
- talk
summary: A talk by Rob Pike and Russ Cox about Go, from Google I/O 2010.
+template: true
---
diff --git a/_content/blog/io2011.md b/_content/blog/io2011.md
index 0b6d7114..551d0b55 100644
--- a/_content/blog/io2011.md
+++ b/_content/blog/io2011.md
@@ -9,6 +9,7 @@ tags:
- talk
- video
summary: Two talks about Go from Google I/O 2011.
+template: true
---
## Introduction
diff --git a/_content/blog/io2012-videos.md b/_content/blog/io2012-videos.md
index f30cb31d..afc29691 100644
--- a/_content/blog/io2012-videos.md
+++ b/_content/blog/io2012-videos.md
@@ -10,6 +10,7 @@ tags:
- appengine
- ethos
summary: Talks about Go from Google I/O 2012.
+template: true
---
## Introduction
diff --git a/_content/blog/io2013-chat.md b/_content/blog/io2013-chat.md
index 34c9ae15..7c1c1cfa 100644
--- a/_content/blog/io2013-chat.md
+++ b/_content/blog/io2013-chat.md
@@ -2,6 +2,7 @@
title: A conversation with the Go team
date: 2013-06-06
summary: At Google I/O 2013, several members of the Go team hosted a "Fireside chat."
+template: true
---
diff --git a/_content/blog/io2013-talk-concurrency.md b/_content/blog/io2013-talk-concurrency.md
index 66d4c211..ebd97b7c 100644
--- a/_content/blog/io2013-talk-concurrency.md
+++ b/_content/blog/io2013-talk-concurrency.md
@@ -8,6 +8,7 @@ tags:
- video
- concurrency
summary: Watch Sameer Ajmani's talk, “Advanced Go Concurrency Patterns,” from Google I/O 2013.
+template: true
---
diff --git a/_content/blog/io2013-talks-cloud.md b/_content/blog/io2013-talks-cloud.md
index e7def217..76670b0f 100644
--- a/_content/blog/io2013-talks-cloud.md
+++ b/_content/blog/io2013-talks-cloud.md
@@ -4,6 +4,7 @@ date: 2013-06-12
by:
- Andrew Gerrand
summary: Two talks about using Go with the Google Cloud Platform, from Google I/O 2013.
+template: true
---
## Introduction
diff --git a/_content/blog/io2014.md b/_content/blog/io2014.md
index d7fe8679..bf4d2a55 100644
--- a/_content/blog/io2014.md
+++ b/_content/blog/io2014.md
@@ -8,6 +8,7 @@ tags:
- io
- report
summary: Reporting from Google I/O 2014 and the GoSF Go SummerFest.
+template: true
---
## Introduction
diff --git a/_content/blog/ismmkeynote.md b/_content/blog/ismmkeynote.md
index b5243644..0c49ad7e 100644
--- a/_content/blog/ismmkeynote.md
+++ b/_content/blog/ismmkeynote.md
@@ -4,6 +4,7 @@ date: 2018-07-12
by:
- Rick Hudson
summary: A technical talk about the structure and details of the new, low-latency Go garbage collector.
+template: true
---
diff --git a/_content/blog/laws-of-reflection.md b/_content/blog/laws-of-reflection.md
index 4bcd0696..4cf2edbc 100644
--- a/_content/blog/laws-of-reflection.md
+++ b/_content/blog/laws-of-reflection.md
@@ -9,6 +9,7 @@ tags:
- type
- technical
summary: How reflections works in Go, how to think about it, and how to use it.
+template: true
---
## Introduction
diff --git a/_content/blog/loopvar-preview.md b/_content/blog/loopvar-preview.md
index 336fd3c3..0c88dccf 100644
--- a/_content/blog/loopvar-preview.md
+++ b/_content/blog/loopvar-preview.md
@@ -5,6 +5,7 @@ by:
- David Chase
- Russ Cox
summary: Go 1.21 shipped a preview of a change in Go 1.22 to make for loops less error-prone.
+template: true
---
Go 1.21 includes a preview of a change to `for` loop scoping
diff --git a/_content/blog/maps.md b/_content/blog/maps.md
index 2766ed13..aaebca3b 100644
--- a/_content/blog/maps.md
+++ b/_content/blog/maps.md
@@ -7,6 +7,7 @@ tags:
- map
- technical
summary: How and when to use Go maps.
+template: true
---
## Introduction
diff --git a/_content/blog/matchlang.md b/_content/blog/matchlang.md
index 884dbe7e..6ae43f50 100644
--- a/_content/blog/matchlang.md
+++ b/_content/blog/matchlang.md
@@ -11,6 +11,7 @@ tags:
- 47
- matching
summary: How to internationalize your web site with Go's language and locale matching.
+template: true
---
## Introduction
diff --git a/_content/blog/module-mirror-launch.md b/_content/blog/module-mirror-launch.md
index 5fbe7d82..05602d3b 100644
--- a/_content/blog/module-mirror-launch.md
+++ b/_content/blog/module-mirror-launch.md
@@ -7,6 +7,7 @@ tags:
- tools
- versioning
summary: The Go module mirror and checksum database provide faster, verified downloads of your Go dependencies.
+template: true
---
diff --git a/_content/blog/modules2019.md b/_content/blog/modules2019.md
index da803f34..2b896d5a 100644
--- a/_content/blog/modules2019.md
+++ b/_content/blog/modules2019.md
@@ -7,6 +7,7 @@ tags:
- tools
- versioning
summary: What the Go team is planning for Go modules in 2019.
+template: true
---
## What a year!
diff --git a/_content/blog/normalization.md b/_content/blog/normalization.md
index 20db7957..948e7cbb 100644
--- a/_content/blog/normalization.md
+++ b/_content/blog/normalization.md
@@ -9,6 +9,7 @@ tags:
- runes
- characters
summary: How and why to normalize UTF-8 text in Go.
+template: true
---
## Introduction
diff --git a/_content/blog/osconreport.md b/_content/blog/osconreport.md
index 1b69fcf5..53d8e055 100644
--- a/_content/blog/osconreport.md
+++ b/_content/blog/osconreport.md
@@ -7,6 +7,7 @@ tags:
- conference
- oscon
summary: Reporting from OSCON 2014.
+template: true
---
## Introduction
diff --git a/_content/blog/pgo.md b/_content/blog/pgo.md
index 3d96feb2..28fdfa4d 100644
--- a/_content/blog/pgo.md
+++ b/_content/blog/pgo.md
@@ -4,6 +4,7 @@ date: 2023-09-05
by:
- Michael Pratt
summary: Introduction to profile-guided optimization, generally available in Go 1.21.
+template: true
---
Earlier in 2023, Go 1.20 [shipped a preview of profile-guided optimization (PGO)](/blog/pgo-preview) for users to test.
diff --git a/_content/blog/pipelines.md b/_content/blog/pipelines.md
index 89963a09..91be4b6e 100644
--- a/_content/blog/pipelines.md
+++ b/_content/blog/pipelines.md
@@ -8,6 +8,7 @@ tags:
- pipelines
- cancellation
summary: How to use Go's concurrency to build data-processing pipelines.
+template: true
---
## Introduction
diff --git a/_content/blog/pkgsite-redesign.md b/_content/blog/pkgsite-redesign.md
index a3451ae7..7fef1716 100644
--- a/_content/blog/pkgsite-redesign.md
+++ b/_content/blog/pkgsite-redesign.md
@@ -4,6 +4,7 @@ date: 2020-11-10T12:00:00Z
by:
- Julie Qiu
summary: Announcing a new user experience on pkg.go.dev.
+template: true
---
diff --git a/_content/blog/pkgsite-search-redesign.md b/_content/blog/pkgsite-search-redesign.md
index 864611d1..b0d37b7a 100644
--- a/_content/blog/pkgsite-search-redesign.md
+++ b/_content/blog/pkgsite-search-redesign.md
@@ -4,6 +4,7 @@ date: 2021-11-09
by:
- Julie Qiu
summary: Package search on pkg.go.dev has been updated, and you can now search for symbols!
+template: true
---
We are excited to launch a new search experience on [pkg.go.dev](https://pkg.go.dev/).
diff --git a/_content/blog/playground-intro.md b/_content/blog/playground-intro.md
index be581898..74c3f84d 100644
--- a/_content/blog/playground-intro.md
+++ b/_content/blog/playground-intro.md
@@ -6,6 +6,7 @@ by:
tags:
- playground
summary: "Announcing the Go Playground, https://play.golang.org/."
+template: true
---
diff --git a/_content/blog/playground.md b/_content/blog/playground.md
index 5c9853a7..d48d4757 100644
--- a/_content/blog/playground.md
+++ b/_content/blog/playground.md
@@ -6,6 +6,7 @@ by:
tags:
- playground
summary: How the Go playground works.
+template: true
---
## Introduction
diff --git a/_content/blog/pprof.md b/_content/blog/pprof.md
index d4041761..246a7b99 100644
--- a/_content/blog/pprof.md
+++ b/_content/blog/pprof.md
@@ -9,6 +9,7 @@ tags:
- profiling
- technical
summary: How to use Go's built-in profiler to understand and optimize your programs.
+template: true
---
diff --git a/_content/blog/qihoo.md b/_content/blog/qihoo.md
index 2478f0e5..af663992 100644
--- a/_content/blog/qihoo.md
+++ b/_content/blog/qihoo.md
@@ -4,6 +4,7 @@ date: 2015-07-06
by:
- Yang Zhou
summary: How Qihoo 360 uses Go.
+template: true
---
diff --git a/_content/blog/race-detector.md b/_content/blog/race-detector.md
index ca8ecae9..ee11a7c7 100644
--- a/_content/blog/race-detector.md
+++ b/_content/blog/race-detector.md
@@ -8,6 +8,7 @@ tags:
- concurrency
- technical
summary: How and why to use the Go race detector to improve your programs.
+template: true
---
## Introduction
diff --git a/_content/blog/randv2.md b/_content/blog/randv2.md
index de7fdf03..8a2c9862 100644
--- a/_content/blog/randv2.md
+++ b/_content/blog/randv2.md
@@ -4,6 +4,7 @@ date: 2024-05-01
by:
- Russ Cox
summary: Go 1.22 adds math/rand/v2 and charts a course for the evolution of the Go standard library.
+template: true
---
Since Go 1 was [released in March 2012](/blog/go1),
diff --git a/_content/blog/range-functions.md b/_content/blog/range-functions.md
index 6d0dac0c..9db549f9 100644
--- a/_content/blog/range-functions.md
+++ b/_content/blog/range-functions.md
@@ -6,6 +6,7 @@ by:
tags:
- iterators
summary: A description of range over function types, a new feature in Go 1.23.
+template: true
---
## Introduction
diff --git a/_content/blog/rebuild.md b/_content/blog/rebuild.md
index 84ac636a..455975dd 100644
--- a/_content/blog/rebuild.md
+++ b/_content/blog/rebuild.md
@@ -4,6 +4,7 @@ date: 2023-08-28
by:
- Russ Cox
summary: Go 1.21 is the first perfectly reproducible Go toolchain.
+template: true
---
One of the key benefits of open-source software is that anyone can read
diff --git a/_content/blog/slices-intro.md b/_content/blog/slices-intro.md
index 0955996d..88c8ddc5 100644
--- a/_content/blog/slices-intro.md
+++ b/_content/blog/slices-intro.md
@@ -7,6 +7,7 @@ tags:
- slice
- technical
summary: How to use Go slices, and how they work.
+template: true
---
## Introduction
diff --git a/_content/blog/slices.md b/_content/blog/slices.md
index 2f2146ed..03f5539a 100644
--- a/_content/blog/slices.md
+++ b/_content/blog/slices.md
@@ -10,6 +10,7 @@ tags:
- copy
- append
summary: How Go arrays and slices work, and how to use copy and append.
+template: true
---
## Introduction
diff --git a/_content/blog/stathat.md b/_content/blog/stathat.md
index e2b79e97..7cfa73d4 100644
--- a/_content/blog/stathat.md
+++ b/_content/blog/stathat.md
@@ -6,6 +6,7 @@ by:
tags:
- guest
summary: How StatHat uses Go, and why they chose it.
+template: true
---
## Introduction
diff --git a/_content/blog/store.md b/_content/blog/store.md
index 2e60adf2..96769575 100644
--- a/_content/blog/store.md
+++ b/_content/blog/store.md
@@ -4,6 +4,7 @@ date: 2019-07-18
by:
- Cassandra Salisbury
summary: Unfortunately, the Go store is offline.
+template: true
---
diff --git a/_content/blog/strings.md b/_content/blog/strings.md
index d46e4730..accd034c 100644
--- a/_content/blog/strings.md
+++ b/_content/blog/strings.md
@@ -9,6 +9,7 @@ tags:
- runes
- characters
summary: How strings work in Go, and how to use them.
+template: true
---
## Introduction
diff --git a/_content/blog/subtests.md b/_content/blog/subtests.md
index a8bb64af..3ece61a3 100644
--- a/_content/blog/subtests.md
+++ b/_content/blog/subtests.md
@@ -10,6 +10,7 @@ tags:
- subtests
- sub-benchmarks
summary: How to use Go 1.7's new subtests and sub-benchmarks.
+template: true
---
## Introduction
diff --git a/_content/blog/survey2016-results.md b/_content/blog/survey2016-results.md
index 1df95fb0..681ccde4 100644
--- a/_content/blog/survey2016-results.md
+++ b/_content/blog/survey2016-results.md
@@ -7,6 +7,7 @@ tags:
- survey
- community
summary: What we learned from the December 2017 Go User Survey.
+template: true
---
## Thank you
diff --git a/_content/blog/survey2017-results.md b/_content/blog/survey2017-results.md
index 85b00deb..b81ad126 100644
--- a/_content/blog/survey2017-results.md
+++ b/_content/blog/survey2017-results.md
@@ -7,6 +7,7 @@ tags:
- survey
- community
summary: What we learned from the December 2017 Go User Survey.
+template: true
---
## Thank you
diff --git a/_content/blog/survey2018-results.md b/_content/blog/survey2018-results.md
index 79078aaa..f9a66666 100644
--- a/_content/blog/survey2018-results.md
+++ b/_content/blog/survey2018-results.md
@@ -7,6 +7,7 @@ tags:
- survey
- community
summary: What we learned from the December 2018 Go User Survey.
+template: true
---
## Thank you
diff --git a/_content/blog/survey2019-results.md b/_content/blog/survey2019-results.md
index 8094c91c..6b6ac49c 100644
--- a/_content/blog/survey2019-results.md
+++ b/_content/blog/survey2019-results.md
@@ -7,6 +7,7 @@ tags:
- survey
- community
summary: An analysis of the results from the 2019 Go Developer Survey.
+template: true
---
## What a response!
diff --git a/_content/blog/sydney-gtug.md b/_content/blog/sydney-gtug.md
index e05661d8..384bef6a 100644
--- a/_content/blog/sydney-gtug.md
+++ b/_content/blog/sydney-gtug.md
@@ -9,6 +9,7 @@ tags:
- talk
- video
summary: "Two talks about Go from the Sydney GTUG: Rob Pike explains lexical scanning, and Andrew Gerrand builds a simple real-time chat using App Engine."
+template: true
---
diff --git a/_content/blog/synctest.md b/_content/blog/synctest.md
index 72f5e3a3..6b4f9cde 100644
--- a/_content/blog/synctest.md
+++ b/_content/blog/synctest.md
@@ -7,6 +7,7 @@ tags:
- concurrency
- testing
summary: Go 1.24 contains an experimental package to aid in testing concurrent code.
+template: true
---
One of Go's signature features is built-in support for concurrency.
diff --git a/_content/blog/toward-go2.md b/_content/blog/toward-go2.md
index 8487376e..64dc8d71 100644
--- a/_content/blog/toward-go2.md
+++ b/_content/blog/toward-go2.md
@@ -6,6 +6,7 @@ by:
tags:
- community
summary: How we will all work together toward Go 2.
+template: true
---
## Introduction
diff --git a/_content/blog/turkey-doodle.md b/_content/blog/turkey-doodle.md
index 8d167b75..a5f6b765 100644
--- a/_content/blog/turkey-doodle.md
+++ b/_content/blog/turkey-doodle.md
@@ -8,6 +8,7 @@ tags:
- google
- guest
summary: How Go helped launch the Google Doodle for Thanksgiving 2011.
+template: true
---
## Introduction
diff --git a/_content/blog/two-recent-go-talks.md b/_content/blog/two-recent-go-talks.md
index f1f80455..e79798cb 100644
--- a/_content/blog/two-recent-go-talks.md
+++ b/_content/blog/two-recent-go-talks.md
@@ -8,6 +8,7 @@ tags:
- video
- ethos
summary: "Two Go talks: “Go: A Simple Programming Environment” and “Go: Code That Grows With Grace”."
+template: true
---
## Introduction
diff --git a/_content/blog/type-inference.md b/_content/blog/type-inference.md
index 264e8852..27f7066b 100644
--- a/_content/blog/type-inference.md
+++ b/_content/blog/type-inference.md
@@ -5,6 +5,7 @@ by:
- Robert Griesemer
summary: A description of how type inference for Go works.
Based on the GopherCon 2023 talk with the same title.
+template: true
---
This is the blog version of my talk on type inference at GopherCon 2023 in San Diego,
diff --git a/_content/blog/waza-talk.md b/_content/blog/waza-talk.md
index 953a328e..960fdc1c 100644
--- a/_content/blog/waza-talk.md
+++ b/_content/blog/waza-talk.md
@@ -8,6 +8,7 @@ tags:
- talk
- video
summary: Watch Rob Pike's talk, _Concurrency is not parallelism._
+template: true
---
diff --git a/_content/blog/when-generics.md b/_content/blog/when-generics.md
index 28939a91..ff799e22 100644
--- a/_content/blog/when-generics.md
+++ b/_content/blog/when-generics.md
@@ -7,6 +7,7 @@ tags:
- go2
- generics
summary: When to use generics when writing Go code, and when not to use them.
+template: true
---
## Introduction
diff --git a/_content/blog/why-generics.md b/_content/blog/why-generics.md
index 9e02e833..bce3a0fa 100644
--- a/_content/blog/why-generics.md
+++ b/_content/blog/why-generics.md
@@ -8,6 +8,7 @@ tags:
- proposals
- generics
summary: Why should we add generics to Go, and what might they look like?
+template: true
---
## Introduction
diff --git a/_content/doc/build-cover.md b/_content/doc/build-cover.md
index 00f68b94..de520426 100644
--- a/_content/doc/build-cover.md
+++ b/_content/doc/build-cover.md
@@ -1,6 +1,7 @@
---
title: Coverage profiling support for integration tests
layout: article
+template: true
---
Table of Contents:
diff --git a/_content/doc/comment.md b/_content/doc/comment.md
index 900074a1..6cf2b909 100644
--- a/_content/doc/comment.md
+++ b/_content/doc/comment.md
@@ -2,6 +2,7 @@
title: "Go Doc Comments"
layout: article
date: 2022-06-01T00:00:00Z
+template: true
---
Table of Contents:
diff --git a/_content/doc/faq.md b/_content/doc/faq.md
index 14c0a667..d151eae1 100644
--- a/_content/doc/faq.md
+++ b/_content/doc/faq.md
@@ -2,6 +2,7 @@
title: "Frequently Asked Questions (FAQ)"
sidebar: "faq"
breadcrumb: true
+template: true
---
## Origins {#Origins}
diff --git a/_content/doc/go1.1.md b/_content/doc/go1.1.md
index 57138c8d..a13c69e5 100644
--- a/_content/doc/go1.1.md
+++ b/_content/doc/go1.1.md
@@ -1,5 +1,4 @@
---
-template: false
title: Go 1.1 Release Notes
---
diff --git a/_content/doc/go1.10.md b/_content/doc/go1.10.md
index 7feed251..8d9f93af 100644
--- a/_content/doc/go1.10.md
+++ b/_content/doc/go1.10.md
@@ -1,5 +1,4 @@
---
-template: false
title: Go 1.10 Release Notes
---
diff --git a/_content/doc/go1.11.md b/_content/doc/go1.11.md
index 89d1cdf1..8d993bf9 100644
--- a/_content/doc/go1.11.md
+++ b/_content/doc/go1.11.md
@@ -1,5 +1,4 @@
---
-template: false
title: Go 1.11 Release Notes
---
diff --git a/_content/doc/go1.12.md b/_content/doc/go1.12.md
index f28bb189..425b6a75 100644
--- a/_content/doc/go1.12.md
+++ b/_content/doc/go1.12.md
@@ -1,5 +1,4 @@
---
-template: false
title: Go 1.12 Release Notes
---
diff --git a/_content/doc/go1.13.md b/_content/doc/go1.13.md
index 3a0ee5a3..99c1ccc2 100644
--- a/_content/doc/go1.13.md
+++ b/_content/doc/go1.13.md
@@ -1,5 +1,4 @@
---
-template: false
title: Go 1.13 Release Notes
---
diff --git a/_content/doc/go1.14.md b/_content/doc/go1.14.md
index ba8976d7..8d9c98b9 100644
--- a/_content/doc/go1.14.md
+++ b/_content/doc/go1.14.md
@@ -1,5 +1,4 @@
---
-template: false
title: Go 1.14 Release Notes
---
diff --git a/_content/doc/go1.15.md b/_content/doc/go1.15.md
index 2a8afa0d..56702053 100644
--- a/_content/doc/go1.15.md
+++ b/_content/doc/go1.15.md
@@ -1,5 +1,4 @@
---
-template: false
title: Go 1.15 Release Notes
---
diff --git a/_content/doc/go1.16.md b/_content/doc/go1.16.md
index 762295c1..7a4d917c 100644
--- a/_content/doc/go1.16.md
+++ b/_content/doc/go1.16.md
@@ -1,5 +1,4 @@
---
-template: false
title: Go 1.16 Release Notes
---
diff --git a/_content/doc/go1.17.md b/_content/doc/go1.17.md
index ba02b630..3f3f23f5 100644
--- a/_content/doc/go1.17.md
+++ b/_content/doc/go1.17.md
@@ -1,6 +1,5 @@
---
path: /doc/go1.17
-template: false
title: Go 1.17 Release Notes
---
diff --git a/_content/doc/go1.18.md b/_content/doc/go1.18.md
index be8d8457..1df6d557 100644
--- a/_content/doc/go1.18.md
+++ b/_content/doc/go1.18.md
@@ -1,6 +1,5 @@
---
path: /doc/go1.18
-template: false
title: Go 1.18 Release Notes
---
diff --git a/_content/doc/go1.19.md b/_content/doc/go1.19.md
index ae72d593..2e6e6494 100644
--- a/_content/doc/go1.19.md
+++ b/_content/doc/go1.19.md
@@ -1,6 +1,5 @@
---
path: /doc/go1.19
-template: false
title: Go 1.19 Release Notes
---
diff --git a/_content/doc/go1.2.md b/_content/doc/go1.2.md
index 6667c2bf..bc08af00 100644
--- a/_content/doc/go1.2.md
+++ b/_content/doc/go1.2.md
@@ -1,5 +1,4 @@
---
-template: false
title: Go 1.2 Release Notes
---
diff --git a/_content/doc/go1.20.md b/_content/doc/go1.20.md
index ee91a628..088ea75a 100644
--- a/_content/doc/go1.20.md
+++ b/_content/doc/go1.20.md
@@ -1,6 +1,5 @@
---
path: /doc/go1.20
-template: false
title: Go 1.20 Release Notes
---
diff --git a/_content/doc/go1.21.md b/_content/doc/go1.21.md
index f9caaa68..b4a94a54 100644
--- a/_content/doc/go1.21.md
+++ b/_content/doc/go1.21.md
@@ -1,6 +1,5 @@
---
path: /doc/go1.21
-template: false
title: Go 1.21 Release Notes
---
diff --git a/_content/doc/go1.23.md b/_content/doc/go1.23.md
index 3f9133ac..d0f1fff7 100644
--- a/_content/doc/go1.23.md
+++ b/_content/doc/go1.23.md
@@ -1,6 +1,5 @@
---
title: Go 1.23 Release Notes
-template: false
---
<!--
diff --git a/_content/doc/go1.24.md b/_content/doc/go1.24.md
index 1108fc65..70031bcd 100644
--- a/_content/doc/go1.24.md
+++ b/_content/doc/go1.24.md
@@ -1,6 +1,5 @@
---
title: Go 1.24 Release Notes
-template: false
---
<style>
diff --git a/_content/doc/go1.25.md b/_content/doc/go1.25.md
index bd1ee2dd..fa62c04d 100644
--- a/_content/doc/go1.25.md
+++ b/_content/doc/go1.25.md
@@ -1,6 +1,5 @@
---
title: Go 1.25 Release Notes
-template: false
---
<style>
diff --git a/_content/doc/go1.26.md b/_content/doc/go1.26.md
index 413a5e82..a12c30e4 100644
--- a/_content/doc/go1.26.md
+++ b/_content/doc/go1.26.md
@@ -1,6 +1,5 @@
---
title: Go 1.26 Release Notes
-template: false
---
<style>
diff --git a/_content/doc/go1.3.md b/_content/doc/go1.3.md
index 7526cdf2..60dfe987 100644
--- a/_content/doc/go1.3.md
+++ b/_content/doc/go1.3.md
@@ -1,5 +1,4 @@
---
-template: false
title: Go 1.3 Release Notes
---
diff --git a/_content/doc/go1.4.md b/_content/doc/go1.4.md
index 75024d30..2e859ddc 100644
--- a/_content/doc/go1.4.md
+++ b/_content/doc/go1.4.md
@@ -1,5 +1,4 @@
---
-template: false
title: Go 1.4 Release Notes
---
diff --git a/_content/doc/go1.5.md b/_content/doc/go1.5.md
index 9ce14e11..d73ddc2e 100644
--- a/_content/doc/go1.5.md
+++ b/_content/doc/go1.5.md
@@ -1,5 +1,4 @@
---
-template: false
title: Go 1.5 Release Notes
---
diff --git a/_content/doc/go1.6.md b/_content/doc/go1.6.md
index 91a8fc26..452845f8 100644
--- a/_content/doc/go1.6.md
+++ b/_content/doc/go1.6.md
@@ -1,5 +1,4 @@
---
-template: false
title: Go 1.6 Release Notes
---
diff --git a/_content/doc/go1.7.md b/_content/doc/go1.7.md
index 8a85d527..10e89a3c 100644
--- a/_content/doc/go1.7.md
+++ b/_content/doc/go1.7.md
@@ -1,5 +1,4 @@
---
-template: false
title: Go 1.7 Release Notes
---
diff --git a/_content/doc/go1.8.md b/_content/doc/go1.8.md
index ecf70252..f73d56cc 100644
--- a/_content/doc/go1.8.md
+++ b/_content/doc/go1.8.md
@@ -1,5 +1,4 @@
---
-template: false
title: Go 1.8 Release Notes
---
diff --git a/_content/doc/go1.9.md b/_content/doc/go1.9.md
index 076fed39..119b4a4a 100644
--- a/_content/doc/go1.9.md
+++ b/_content/doc/go1.9.md
@@ -1,5 +1,4 @@
---
-template: false
title: Go 1.9 Release Notes
---
diff --git a/_content/doc/index.html b/_content/doc/index.html
index dcd70953..a4026665 100644
--- a/_content/doc/index.html
+++ b/_content/doc/index.html
@@ -1,6 +1,5 @@
<!--{
"Title": "Documentation",
- "Template": true,
"HideTOC": true
}-->
diff --git a/_content/doc/telemetry.md b/_content/doc/telemetry.md
index 278e8c25..4aa2088b 100644
--- a/_content/doc/telemetry.md
+++ b/_content/doc/telemetry.md
@@ -3,6 +3,7 @@ title: "Go Telemetry"
layout: article
breadcrumb: true
date: 2024-02-07:00:00Z
+template: true
---
<style>
diff --git a/_content/doc/tutorial/fuzz.md b/_content/doc/tutorial/fuzz.md
index f3916fe7..c187c2fb 100644
--- a/_content/doc/tutorial/fuzz.md
+++ b/_content/doc/tutorial/fuzz.md
@@ -1,4 +1,5 @@
<!--{
+ "Template": true,
"Title": "Tutorial: Getting started with fuzzing",
"HideTOC": true,
"Breadcrumb": true
diff --git a/_content/index.md b/_content/index.md
index e4b6101b..7e0044e3 100644
--- a/_content/index.md
+++ b/_content/index.md
@@ -1,6 +1,7 @@
---
title: The Go Programming Language
summary: Go is an open source programming language that makes it simple to build secure, scalable systems.
+template: true
---
{{$canShare := not googleCN}}
diff --git a/_content/learn/index.md b/_content/learn/index.md
index b4b1c012..3213372f 100644
--- a/_content/learn/index.md
+++ b/_content/learn/index.md
@@ -1,6 +1,7 @@
---
title: "Get Started"
breadcrumbTitle: "Learn"
+template: true
---
<section class="Learn-hero">
diff --git a/_content/ref/mod.md b/_content/ref/mod.md
index c75a60ca..bfcec7d1 100644
--- a/_content/ref/mod.md
+++ b/_content/ref/mod.md
@@ -1,4 +1,5 @@
<!--{
+ "Template": true,
"Title": "Go Modules Reference"
}-->
<!-- TODO(golang.org/issue/33637): Write focused "guide" articles on specific
diff --git a/_content/solutions/americanexpress.md b/_content/solutions/americanexpress.md
index 720ccd67..11b2f675 100644
--- a/_content/solutions/americanexpress.md
+++ b/_content/solutions/americanexpress.md
@@ -7,6 +7,7 @@ heroImgSrc: go_amex_case_study_logo.png
carouselImgSrc: go_amex_case_study.png
date: 2019-12-19
series: Case Studies
+template: true
quote: Go provides American Express with the speed and scalability it needs for both its payment and rewards networks.
---
diff --git a/_content/solutions/case-studies.md b/_content/solutions/case-studies.md
index 04a8d6fb..9dd90d4c 100644
--- a/_content/solutions/case-studies.md
+++ b/_content/solutions/case-studies.md
@@ -1,6 +1,7 @@
---
title: Case Studies
layout: none
+template: true
---
{{$solutions := pages "/solutions/*"}}
diff --git a/_content/solutions/clis.md b/_content/solutions/clis.md
index 2822a309..9fe98daa 100644
--- a/_content/solutions/clis.md
+++ b/_content/solutions/clis.md
@@ -4,6 +4,7 @@ linkTitle: "Command-line Interfaces (CLIs)"
description: "With popular open source packages and a robust standard library, use Go to create fast and elegant CLIs."
date: 2019-10-04T15:26:31-04:00
series: Use Cases
+template: true
icon:
file: clis-green.svg
alt: CLI icon
diff --git a/_content/solutions/cloud.md b/_content/solutions/cloud.md
index 282235d2..9e169fa8 100644
--- a/_content/solutions/cloud.md
+++ b/_content/solutions/cloud.md
@@ -4,6 +4,7 @@ linkTitle: "Cloud & Network Services"
description: "With a strong ecosystem of tools and APIs on major cloud providers, it is easier than ever to build services with Go."
date: 2019-10-04T15:26:31-04:00
series: Use Cases
+template: true
icon:
file: cloud-green.svg
alt: cloud icon
diff --git a/_content/solutions/devops.md b/_content/solutions/devops.md
index 1dbab143..ebd57c2d 100644
--- a/_content/solutions/devops.md
+++ b/_content/solutions/devops.md
@@ -4,6 +4,7 @@ linkTitle: "Development Operations & Site Reliability Engineering"
description: "With fast build times, lean syntax, an automatic formatter and doc generator, Go is built to support both DevOps and SRE."
date: 2019-10-03T17:16:43-04:00
series: Use Cases
+template: true
books:
icon:
file: devops-green.svg
diff --git a/_content/solutions/google/chrome.md b/_content/solutions/google/chrome.md
index 3538df8f..ac56524c 100644
--- a/_content/solutions/google/chrome.md
+++ b/_content/solutions/google/chrome.md
@@ -5,6 +5,7 @@ logoSrc: chrome.svg
logoSrcDark: chrome.svg
heroImgSrc: go_chrome_case_study.png
series: Case Studies
+template: true
quote: |
Google Chrome is a more simple, secure, and faster web browser than ever,
with Google's smarts built-in.
diff --git a/_content/solutions/google/coredata.md b/_content/solutions/google/coredata.md
index 2f9667a7..17ad3735 100644
--- a/_content/solutions/google/coredata.md
+++ b/_content/solutions/google/coredata.md
@@ -5,6 +5,7 @@ logoSrc: google.svg
logoSrcDark: google.svg
heroImgSrc: go_core_data_case_study.png
series: Case Studies
+template: true
quote: |
Google is a technology company whose mission is to organize the world’s
information and make it universally accessible and useful.
diff --git a/_content/solutions/google/firebase.md b/_content/solutions/google/firebase.md
index 52ccc581..a18e57f8 100644
--- a/_content/solutions/google/firebase.md
+++ b/_content/solutions/google/firebase.md
@@ -5,6 +5,7 @@ logoSrc: firebase.svg
logoSrcDark: firebase.svg
heroImgSrc: go_firebase_case_study.png
series: Case Studies
+template: true
quote: |
Firebase is Google’s mobile platform that helps you quickly develop high-quality
apps and grow your business.
diff --git a/_content/solutions/google/index.md b/_content/solutions/google/index.md
index e0ffcc9d..05f8655c 100644
--- a/_content/solutions/google/index.md
+++ b/_content/solutions/google/index.md
@@ -8,6 +8,7 @@ heroImgSrc: go_core_data_case_study.png
carouselImgSrc: go_google_case_study_carousel.png
series: Case Studies
type: solutions
+template: true
description: |-
Google is a technology company whose mission is to organize the world’s
information and make it universally accessible and useful.
diff --git a/_content/solutions/google/sitereliability.md b/_content/solutions/google/sitereliability.md
index ba1064d0..12007c24 100644
--- a/_content/solutions/google/sitereliability.md
+++ b/_content/solutions/google/sitereliability.md
@@ -11,6 +11,7 @@ quote: |
They shared their experience building core production management systems with Go, coming from experience with Python and C++.
authors:
- Pierre Palatin, Site Reliability Engineer
+template: true
---
Google runs a small number of very large services. Those services are powered
diff --git a/_content/solutions/mercadolibre.md b/_content/solutions/mercadolibre.md
index 801c0ee3..561218e6 100644
--- a/_content/solutions/mercadolibre.md
+++ b/_content/solutions/mercadolibre.md
@@ -8,6 +8,7 @@ carouselImgSrc: go_mercadolibre_case_study.png
date: 2019-11-10T16:26:31-04:00
series: Case Studies
quote: Go provides clean, efficient code that readily scales as MercadoLibre’s online commerce grows, and increases developer productivity by allowing their engineers to serve their ever-increasing audience while writing less code.
+template: true
---
{{pullquote `
diff --git a/_content/solutions/paypal.md b/_content/solutions/paypal.md
index b3432472..868efa29 100644
--- a/_content/solutions/paypal.md
+++ b/_content/solutions/paypal.md
@@ -8,6 +8,7 @@ heroImgSrc: go_paypal_case_study_logo.png
carouselImgSrc: go_paypal_case_study.png
series: Case Studies
quote: Go’s value in producing clean, efficient code that readily scales as software deployment scales made the language a strong fit to support PayPal’s goals.
+template: true
---
{{pullquote `
diff --git a/_content/solutions/use-cases.md b/_content/solutions/use-cases.md
index 7345e65a..a954ad5a 100644
--- a/_content/solutions/use-cases.md
+++ b/_content/solutions/use-cases.md
@@ -1,6 +1,7 @@
---
title: Use Cases
layout: none
+template: true
---
{{$solutions := pages "/solutions/*"}}
diff --git a/_content/solutions/webdev.md b/_content/solutions/webdev.md
index 071fa054..82fb847e 100644
--- a/_content/solutions/webdev.md
+++ b/_content/solutions/webdev.md
@@ -4,6 +4,7 @@ linkTitle: "Web Development"
description: "With enhanced memory performance and support for several IDEs, Go powers fast and scalable web applications."
date: 2019-10-04T15:26:31-04:00
series: Use Cases
+template: true
books:
icon:
file: webdev-green.svg
diff --git a/cmd/golangorg/testdata/web.txt b/cmd/golangorg/testdata/web.txt
index f04b4839..c3bd5d69 100644
--- a/cmd/golangorg/testdata/web.txt
+++ b/cmd/golangorg/testdata/web.txt
@@ -392,6 +392,11 @@ body !contains []byte(&amp;#34;orders&amp;#34;)
body contains <span class="comment">
body !contains &lt;span class=&#34;comment&#34;&gt;
+# Issue 75552.
+GET https://go.dev/src/cmd/compile/internal/ssa/README
+body contains Addr &lt;*int&gt;
+body !contains Addr &amp;lt;*int&gt;
+
GET https://m.golang.org/
redirect == https://mail.google.com/a/golang.org/
diff --git a/internal/web/render.go b/internal/web/render.go
index cb65c7d6..703705a7 100644
--- a/internal/web/render.go
+++ b/internal/web/render.go
@@ -124,17 +124,13 @@ func (site *Site) renderHTML(p Page, tmpl string, r *http.Request) ([]byte, erro
var buf bytes.Buffer
if _, ok := p["Content"]; !ok && data != "" {
- // Either the page explicitly requested templating, or it is markdown,
- // which is treated as a template by default.
- isTemplate, explicit := p["template"].(bool)
-
- // Neither gopls nor the wiki are templated by default.
- if !explicit && (strings.HasPrefix(file, "wiki/") || strings.HasPrefix(file, "gopls/")) {
- isTemplate, explicit = false, true
- }
+ // The page must explicitly request templating with "template: true"
+ // in its metadata. Markdown files are no longer treated as
+ // templates by default.
+ isTemplate, _ := p["template"].(bool)
tdata := data
- if !explicit || isTemplate {
+ if isTemplate {
// Load content as a template.
tf := t.New(file)
if err := tmplfunc.Parse(tf, data); err != nil {
@@ -181,7 +177,7 @@ func (site *Site) findLayout(dir, name string) (string, bool) {
// markdownToHTML converts Markdown to HTML.
// The Markdown source may contain raw HTML,
-// but Go templates have already been processed.
+// and may contain Go template syntax if templating was not enabled.
func markdownToHTML(markdown string) (template.HTML, error) {
// parser.WithHeadingAttribute allows custom ids on headings.
// html.WithUnsafe allows use of raw HTML, which we need for tables.
diff --git a/internal/web/site.go b/internal/web/site.go
index 81e8dee0..81e4da41 100644
--- a/internal/web/site.go
+++ b/internal/web/site.go
@@ -51,9 +51,9 @@
// The key-value pair “layout: name” selects the page layout template with the given name.
// See the next section, “Page Rendering”, for details about layout and rendering.
//
-// The key-value pair “template: bool” controls whether the page is treated as an HTML template
-// (see the next section, “Page Rendering”). The default is false for HTML
-// and true for markdown.
+// The key-value pair "template: bool" controls whether the page is treated as an HTML template
+// (see the next section, "Page Rendering"). The default is false.
+// Pages that use template functions (like {{code}}) must set "template: true".
//
// In addition to these explicit key-value pairs, pages loaded from the file system
// have a few implicit key-value pairs added by the page loading process:
@@ -69,10 +69,12 @@
//
// A Page's content is rendered in two steps: conversion to content, and framing of content.
//
-// To convert a page to content, the page's file body (its FileData key, a []byte) is parsed
-// and executed as an HTML template, with the page itself passed as the template input data.
-// The template output is then interpreted as Markdown (perhaps with embedded HTML),
-// and converted to HTML. The result is stored in the page under the key “Content”,
+// To convert a page to content, the page's file body (its FileData key, a string) is
+// optionally parsed and executed as an HTML template, with the page itself passed as the
+// template input data. This template processing only happens if the page has
+// "template: true" in its metadata. The result (or the original file body, if not
+// templated) is then interpreted as Markdown (perhaps with embedded HTML) for .md files,
+// and converted to HTML. The result is stored in the page under the key "Content",
// with type template.HTML.
//
// A page's conversion to content can be skipped entirely in dynamically-generated pages
@@ -533,8 +535,9 @@ func (s *Site) serveHTML(w http.ResponseWriter, r *http.Request, p *pageFile) {
src = buf.String()
}
- // If the file doesn't ask to be treated as a template and isn't Markdown,
- // set the page's content to skip templating later, in Site.renderHTML.
+ // For non-Markdown files without "template: true", set Content here to
+ // skip renderHTML processing. Markdown files must always go through
+ // renderHTML for Markdown-to-HTML conversion.
isTemplate, _ := p.page["template"].(bool)
if !isTemplate && !isMarkdown {
p.page["Content"] = template.HTML(src)
diff --git a/internal/web/site_test.go b/internal/web/site_test.go
index 3fb0d83e..4b174c23 100644
--- a/internal/web/site_test.go
+++ b/internal/web/site_test.go
@@ -55,19 +55,23 @@ func TestMarkdown(t *testing.T) {
site := NewSite(fstest.MapFS{
"site.tmpl": {Data: []byte(`{{.Content}}`)},
"doc/test.md": {Data: []byte("**bold**")},
- "doc/test2.md": {Data: []byte(`{{"*template*"}}`)},
+ "doc/test2.md": {Data: []byte("---\ntemplate: true\n---\n{{\"*template*\"}}")},
"doc/test3.md": {Data: []byte("---\ntemplate: false\n---\n{{x}}")},
+ "doc/test4.md": {Data: []byte("{{x}}")},
})
testServeBody(t, site, "/doc/test", "<strong>bold</strong>")
testServeBody(t, site, "/doc/test2", "<em>template</em>")
testServeBody(t, site, "/doc/test3", `{{x}}`)
+ testServeBody(t, site, "/doc/test4", `{{x}}`)
}
func TestCode(t *testing.T) {
site := NewSite(fstest.MapFS{
"site.tmpl": {Data: []byte(`{{.Content}}`)},
- "doc/code.md": {Data: []byte(`
+ "doc/code.md": {Data: []byte(`---
+template: true
+---
# hi
whole file
{{code "_code/prog.go"}}