Using table of contents within the documentation.
authorspf13 <steve.francia@gmail.com>
Wed, 29 Jan 2014 04:29:05 +0000 (23:29 -0500)
committerspf13 <steve.francia@gmail.com>
Wed, 29 Jan 2014 04:29:05 +0000 (23:29 -0500)
17 files changed:
docs/content/community/contributing.md
docs/content/community/contributors.md
docs/content/content/example.md
docs/content/content/sections.md
docs/content/extras/permalinks.md
docs/content/extras/urls.md
docs/content/indexes/category.md
docs/content/indexes/lists.md
docs/content/layout/homepage.md
docs/content/layout/rss.md
docs/content/meta/roadmap.md
docs/content/overview/configuration.md
docs/content/overview/source-directory.md
docs/content/overview/usage.md
docs/layouts/_default/single.html
docs/layouts/chrome/footer.html
docs/static/static/css/styles.css

index 073f286201ccc9a144229a4b38710144e4b32788..1de03b48db0f689684f242a0b144de423fc0f2f5 100644 (file)
@@ -31,7 +31,7 @@ When you're ready to create a pull request, be sure to:
 
 # Building from source
 
-### Clone locally (for contributors):
+## Clone locally (for contributors):
 
     git clone https://github.com/spf13/hugo
     cd hugo
@@ -44,13 +44,13 @@ of the following paths:
  * ln -s /path/to/your/hugo $GOPATH/src/github.com/spf13/hugo
  * ln -s /path/to/your/hugo $GOROOT/src/pkg/github.com/spf13/hugo
 
-### Running Hugo
+## Running Hugo
 
     cd /path/to/hugo
     go install github.com/spf13/hugo/hugolibs
     go run main.go
 
-### Building Hugo
+## Building Hugo
 
     cd /path/to/hugo
     go build -o hugo main.go
index 75e185ea5952dfb4cdf3e3ebd6235b86d1e84554..0f5f9470ed96e701e4804e00150a2a957d67b685 100644 (file)
@@ -4,6 +4,7 @@ date: "2013-07-01"
 aliases: ["/doc/contributors/", "/meta/contributors/"]
 groups: ["community"]
 groups_weight: 40
+notoc: true
 ---
 
 Hugo was built with love and golang by:
index 01300d45c066473683bdff3b955a4bcf0156ad2f..d062150e5a301af386e781879df5eb4450b5b03c 100644 (file)
@@ -5,6 +5,7 @@ aliases: ["/doc/example/"]
 linktitle: "Example"
 groups: ['content']
 groups_weight: 50
+notoc: true
 ---
 
 Somethings are better shown than explained. The following is a very basic example of a content file:
index a2fc155fa8bc55fb679e5e7443ee43734d9ebf97..dfda7f27e5eb49879fc3e0836ceb05bb3a2bbd5d 100644 (file)
@@ -3,6 +3,7 @@ title: "Sections"
 date: "2013-07-01"
 groups: ['content']
 groups_weight: 20
+notoc: true
 ---
 
 Hugo thinks that you organize your content with a purpose. The same structure
index e76b224d3555ec7400c2c58a076b1ff84edbbe14..08e7f3e2dc7bc4656e1f4185503bbf2d14666fe8 100644 (file)
@@ -5,6 +5,7 @@ aliases:
   - "/doc/permalinks/"
 groups: ["extras"]
 groups_weight: 30
+notoc: true
 ---
 
 By default, content is laid out into the target `publishdir` (public)
index b386effbab54b796cdf7ba963c9041143619dab4..69bc98ffc192d928f184f084ae3ce308b49fa84a 100644 (file)
@@ -5,6 +5,7 @@ aliases:
   - "/doc/urls/"
 groups: ["extras"]
 groups_weight: 40
+notoc: true
 ---
 By default, all relative URLs encountered in the input will be canonicalized
 using `baseurl`, so that a link `/css/foo.css` becomes
index bfedde5720f31cf8ca5a7303480db3e4d0a55cfd..45a5e9b00e72383d9dd843843952c1f33198ae36 100644 (file)
@@ -9,7 +9,7 @@ groups_weight: 60
 
 This page demonstrates what would be required to add a new index called "categories" to your site.
 
-### config.yaml
+## config.yaml
 First step is to define the index in your config file.
 *Because we use both the singular and plural name of the index in our rendering it's
 important to provide both here. We require this, rather than using inflection in
@@ -24,7 +24,7 @@ title: "Steve Francia is spf13.com"
 ---
 {{% /highlight %}}
 
-### /layouts/indexes/category.html
+## /layouts/indexes/category.html
 
 For each index type a template needs to be provided to render the index page.
 In the case of categories, this will render the content for /categories/`CATEGORYNAME`/.
