ref: be72f234f8cf8ab4723248c1306fb2e0b7ad5252
parent: be8235557032ddeba024deb70dcfb60fda03aed1
author: bep <bjorn.erik.pedersen@gmail.com>
date: Mon May 11 18:23:35 EDT 2015
docs: Use ToC length to pick the compact version
--- a/docs/content/extras/menus.md
+++ b/docs/content/extras/menus.md
@@ -1,7 +1,6 @@
---
date: 2014-05-14T02:36:37Z
toc: true
-tocstyle: compact
menu:
main:
parent: extras
--- a/docs/content/extras/shortcodes.md
+++ b/docs/content/extras/shortcodes.md
@@ -10,7 +10,6 @@
title: Shortcodes
weight: 80
toc: true
-tocstyle: compact
---
Hugo uses Markdown for its simple content format. However, there are a lot
--- a/docs/content/tutorials/creating-a-new-theme.md
+++ b/docs/content/tutorials/creating-a-new-theme.md
@@ -3,7 +3,6 @@
date: 2014-09-28
linktitle: Creating a New Theme
toc: true
-tocstyle: compact
menu:
main:
parent: tutorials
--- a/docs/content/tutorials/migrate-from-jekyll.md
+++ b/docs/content/tutorials/migrate-from-jekyll.md
@@ -2,7 +2,6 @@
date: 2014-03-10
linktitle: Migrating from Jekyll
toc: true
-tocstyle: compact
menu:
main:
parent: tutorials
--- a/docs/layouts/_default/single.html
+++ b/docs/layouts/_default/single.html
@@ -3,8 +3,8 @@
<div class="col-lg-8 col-md-12">
{{ .Content }}
</div>
-<div id="toc" class="col-lg-offset-6 toc {{ with .Params.tocstyle }}{{ . }}{{ end }}">
-{{ .TableOfContents }}
+<div id="toc" class="col-lg-offset-6 toc {{ if gt (len .TableOfContents) 2500 }}compact{{ end }}">
+ {{ .TableOfContents }}
</div>
{{ else }}
{{ .Content }}
--
⑨