dufu

command module
v0.0.0-...-7a7d34f Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 23, 2014 License: MIT Imports: 5 Imported by: 0

README

Dufu (WIP) Gobuild Download

A fast, pluggable static site generator using ware in Golang.

Usage:

Commands
$ dufu help
dufu build
$ dufu help build

Samples:

package main

import (
	"log"
	"runtime"
	"time"

	"github.com/futurespace/dufu/plugins/drafts"
	"github.com/futurespace/dufu/plugins/markdown"
	"github.com/futurespace/dufu/plugins/permalinks"
	"github.com/futurespace/dufu/plugins/template"
	"github.com/futurespace/dufu/space"
	mw "github.com/futurespace/ware"
)

func main() {
	s := space.Classic()
	s.Use(func(c mw.Context, fs space.Filesystem, log *log.Logger) {
		c.Next()
		log.Printf("Compiled %v files\n", len(fs.Files()))
	})
	// File Processor Middleware
	p := s.Processor
	p.Use(func(c mw.Context, log *log.Logger, f *space.File) {
		start := time.Now()
		log.Printf("File Started %s", f.Info.Name())
		c.Next()
		log.Printf("File Rendered %v \n", time.Since(start))
	})
	p.Use(drafts.Handle())
	p.Use(markdown.Render())
	p.Use(permalinks.Handle("pretty"))
	p.Use(template.Renderer(template.Options{
		Layout: "layout",
	}))
	p.Use(func(f *space.File, r template.Render) {
		r.HTML(0, "post", f.Metadata)
	})
	s.Run()
}

License

MIT

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
Godeps
_workspace/src/code.google.com/p/go.net/html
Package html implements an HTML5-compliant tokenizer and parser.
Package html implements an HTML5-compliant tokenizer and parser.
_workspace/src/code.google.com/p/go.net/html/atom
Package atom provides integer codes (also known as atoms) for a fixed set of frequently occurring HTML strings: tag names and attribute keys such as "p" and "id".
Package atom provides integer codes (also known as atoms) for a fixed set of frequently occurring HTML strings: tag names and attribute keys such as "p" and "id".
_workspace/src/code.google.com/p/go.net/html/charset
Package charset provides common text encodings for HTML documents.
Package charset provides common text encodings for HTML documents.
_workspace/src/github.com/codegangsta/cli
Package cli provides a minimal framework for creating and organizing command line Go applications.
Package cli provides a minimal framework for creating and organizing command line Go applications.
_workspace/src/github.com/codegangsta/inject
Package inject provides utilities for mapping and injecting dependencies in various ways.
Package inject provides utilities for mapping and injecting dependencies in various ways.
_workspace/src/github.com/futurespace/ware
Package ware is a powerful package for easily create middleware layer in Golang.
Package ware is a powerful package for easily create middleware layer in Golang.
_workspace/src/github.com/russross/blackfriday
Blackfriday markdown processor.
Blackfriday markdown processor.
_workspace/src/gopkg.in/yaml.v1
Package yaml implements YAML support for the Go language.
Package yaml implements YAML support for the Go language.
cmd
plugins
template
Package render is a middleware for Dufu that provides easy HTML template rendering.
Package render is a middleware for Dufu that provides easy HTML template rendering.
Forked form https://github.com/go-martini/martini/blob/master/env.go Front-matter: http://jekyllrb.com/docs/frontmatter/
Forked form https://github.com/go-martini/martini/blob/master/env.go Front-matter: http://jekyllrb.com/docs/frontmatter/

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL