diff --git a/layouts/_default/taxonomy.html b/layouts/_default/taxonomy.html
index 0c29655f40..90b7284f41 100644
--- a/layouts/_default/taxonomy.html
+++ b/layouts/_default/taxonomy.html
@@ -11,27 +11,31 @@
{{- end }}
{{ $title }}
{{- $lastCapital := "" }}
-{{- range .Data.Terms.Alphabetical }}
- {{- $capital := substr .Page.Data.Term 0 1 | upper }}
- {{- if ne $lastCapital $capital }}
- {{- if ne $lastCapital "" }}
-
+{{- $terms := slice }}
+{{- range .Data.Terms }}
+ {{- $terms = $terms | append (dict "Title" (default .Page.Data.Term .Page.Title) "Term" . )}}
+{{- end }}
+{{- range sort $terms ".Title" }}
+ {{- $capital := substr .Title 0 1 | upper }}
+ {{- $len := 0 }}
+ {{- range .Term.Pages }}
+ {{- $c:=""}}{{/* count pages of term */}}
+ {{- if and .Title .RelPermalink (or (ne (.Scratch.Get "relearnIsHiddenStem") true) (ne .Site.Params.disableTagHiddenPages true) ) }}
+ {{- $len = add $len 1 }}
{{- end }}
+ {{- end }}
+ {{- if $len }}
+ {{- if ne $lastCapital $capital }}
+ {{- if ne $lastCapital "" }}
+
+ {{- end }}
{{ $capital }}