go.dev: simplify template invocation further

Move the _templates/* function definitions nearer their uses,
allowing them to be in site.tmpl or any of the layout tmpl files.

This has the nice requirement and effect of centralizing all
the template processing now into a single function, site.renderHTML,
so that functions can be loaded from site and layout files
before the content template is executed.

And now there is no _templates directory anymore, only _content.

Change-Id: Ia74362d8d95a8e8392c9697cd404cb9ce201ae20
Reviewed-on: https://go-review.googlesource.com/c/website/+/339400
Trust: Russ Cox <rsc@golang.org>
Reviewed-by: Jamal Carvalho <jamal@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
diff --git a/go.dev/_content/site.tmpl b/go.dev/_content/site.tmpl
index 15367d2..12271ff 100644
--- a/go.dev/_content/site.tmpl
+++ b/go.dev/_content/site.tmpl
@@ -172,3 +172,142 @@
 </footer>
 </body>
 </html>
+
+{{define "breadcrumbnav"}}
+{{- if .p1.Parent}}
+  {{- template "breadcrumbnav" (dict "p1" (page .p1.Parent) "p2" .p2 )}}
+{{- end}}
+{{- if not (eq .p1.title "go.dev")}}
+<li class="BreadcrumbNav-li {{if eq .p1.Path .p2.Path}}active{{end}}">
+  <a class="BreadcrumbNav-link" href="{{.p1.Path}}">
+  {{or .p1.company .p1.title}}
+  </a>
+</li>
+{{- end}}
+{{- end}}
+
+{{define "breadcrumbs"}}
+<div class="BreadcrumbNav">
+    <ol class="BreadcrumbNav-inner">
+      {{template "breadcrumbnav" (dict "p1" . "p2" .)}}
+    </ol>
+</div>
+{{- end}}
+
+{{define "gopher info" -}}
+{{- with (yaml .info)}}
+{{- $src := "/images/gophers/wrench.svg"}}
+{{- $alt := "Go gophers with wrench"}}
+{{- $size := "Large"}}
+{{- $align := "Left"}}
+{{- $gopher := .color}}
+{{- $sizeIn := (or .size "")}}
+{{- if eq (.align) "right" "Right"}}
+   {{- $align = "Right"}}
+{{- end}}
+{{- if eq $sizeIn "XLarge" "xl" "xlarge"}}
+    {{- $size = "XLarge"}}
+{{- end}}
+{{- if eq $gopher "plane"}}
+    {{- $src = "/images/gophers/biplane.svg"}}
+    {{- $alt = "Go gopher in a plane"}}
+{{- end}}
+{{- if eq $gopher "blue"}}
+    {{- $src = "/images/gophers/blue.svg"}}
+    {{- $alt = "Go gopher"}}
+{{- end}}
+{{- if eq $gopher "front" "sticker1"}}
+    {{- $src = "/images/gophers/front.svg"}}
+    {{- $alt = "Go gopher"}}
+{{- end}}
+{{- if eq $gopher "graduate"}}
+    {{- $src = "/images/gophers/graduate.svg"}}
+    {{- $alt = "Go gopher graduating"}}
+{{- end}}
+{{- if eq $gopher "graduate-colorized"}}
+    {{- $src = "/images/gophers/graduate-colorized.svg"}}
+    {{- $alt = "Go gopher graduating"}}
+{{- end}}
+{{- if eq $gopher "green"}}
+    {{- $src = "/images/gophers/green.svg"}}
+    {{- $alt = "Go gopher"}}
+{{- end}}
+{{- if eq $gopher "grey" "gray"}}
+    {{- $src = "/images/gophers/grey.svg"}}
+    {{- $alt = "Go gopher"}}
+{{- end}}
+{{- if eq $gopher "happy" "sticker2"}}
+    {{- $src = "/images/gophers/happy.svg"}}
+    {{- $alt = "Go gopher"}}
+{{- end}}
+{{- if eq $gopher "headlamp"}}
+    {{- $src = "/images/gophers/headlamp.svg"}}
+    {{- $alt = "Go gopher with headlamp"}}
+{{- end}}
+{{- if eq $gopher "headlamp-colorized"}}
+    {{- $src = "/images/gophers/headlamp-colorized.svg"}}
+    {{- $alt = "Go gopher with headlamp"}}
+{{- end}}
+{{- if eq $gopher "ladder"}}
+    {{- $src = "/images/gophers/ladder.svg"}}
+    {{- $alt = "Go gopher with ladder"}}
+{{- end}}
+{{- if eq $gopher "machine"}}
+    {{- $src = "/images/gophers/machine.svg"}}
+    {{- $alt = "Go gophers with a machine"}}
+{{- end}}
+{{- if eq $gopher "machine-colorized"}}
+    {{- $src = "/images/gophers/machine-colorized.svg"}}
+    {{- $alt = "Go gopher with a machine"}}
+{{- end}}
+{{- if eq $gopher "megaphone"}}
+    {{- $src = "/images/gophers/megaphone.svg"}}
+    {{- $alt = "Go gopher with a megaphone"}}
+{{- end}}
+{{- if eq $gopher "peach"}}
+    {{- $src = "/images/gophers/peach.svg"}}
+    {{- $alt = "Go gopher"}}
+{{- end}}
+{{- if eq $gopher "pilot-bust"}}
+    {{- $src = "/images/gophers/pilot-bust.svg"}}
+    {{- $alt = "Go gopher pilot"}}
+{{- end}}
+{{- if eq $gopher "pink"}}
+    {{- $src = "/images/gophers/pink.svg"}}
+    {{- $alt = "Go gopher"}}
+{{- end}}
+{{- if eq $gopher "running"}}
+    {{- $src = "/images/gophers/running.svg"}}
+    {{- $alt = "Go gopher running"}}
+{{- end}}
+{{- if eq $gopher "slate"}}
+    {{- $src = "/images/gophers/slate.svg"}}
+    {{- $alt = "Go gopher"}}
+{{- end}}
+{{- if eq $gopher "wrench"}}
+    {{- $src = "/images/gophers/wrench.svg"}}
+    {{- $alt = "gopher with a wrench"}}
+{{- end}}
+{{- if eq $gopher "yellow"}}
+    {{- $src = "/images/gophers/yellow.svg"}}
+    {{- $alt = "Go gopher"}}
+{{- end}}
+{{- if eq $gopher "violet"}}
+    {{- $src = "/images/gophers/violet.svg"}}
+    {{- $alt = "Go gopher"}}
+{{- end}}
+{{- if eq $gopher "factory"}}
+    {{- $src = "/images/gophers/factory.png"}}
+    {{- $alt = "Go gopher factory"}}
+{{- end}}
+<img
+  loading="lazy"
+  class="{{$size}}Media-image {{$align}}"
+  alt="{{$alt}}"
+  src="{{$src}}">
+{{- end}}
+{{- end}}
+
+{{define "pkg path name?" -}}
+<a href="https://pkg.go.dev/{{.path}}?tab=overview">{{or .name .path}}</a>
+{{- end}}
diff --git a/go.dev/_content/solutions/default.tmpl b/go.dev/_content/solutions/default.tmpl
index 580be32..79372a2 100644
--- a/go.dev/_content/solutions/default.tmpl
+++ b/go.dev/_content/solutions/default.tmpl
@@ -80,3 +80,190 @@
   </article>
 </div>
 {{end}}
+
+{{define "backgroundquote info" -}}
+{{- with (yaml .info)}}
+<div class="BackgroundQuote">
+{{- with .link}}
+<a href="{{.}}" target="_blank" rel="noopener">
+{{- end}}
+    <p class="BackgroundQuote-body">
+      “{{markdown .quote}}”
+    </p>
+    {{- if .author}}
+    <div class="BackgroundQuote-author">
+      <span>&mdash; {{.author}}</span>
+      {{if .title}},&nbsp;
+      <span class="BackgroundQuote-title">{{rawhtml .title}}</span>
+      {{- end}}
+      {{- if .company}}
+      <span class="BackgroundQuote-title">&nbsp;at {{.company}}</span>
+      {{- end}}
+    </div>
+    {{- end}}
+{{- if .link}}
+</a>
+{{- end}}
+</div>
+{{- end}}
+{{end}}
+
+{{define "books"}}
+{{- with (yaml .)}}
+<ul class="Learn-tileList">
+    {{- range .}}
+    <li class="Learn-tile">
+        <a href="{{.url}}">
+            {{- if .thumbnail}}
+              <img
+              class="Learn-tileThumbnail Learn-tileThumbnail--book"
+              alt="{{.title}} thumbnail." src="{{.thumbnail}}">
+            {{- end}}
+            <span class="Learn-tileTitle">
+                {{.title}}
+            </span>
+        </a>
+    </li>
+    {{- end}}
+</ul>
+{{- end}}
+{{- end}}
+
+{{define "libraries"}}
+{{- range (yaml .)}}
+<div class="WhoUsesCaseStudy-librariesWrapper">
+  <div class="headerWithLink">
+    <h3>{{.title}}</h3>
+  </div>
+  <ul class="WhoUsesCaseStudy-librariesList">
+    {{- range .items}}
+    <li class="WhoUsesCaseStudy-library">
+      <a class="WhoUsesCaseStudy-libraryTitle" href="{{.url}}">{{.text}}</a>
+      <p>{{.desc}}</p>
+    </li>
+    {{- end}}
+  </ul>
+  <a class="WhoUsesCaseStudy-librariesViewMoreLink" href="{{.viewMoreUrl}}">View More</a>
+</div>
+{{- end}}
+{{- end}}
+
+{{define "projects"}}
+<div class="FeaturedUsers">
+<h2 id="featured-users" class="sectionHeading">Featured users</h2>
+<table>
+  <thead>
+    <tr>
+      <th class="FeaturedUsers--hiddenMobile">Customer</th>
+      <th>Brief introduction</th>
+      <th>Projects using go</th>
+    </tr>
+  </thead>
+  <tbody>
+    {{- range $index, $project := (yaml .)}}
+    <tr
+      class="js-featuredUsersRow FeaturedUsers-row"
+      {{- if (gt $index 2) }}
+      hidden {{end}}
+    >
+      <td class="FeaturedUsers--hiddenMobile">
+        <img src="/images/logos/{{.logoSrc}}" alt="{{.company}}" />
+      </td>
+      <td>
+        <img
+          class="FeaturedUsers--hiddenDesktop"
+          src="/images/logos/{{.logoSrc}}" alt="{{.company}}" />
+        {{.desc}}
+      </td>
+      <td>
+        <ul>
+          {{- range .ctas}}
+          <li><a href="{{.url}}">{{.text}}</a></li>
+          {{- end}}
+        </ul>
+      </td>
+    </tr>
+    {{- end}}
+  </tbody>
+</table>
+<button
+  class="js-moreProjectsBtn FeaturedUsers-moreProjectsBtn"
+  type="button">
+ More projects
+</button>
+</div>
+{{end}}
+
+{{define "pullquote info" -}}
+{{- with (yaml .info)}}
+<div class="PullQuote">
+  <div class="PullQuote-quoteHeader">
+    <img class="PullQuote-image" src="/images/quote.svg" alt="Quotation mark.">
+  </div>
+  <p class="PullQuote-body">
+    {{markdown .quote}}
+  </p>
+  {{- if .author}}
+  <div class="PullQuote-author">
+    {{- with .link}}
+    <a
+      class="PullQuote-link"
+      href="{{.}}"
+      target="_blank"
+      rel="noopener">
+    {{- end}}
+    <span>
+      &mdash; {{.author -}}
+    </span>
+    {{if .title}},&nbsp;
+      <span class="PullQuote-title">{{rawhtml .title}}</span>
+    {{- end}}
+    {{- if .company}}
+      <span class="PullQuote-title">&nbsp;at {{.company -}}</span>
+    {{- end}}
+    {{- with .link}}</a>{{end}}
+  </div>
+  {{- end}}
+</div>
+{{- end}}
+{{end}}
+
+{{define "quote info" -}}
+{{- with (yaml .info)}}
+<div class="QuoteBlock">
+  <p class="QuoteBlock-body">
+    {{markdown .quote}}
+  </p>
+  {{- if .author}}
+    <div class="QuoteBlock-author">
+      {{- with .link}}
+        <a class="QuoteBlock-link" href="{{.}}" target="_blank" rel="noopener">
+      {{- end}}
+      &mdash; {{.author}}
+      {{- if .title}},&nbsp;<span>{{.title}}</span>{{end}}
+      {{- with .link}}
+      </a>
+      {{- end -}}
+    </div>
+  {{- end}}
+</div>
+{{- end}}
+{{end}}
+
+{{define "toolsblurbs"}}
+<div class="ToolsBlurbs">
+  {{- range (yaml .)}}
+  <div class="ToolsBlurbs-blurb">
+    <a class="ToolsBlurbs-blurbHeader" href="{{.url}}">
+      <img class="ToolsBlurbs-blurbIcon" src="{{.iconSrc}}" alt="{{.title}}">
+      <span>{{.title}}</span>
+    </a>
+    {{- range .paragraphs}}
+      <p class="ToolsBlurbs-blurbBody">
+        {{.}}
+      </p>
+    {{- end}}
+  </div>
+  {{- end}}
+</div>
+{{end}}
diff --git a/go.dev/_templates/backgroundquote.tmpl b/go.dev/_templates/backgroundquote.tmpl
deleted file mode 100644
index 5784f97..0000000
--- a/go.dev/_templates/backgroundquote.tmpl
+++ /dev/null
@@ -1,26 +0,0 @@
-{{define "backgroundquote info" -}}
-{{- with (yaml .info)}}
-<div class="BackgroundQuote">
-{{- with .link}}
-<a href="{{.}}" target="_blank" rel="noopener">
-{{- end}}
-    <p class="BackgroundQuote-body">
-      “{{markdown .quote}}”
-    </p>
-    {{- if .author}}
-    <div class="BackgroundQuote-author">
-      <span>&mdash; {{.author}}</span>
-      {{if .title}},&nbsp;
-      <span class="BackgroundQuote-title">{{rawhtml .title}}</span>
-      {{- end}}
-      {{- if .company}}
-      <span class="BackgroundQuote-title">&nbsp;at {{.company}}</span>
-      {{- end}}
-    </div>
-    {{- end}}
-{{- if .link}}
-</a>
-{{- end}}
-</div>
-{{- end}}
-{{end}}
diff --git a/go.dev/_templates/books.tmpl b/go.dev/_templates/books.tmpl
deleted file mode 100644
index 4a9ddff..0000000
--- a/go.dev/_templates/books.tmpl
+++ /dev/null
@@ -1,20 +0,0 @@
-{{define "books"}}
-{{- with (yaml .)}}
-<ul class="Learn-tileList">
-    {{- range .}}
-    <li class="Learn-tile">
-        <a href="{{.url}}">
-            {{- if .thumbnail}}
-              <img
-              class="Learn-tileThumbnail Learn-tileThumbnail--book"
-              alt="{{.title}} thumbnail." src="{{.thumbnail}}">
-            {{- end}}
-            <span class="Learn-tileTitle">
-                {{.title}}
-            </span>
-        </a>
-    </li>
-    {{- end}}
-</ul>
-{{- end}}
-{{- end}}
diff --git a/go.dev/_templates/breadcrumbs.tmpl b/go.dev/_templates/breadcrumbs.tmpl
deleted file mode 100644
index 8aaea97..0000000
--- a/go.dev/_templates/breadcrumbs.tmpl
+++ /dev/null
@@ -1,20 +0,0 @@
-{{define "breadcrumbnav"}}
-{{- if .p1.Parent}}
-  {{- template "breadcrumbnav" (dict "p1" (page .p1.Parent) "p2" .p2 )}}
-{{- end}}
-{{- if not (eq .p1.title "go.dev")}}
-<li class="BreadcrumbNav-li {{if eq .p1.Path .p2.Path}}active{{end}}">
-  <a class="BreadcrumbNav-link" href="{{.p1.Path}}">
-  {{or .p1.company .p1.title}}
-  </a>
-</li>
-{{- end}}
-{{- end}}
-
-{{define "breadcrumbs"}}
-<div class="BreadcrumbNav">
-    <ol class="BreadcrumbNav-inner">
-      {{template "breadcrumbnav" (dict "p1" . "p2" .)}}
-    </ol>
-</div>
-{{- end}}
diff --git a/go.dev/_templates/gopher.tmpl b/go.dev/_templates/gopher.tmpl
deleted file mode 100644
index 5fcd14a..0000000
--- a/go.dev/_templates/gopher.tmpl
+++ /dev/null
@@ -1,116 +0,0 @@
-{{define "gopher info" -}}
-{{- with (yaml .info)}}
-{{- $src := "/images/gophers/wrench.svg"}}
-{{- $alt := "Go gophers with wrench"}}
-{{- $size := "Large"}}
-{{- $align := "Left"}}
-{{- $gopher := .color}}
-{{- $sizeIn := (or .size "")}}
-
-{{- if eq (.align) "right" "Right"}}
-   {{- $align = "Right"}}
-{{- end}}
-
-{{- if eq $sizeIn "XLarge" "xl" "xlarge"}}
-    {{- $size = "XLarge"}}
-{{- end}}
-
-{{- if eq $gopher "plane"}}
-    {{- $src = "/images/gophers/biplane.svg"}}
-    {{- $alt = "Go gopher in a plane"}}
-{{- end}}
-{{- if eq $gopher "blue"}}
-    {{- $src = "/images/gophers/blue.svg"}}
-    {{- $alt = "Go gopher"}}
-{{- end}}
-{{- if eq $gopher "front" "sticker1"}}
-    {{- $src = "/images/gophers/front.svg"}}
-    {{- $alt = "Go gopher"}}
-{{- end}}
-{{- if eq $gopher "graduate"}}
-    {{- $src = "/images/gophers/graduate.svg"}}
-    {{- $alt = "Go gopher graduating"}}
-{{- end}}
-{{- if eq $gopher "graduate-colorized"}}
-    {{- $src = "/images/gophers/graduate-colorized.svg"}}
-    {{- $alt = "Go gopher graduating"}}
-{{- end}}
-{{- if eq $gopher "green"}}
-    {{- $src = "/images/gophers/green.svg"}}
-    {{- $alt = "Go gopher"}}
-{{- end}}
-{{- if eq $gopher "grey" "gray"}}
-    {{- $src = "/images/gophers/grey.svg"}}
-    {{- $alt = "Go gopher"}}
-{{- end}}
-{{- if eq $gopher "happy" "sticker2"}}
-    {{- $src = "/images/gophers/happy.svg"}}
-    {{- $alt = "Go gopher"}}
-{{- end}}
-{{- if eq $gopher "headlamp"}}
-    {{- $src = "/images/gophers/headlamp.svg"}}
-    {{- $alt = "Go gopher with headlamp"}}
-{{- end}}
-{{- if eq $gopher "headlamp-colorized"}}
-    {{- $src = "/images/gophers/headlamp-colorized.svg"}}
-    {{- $alt = "Go gopher with headlamp"}}
-{{- end}}
-{{- if eq $gopher "ladder"}}
-    {{- $src = "/images/gophers/ladder.svg"}}
-    {{- $alt = "Go gopher with ladder"}}
-{{- end}}
-{{- if eq $gopher "machine"}}
-    {{- $src = "/images/gophers/machine.svg"}}
-    {{- $alt = "Go gophers with a machine"}}
-{{- end}}
-{{- if eq $gopher "machine-colorized"}}
-    {{- $src = "/images/gophers/machine-colorized.svg"}}
-    {{- $alt = "Go gopher with a machine"}}
-{{- end}}
-{{- if eq $gopher "megaphone"}}
-    {{- $src = "/images/gophers/megaphone.svg"}}
-    {{- $alt = "Go gopher with a megaphone"}}
-{{- end}}
-{{- if eq $gopher "peach"}}
-    {{- $src = "/images/gophers/peach.svg"}}
-    {{- $alt = "Go gopher"}}
-{{- end}}
-{{- if eq $gopher "pilot-bust"}}
-    {{- $src = "/images/gophers/pilot-bust.svg"}}
-    {{- $alt = "Go gopher pilot"}}
-{{- end}}
-{{- if eq $gopher "pink"}}
-    {{- $src = "/images/gophers/pink.svg"}}
-    {{- $alt = "Go gopher"}}
-{{- end}}
-{{- if eq $gopher "running"}}
-    {{- $src = "/images/gophers/running.svg"}}
-    {{- $alt = "Go gopher running"}}
-{{- end}}
-{{- if eq $gopher "slate"}}
-    {{- $src = "/images/gophers/slate.svg"}}
-    {{- $alt = "Go gopher"}}
-{{- end}}
-{{- if eq $gopher "wrench"}}
-    {{- $src = "/images/gophers/wrench.svg"}}
-    {{- $alt = "gopher with a wrench"}}
-{{- end}}
-{{- if eq $gopher "yellow"}}
-    {{- $src = "/images/gophers/yellow.svg"}}
-    {{- $alt = "Go gopher"}}
-{{- end}}
-{{- if eq $gopher "violet"}}
-    {{- $src = "/images/gophers/violet.svg"}}
-    {{- $alt = "Go gopher"}}
-{{- end}}
-{{- if eq $gopher "factory"}}
-    {{- $src = "/images/gophers/factory.png"}}
-    {{- $alt = "Go gopher factory"}}
-{{- end}}
-<img
-  loading="lazy"
-  class="{{$size}}Media-image {{$align}}"
-  alt="{{$alt}}"
-  src="{{$src}}">
-{{- end}}
-{{- end}}
diff --git a/go.dev/_templates/libraries.tmpl b/go.dev/_templates/libraries.tmpl
deleted file mode 100644
index dd67702..0000000
--- a/go.dev/_templates/libraries.tmpl
+++ /dev/null
@@ -1,18 +0,0 @@
-{{define "libraries"}}
-{{- range (yaml .)}}
-<div class="WhoUsesCaseStudy-librariesWrapper">
-  <div class="headerWithLink">
-    <h3>{{.title}}</h3>
-  </div>
-  <ul class="WhoUsesCaseStudy-librariesList">
-    {{- range .items}}
-    <li class="WhoUsesCaseStudy-library">
-      <a class="WhoUsesCaseStudy-libraryTitle" href="{{.url}}">{{.text}}</a>
-      <p>{{.desc}}</p>
-    </li>
-    {{- end}}
-  </ul>
-  <a class="WhoUsesCaseStudy-librariesViewMoreLink" href="{{.viewMoreUrl}}">View More</a>
-</div>
-{{- end}}
-{{- end}}
diff --git a/go.dev/_templates/pkg.tmpl b/go.dev/_templates/pkg.tmpl
deleted file mode 100644
index 19d7630..0000000
--- a/go.dev/_templates/pkg.tmpl
+++ /dev/null
@@ -1,3 +0,0 @@
-{{define "pkg path name?" -}}
-<a href="https://pkg.go.dev/{{.path}}?tab=overview">{{or .name .path}}</a>
-{{- end}}
diff --git a/go.dev/_templates/projects.tmpl b/go.dev/_templates/projects.tmpl
deleted file mode 100644
index b21d5a6..0000000
--- a/go.dev/_templates/projects.tmpl
+++ /dev/null
@@ -1,47 +0,0 @@
-{{define "projects"}}
-<div class="FeaturedUsers">
-
-<h2 id="featured-users" class="sectionHeading">Featured users</h2>
-
-<table>
-  <thead>
-    <tr>
-      <th class="FeaturedUsers--hiddenMobile">Customer</th>
-      <th>Brief introduction</th>
-      <th>Projects using go</th>
-    </tr>
-  </thead>
-  <tbody>
-    {{- range $index, $project := (yaml .)}}
-    <tr
-      class="js-featuredUsersRow FeaturedUsers-row"
-      {{- if (gt $index 2) }}
-      hidden {{end}}
-    >
-      <td class="FeaturedUsers--hiddenMobile">
-        <img src="/images/logos/{{.logoSrc}}" alt="{{.company}}" />
-      </td>
-      <td>
-        <img
-          class="FeaturedUsers--hiddenDesktop"
-          src="/images/logos/{{.logoSrc}}" alt="{{.company}}" />
-        {{.desc}}
-      </td>
-      <td>
-        <ul>
-          {{- range .ctas}}
-          <li><a href="{{.url}}">{{.text}}</a></li>
-          {{- end}}
-        </ul>
-      </td>
-    </tr>
-    {{- end}}
-  </tbody>
-</table>
-<button
-  class="js-moreProjectsBtn FeaturedUsers-moreProjectsBtn"
-  type="button">
- More projects
-</button>
-</div>
-{{end}}
diff --git a/go.dev/_templates/pullquote.tmpl b/go.dev/_templates/pullquote.tmpl
deleted file mode 100644
index aa64dd6..0000000
--- a/go.dev/_templates/pullquote.tmpl
+++ /dev/null
@@ -1,34 +0,0 @@
-{{define "pullquote info" -}}
-{{- with (yaml .info)}}
-<div class="PullQuote">
-  <div class="PullQuote-quoteHeader">
-    <img class="PullQuote-image" src="/images/quote.svg" alt="Quotation mark.">
-  </div>
-  <p class="PullQuote-body">
-    {{markdown .quote}}
-  </p>
-  {{- if .author}}
-  <div class="PullQuote-author">
-    {{- with .link}}
-    <a
-      class="PullQuote-link"
-      href="{{.}}"
-      target="_blank"
-      rel="noopener">
-    {{- end}}
-    <span>
-      &mdash; {{.author -}}
-    </span>
-    {{if .title}},&nbsp;
-      <span class="PullQuote-title">{{rawhtml .title}}</span>
-    {{- end}}
-    {{- if .company}}
-      <span class="PullQuote-title">&nbsp;at {{.company -}}</span>
-    {{- end}}
-    {{- with .link}}</a>{{end}}
-  </div>
-  {{- end}}
-</div>
-{{- end}}
-{{end}}
-
diff --git a/go.dev/_templates/quote.tmpl b/go.dev/_templates/quote.tmpl
deleted file mode 100644
index 1355467..0000000
--- a/go.dev/_templates/quote.tmpl
+++ /dev/null
@@ -1,21 +0,0 @@
-{{define "quote info" -}}
-{{- with (yaml .info)}}
-<div class="QuoteBlock">
-  <p class="QuoteBlock-body">
-    {{markdown .quote}}
-  </p>
-  {{- if .author}}
-    <div class="QuoteBlock-author">
-      {{- with .link}}
-        <a class="QuoteBlock-link" href="{{.}}" target="_blank" rel="noopener">
-      {{- end}}
-      &mdash; {{.author}}
-      {{- if .title}},&nbsp;<span>{{.title}}</span>{{end}}
-      {{- with .link}}
-      </a>
-      {{- end -}}
-    </div>
-  {{- end}}
-</div>
-{{- end}}
-{{end}}
diff --git a/go.dev/_templates/toolsblurbs.tmpl b/go.dev/_templates/toolsblurbs.tmpl
deleted file mode 100644
index 299858c..0000000
--- a/go.dev/_templates/toolsblurbs.tmpl
+++ /dev/null
@@ -1,18 +0,0 @@
-{{define "toolsblurbs"}}
-<div class="ToolsBlurbs">
-  {{- range (yaml .)}}
-  <div class="ToolsBlurbs-blurb">
-    <a class="ToolsBlurbs-blurbHeader" href="{{.url}}">
-      <img class="ToolsBlurbs-blurbIcon" src="{{.iconSrc}}" alt="{{.title}}">
-      <span>{{.title}}</span>
-    </a>
-    {{- range .paragraphs}}
-      <p class="ToolsBlurbs-blurbBody">
-        {{.}}
-      </p>
-    {{- end}}
-  </div>
-  {{- end}}
-</div>
-
-{{end}}
diff --git a/go.dev/cmd/internal/site/md.go b/go.dev/cmd/internal/site/md.go
index 72e2052..a90f57f 100644
--- a/go.dev/cmd/internal/site/md.go
+++ b/go.dev/cmd/internal/site/md.go
@@ -16,7 +16,6 @@
 	"github.com/yuin/goldmark/renderer/html"
 	"github.com/yuin/goldmark/text"
 	"github.com/yuin/goldmark/util"
-	"golang.org/x/website/go.dev/cmd/internal/tmplfunc"
 	"golang.org/x/website/internal/backport/html/template"
 )
 
@@ -78,19 +77,3 @@
 		mdLinkWalk(child)
 	}
 }
-
-// markdownTemplateToHTML converts a markdown template to HTML,
-// first applying the template execution engine and then interpreting
-// the result as markdown to be converted to HTML.
-// This is the same logic used by the Go web site.
-func (site *Site) markdownTemplateToHTML(markdown string, p *page) (template.HTML, error) {
-	t := site.clone().New(p.file)
-	if err := tmplfunc.Parse(t, string(p.data)); err != nil {
-		return "", err
-	}
-	var buf bytes.Buffer
-	if err := t.Execute(&buf, p.params); err != nil {
-		return "", err
-	}
-	return markdownToHTML(buf.String())
-}
diff --git a/go.dev/cmd/internal/site/page.go b/go.dev/cmd/internal/site/page.go
index e821971..154dd05 100644
--- a/go.dev/cmd/internal/site/page.go
+++ b/go.dev/cmd/internal/site/page.go
@@ -134,12 +134,6 @@
 
 // renderHTML renders the HTML for the page, leaving it in p.html.
 func (site *Site) renderHTML(p *page) error {
-	content, err := site.markdownTemplateToHTML(string(p.data), p)
-	if err != nil {
-		return err
-	}
-	p.params["Content"] = content
-
 	// Load base template.
 	base, err := ioutil.ReadFile(site.file("_content/site.tmpl"))
 	if err != nil {
@@ -189,7 +183,22 @@
 		return err
 	}
 
+	// Load actual Markdown content (also a template).
+	tf := t.New(p.file)
+	if err := tmplfunc.Parse(tf, string(p.data)); err != nil {
+		return err
+	}
 	var buf bytes.Buffer
+	if err := tf.Execute(&buf, p.params); err != nil {
+		return err
+	}
+	html, err := markdownToHTML(buf.String())
+	if err != nil {
+		return err
+	}
+	p.params["Content"] = html
+
+	buf.Reset()
 	if err := t.Execute(&buf, p.params); err != nil {
 		return err
 	}