hugo

Unnamed repository; edit this file 'description' to name the repository.

git clone git://git.shimmy1996.com/hugo.git
commit be72f234f8cf8ab4723248c1306fb2e0b7ad5252
parent be8235557032ddeba024deb70dcfb60fda03aed1
Author: bep <bjorn.erik.pedersen@gmail.com>
Date:   Mon, 11 May 2015 22:23:35 +0200

docs: Use ToC length to pick the compact version

Diffstat:
Mdocs/content/extras/menus.md | 1-
Mdocs/content/extras/shortcodes.md | 1-
Mdocs/content/tutorials/creating-a-new-theme.md | 1-
Mdocs/content/tutorials/migrate-from-jekyll.md | 1-
Mdocs/layouts/_default/single.html | 4++--
5 files changed, 2 insertions(+), 6 deletions(-)
diff --git 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
diff --git a/docs/content/extras/shortcodes.md b/docs/content/extras/shortcodes.md
@@ -10,7 +10,6 @@ prev: /extras/permalinks
 title: Shortcodes
 weight: 80
 toc: true
-tocstyle: compact
 ---
 
 Hugo uses Markdown for its simple content format. However, there are a lot
diff --git a/docs/content/tutorials/creating-a-new-theme.md b/docs/content/tutorials/creating-a-new-theme.md
@@ -3,7 +3,6 @@ author: "Michael Henderson"
 date: 2014-09-28
 linktitle: Creating a New Theme
 toc: true
-tocstyle: compact
 menu:
   main:
     parent: tutorials
diff --git 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
diff --git 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 }}