shithub: hugo

Download patch

ref: ddad1e04ac1fcbda6bbe70fb39a4a60864f49faf
parent: d36d7fba6ac7a9936d83b04f87d5cd7ba035164d
author: spf13 <[email protected]>
date: Fri Aug 2 12:30:26 EDT 2013

adding previous next capabilities

--- a/README.md
+++ b/README.md
@@ -68,6 +68,7 @@
 #### Running Hugo
 
     cd /path/to/hugo
+    go install github.com/spf13/hugo/hugolibs
     go run main.go
 
 #### Building Hugo
@@ -118,7 +119,7 @@
     |   |   └── youtube.html
     |   ├── index.html
     |   └── rss.xml
-    └── public
+    └── static
 
 This directory structure tells us a lot about this site:
 
@@ -185,8 +186,9 @@
     $ hugo --help
     usage: hugo [flags] []
       -b, --base-url="": hostname (and path) to the root eg. http://spf13.com/
-      -d, --build-drafts=false: include content marked as draft
+      -D, --build-drafts=false: include content marked as draft
           --config="": config file (default is path/config.yaml|json|toml)
+      -d, --destination="": filesystem path to write files to
       -h, --help=false: show this help
           --port="1313": port to run web server on, default :1313
       -S, --server=false: run a (very) simple web server
@@ -214,6 +216,7 @@
        Watching for changes. Press ctrl+c to stop
        15 pages created
        0 tags created
+       in 8 ms
 
 Hugo can even run a server and create your site at the same time!
 
@@ -221,6 +224,7 @@
        Watching for changes. Press ctrl+c to stop
        15 pages created
        0 tags created
+       in 8 ms
        Web Server is available at http://localhost:1313
        Press ctrl+c to stop
 
@@ -527,6 +531,17 @@
 
 ## Release Notes
 
+* **0.8.0** August 1, 2013
+  * Added support for pretty urls (filename/index.html vs filename.html)
+  * Hugo supports a destination directory
+  * Will efficiently sync content in static to destination directory
+  * Cleaned up options.. now with support for short and long options
+  * Added support for TOML
+  * Added support for YAML
+  * Added support for Previous & Next
+  * Support for Series
+  * Adding verbose output
+  * Loads of bugfixes
 * **0.7.0** July 4, 2013
   * Hugo now includes a simple server
   * First public release
@@ -544,8 +559,6 @@
  * Syntax highlighting
  * Previous & Next
  * Related Posts
- * Support for TOML front matter -- in head
- * Proper YAML support for front matter -- in head
  * Support for other formats
 
 ## Contributing
--- a/hugolib/site.go
+++ b/hugolib/site.go
@@ -16,6 +16,7 @@
 import (
 	"bitbucket.org/pkg/inflect"
 	"bytes"
+	"errors"
 	"fmt"
 	"github.com/spf13/nitro"
 	"html/template"
@@ -24,7 +25,6 @@
 	"path/filepath"
 	"strings"
 	"time"
-	"errors"
 	//"sync"
 )
 
@@ -74,11 +74,12 @@
 	site.checkDescriptions()
 }
 
-func (site *Site) Process() (err error){
+func (site *Site) Process() (err error) {
 	site.initialize()
 	site.prepTemplates()
 	site.timer.Step("initialize & template prep")
 	site.CreatePages()
+	site.setupPrevNext()
 	site.timer.Step("import pages")
 	if err = site.BuildSiteMeta(); err != nil {
 		return
@@ -218,6 +219,18 @@
 	}
 
 	s.Pages.Sort()
+}
+
+func (s *Site) setupPrevNext() {
+	for i, _ := range s.Pages {
+		if i < len(s.Pages)-1 {
+			s.Pages[i].Next = s.Pages[i+1]
+		}
+
+		if i > 0 {
+			s.Pages[i].Prev = s.Pages[i-1]
+		}
+	}
 }
 
 func (s *Site) BuildSiteMeta() (err error) {