diff --git a/layouts/shortcodes/gl.html b/layouts/shortcodes/gl.html
new file mode 100644
index 000000000..0c1ac17f6
--- /dev/null
+++ b/layouts/shortcodes/gl.html
@@ -0,0 +1,42 @@
+{{- /*
+Renders a link to the glossary entry for the given term.
+
+It first checks for the existence of a glossary page for the given term. If no
+page is found, it then checks for a glossary page for the singular form of the
+term. If neither page exists, the shortcode raises an error.
+
+The rendered link displays the given term as the link text. However, the link
+itself does not point directly to the glossary term page. Instead, via its
+fragment, it points to an entry on the glossary page.
+
+@param {string} (.Get 0) The glossary term.
+@returns {template.HTML}
+
+@example {{% gl float %}}
+@example {{% gl "floating point" %}}
+*/}}
+
+{{- with $termGiven := .Get 0 }}
+ {{- $basePath := "/getting-started/glossary" }}
+ {{- $termActual := "" }}
+ {{- $termSingular := inflect.Singularize $termGiven }}
+
+ {{- if site.GetPage (urls.JoinPath $basePath $termGiven) }}
+ {{- $termActual = $termGiven }}
+ {{- else if site.GetPage (urls.JoinPath $basePath $termSingular) }}
+ {{- $termActual = $termSingular}}
+ {{- else }}
+ {{- errorf "The glossary link (%s) shortcode was unable to find a defintion for either the singular or plural form of the term %q: see %s" $.Name $termGiven $.Position }}
+ {{- end }}
+
+ {{- if $termActual }}
+ {{- with site.GetPage $basePath }}
+ {{- $href := fmt.Printf "%s#%s" .RelPermalink (anchorize $termActual) }}
+[{{ $termGiven }}]({{ $href }}){{/* Do not indent. */}}
+ {{- else }}
+ {{- errorf "The glossary link (%s) shortcode was unable to find %s: see %s" $.Name $basePath $.Position }}
+ {{- end }}
+ {{- end }}
+{{- else }}
+ {{- errorf "The glossary link (%s) shortcode requires one positional parameter: see %s" $.Name $.Position }}
+{{- end }}
diff --git a/layouts/shortcodes/glossary.html b/layouts/shortcodes/glossary.html
index 7a9fbf7b7..3273efd8c 100644
--- a/layouts/shortcodes/glossary.html
+++ b/layouts/shortcodes/glossary.html
@@ -25,7 +25,7 @@ shortcode.
{{- continue }}
{{- end }}
{{- $anchor := path.BaseName .Path | anchorize }}
- {{- $m = merge $m (dict $k ($anchor | anchorize)) }}
+ {{- $m = merge $m (dict $k $anchor) }}
{{- end }}
{{- range $k, $v := $m }}
[{{ $k }}](#{{ $v }}) {{/* Do not indent. */}}
diff --git a/layouts/shortcodes/gt.html b/layouts/shortcodes/gt.html
index 7d2a7fa65..b7c85aa98 100644
--- a/layouts/shortcodes/gt.html
+++ b/layouts/shortcodes/gt.html
@@ -1,5 +1,5 @@
{{- /*
-Renders a glossary term.
+Renders the definition of the given glossary term.
@param {string} (.Get 0) The glossary term.
@returns {template.HTML}
@@ -7,13 +7,14 @@ Renders a glossary term.
@example {{% gt float %}}
@example {{% gt "floating point" %}}
*/}}
+
{{- with .Get 0 }}
{{- $path := printf "/getting-started/glossary/%s" (urlize .) }}
{{- with site.GetPage $path }}
-{{ .RenderShortcodes }}{{/* Do not indent this line. */}}
+{{ .RenderShortcodes }}{{/* Do not indent. */}}
{{- else }}
{{- errorf "The glossary term (%s) shortcode was unable to find %s: see %s" $.Name $path $.Position }}
{{- end }}
{{- else }}
- {{- errorf "The glossary term (%s) shortcode requires one positional parameter: see %s" .Name .Position }}
+ {{- errorf "The glossary term (%s) shortcode requires one positional parameter: see %s" $.Name $.Position }}
{{- end }}