@@ -46,7 +46,7 @@ In the case of categories, this will render the content for /categories/`CATEGOR
 {{% /highlight %}}
 
 
-### Assigning indexes to content
+## Assigning indexes to content
 
 Make sure that the index is set in the front matter:
 
index 552c71fa92311542335ca1e55506d3ec6fb82e07..d5d9449acfac11ea0c3d825665d942bbba01238a 100644 (file)
@@ -22,7 +22,7 @@ Hugo can order the meta data in two different ways. It can be ordered by the
 number of content assigned to that key or alphabetically.
 
 
-### Example indexes.html file (alphabetical)
+## Example indexes.html file (alphabetical)
 
 {{% highlight html %}}
 {{ template "chrome/header.html" . }}
@@ -42,7 +42,7 @@ number of content assigned to that key or alphabetically.
 {{ template "chrome/footer.html" }}
 {{% /highlight %}}
 
-### Example indexes.html file (ordered)
+## Example indexes.html file (ordered)
 
 {{% highlight html %}}
 {{ template "chrome/header.html" . }}
@@ -63,7 +63,7 @@ number of content assigned to that key or alphabetically.
 {{ template "chrome/footer.html" }}
 {{% /highlight %}}
 
-### Variables available to list of indexes pages.
+## Variables available to list of indexes pages.
 
 **.Title**  The title for the content. <br>
 **.Date** The date the content is published on.<br>
index c3c0f9b7ab8cded437b5535dffbdcb7f08e159ca..b94f4aa1c738b245c81333d8a9752006bb15de75 100644 (file)
@@ -3,6 +3,7 @@ title: "Homepage Templates"
 date: "2013-07-01"
 groups: ["layout"]
 groups_weight: 30
+notoc: true
 ---
 
 Home pages are of the type "node" and have all the [node
index ea6042c37f9342955b4239d0f6c82ac14ef8d4bc..e4ab29e6188a51b420ee54eeaae3e9d2c0379d90 100644 (file)
@@ -3,6 +3,7 @@ title: "RSS (feed) Templates"
 date: "2013-07-01"
 groups: ["layout"]
 groups_weight: 40
+notoc: "one"
 ---
 
 A single RSS template is used to generate all of the RSS content for the entire
index fb7cba7b9ce09fa80d5998645df1d540320c0ad2..4e474279be29640f9162d69bab265f73aecc41f2 100644 (file)
@@ -4,6 +4,7 @@ date: "2013-07-01"
 aliases: ["/doc/roadmap/"]
 groups: ["meta"]
 groups_weight: 20
+notoc: true
 ---
 
 In no particular order, here is what we are working on:
index 30a33a7c700b32fdbb0238688a04a09ed2ad1af9..b41b556b871464dfe93bf4770d52c67602c3f050 100644 (file)
@@ -5,6 +5,7 @@ aliases: ["/doc/configuration/"]
 groups: ['gettingStarted']
 linktitle: "Configuration"
 groups_weight: 40
+notoc: true
 ---
 
 The directory structure and templates provide the majority of the
index 88712a10a57f8d9e73b366731a4b545cba8c430c..93df6513696220429cd420473ffbadc30a808356 100644 (file)
@@ -4,6 +4,7 @@ date: "2013-07-01"
 aliases: ["/doc/source-directory/"]
 groups: ['gettingStarted']
 groups_weight: 50
+notoc: true
 ---
 
 Hugo takes a single directory and uses it as the input for creating a complete website.
index 23144b80bd7f9527a4cc19221ccd36b09fbd0707..9cfa4e66f4a31a9434cc55c85132d433265fb2d9 100644 (file)
@@ -4,6 +4,7 @@ date: "2013-07-01"
 aliases: ["/doc/usage/"]
 groups: ['gettingStarted']
 groups_weight: 30
+notoc: true
 ---
 
 Make sure either hugo is in your path or provide a path to it.
index 5e42b2a091d78f78c85bd4c3093cf5a26c40c247..c37b2883786f4d68a7eee5f7c812095a4663d8e5 100644 (file)
@@ -1,4 +1,10 @@
 {{ template "chrome/header.html" . }}
+          {{ if .Params.notoc }}
+          {{ else }}
+            <div id="toc" class="well col-md-4 col-sm-6">
+            {{ .TableOfContents }}
+            </div>
+          {{ end }}
           <h1>{{ .Title }}</h1>
           {{ .Content }}
 {{ template "chrome/footer.html" . }}
index cfdedfc70ccdb3b30260e360a381faff6d18d24b..de3b067c91eb87ca07336290243ed29456cc187e 100644 (file)
       </div>
       <script src="/static/js/jquery.js"></script>
       <script src="/static/js/bootstrap.min.js"></script>
+
+      <script>
+        $(document).ready(function() {
+            $("nav#TableOfContents a").click(function() {
+                $("html, body").animate({
+                    scrollTop: $($(this).attr("href")).offset().top-25 + "px"
+                }, {
+                    duration: 450,
+                });
+                return false;
+            });
+        });
+    </script>
     {{ template "chrome/analytics.html" . }}
+
   </body>
 
 </html>
index cf382bbfe13a4dbad57e1df5b2392f389dd01575..c02f584ef889ce8ec43ea6cb20d64b6aaf5aeeca 100755 (executable)
@@ -113,6 +113,25 @@ nav.navbar {
     background-color: #fdfdfb !important;\r
 }\r
 \r
+#toc {\r
+    float: right;\r
+    margin-left: 1em;\r
+    padding: 1em;\r
+}\r
+\r
+#TableOfContents > ul {\r
+    margin-left: -1em;\r
+    padding: 0;\r
+}\r
+\r
+#TableOfContents>ul>li {\r
+   list-style: none outside none;\r
+}\r
+\r
+#TableOfContents > ul > li > a {\r
+    padding-left: 1em;\r
+}\r
+\r
 #main table{width:100%;margin-bottom:20px;}#main table thead>tr>th,#main table tbody>tr>th,#main table tfoot>tr>th,#main table thead>tr>td,#main table tbody>tr>td,#main table tfoot>tr>td{padding:8px;line-height:1.428571429;vertical-align:top;border-top:1px solid #dddddd;}\r
 #main table thead>tr>th{vertical-align:bottom;border-bottom:2px solid #dddddd;}\r
 #main table caption+thead tr:first-child th,#main table colgroup+thead tr:first-child th,#main table thead:first-child tr:first-child th,#main table caption+thead tr:first-child td,#main table colgroup+thead tr:first-child td,#main table thead:first-child tr:first-child td{border-top:0;}\r