Skip to content

Commit

Permalink
Merge branch 'dev' into pu
Browse files Browse the repository at this point in the history
  • Loading branch information
gernest committed Aug 31, 2015
2 parents b3fb721 + 0e81537 commit 89b558c
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 29 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
bower_components
.idea
testdata/sample/_site
dist
dist
cmd/bongo/bongo
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
cmd_dir:=cmd/bongo
.PHONY: all dist
ifeq "$(origin APP_VER)" "undefined"
VERSION=0.1
APP_VER=0.1
endif
all: test
@go vet
Expand All @@ -16,7 +16,7 @@ deps:

dist:
-@rm -r dist
@gox -output="dist/{{.Dir}}.v$(VERSION)_{{.OS}}_{{.Arch}}/{{.Dir}}" ./cmd/bongo
@gox -output="dist/{{.Dir}}v$(APP_VER)_{{.OS}}_{{.Arch}}/{{.Dir}}" ./cmd/bongo

test:
@go test
Expand Down
Binary file removed cmd/bongo/bongo
Binary file not shown.
9 changes: 3 additions & 6 deletions cmd/bongo/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@ import (
"os"
"path/filepath"

"github.com/bongo-contrib/loaders"
"github.com/bongo-contrib/models"

"github.com/gernest/bongo"

"gopkg.in/fsnotify.v1"
Expand All @@ -22,7 +19,7 @@ var (
}
sourceFlagName = "source"
appName = "bongo"
version = "0.1.0"
version = "0.1.1"
)

func buildFlags() []cli.Flag {
Expand Down Expand Up @@ -60,7 +57,7 @@ func serve(ctx *cli.Context) {
if err != nil {
log.Println(err)
}
files, err := loaders.New().Load(src)
files, err := bongo.NewLoader().Load(src)
if err != nil {
log.Fatal(err)
}
Expand All @@ -73,7 +70,7 @@ func serve(ctx *cli.Context) {
watch.Add(file)
}
go func() {
dir := filepath.Join(src, models.OutputDir)
dir := filepath.Join(src, bongo.OutputDir)
log.Println("serving website", dir, " at http://localhost:8000")
log.Fatal(http.ListenAndServe(":8000", http.FileServer(http.Dir(dir))))
}()
Expand Down
23 changes: 3 additions & 20 deletions doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -142,31 +142,14 @@ Important frontmatter settings,
The Library
Bongo is modular, and uses interfaces to define its components. Interfaces for static
website generation are found in the https://github.com/bongo-contrib/models
Infact, bongo just utilize the Interfaces defined in the https://github.com/bongo-contrib/models
package.The most important interface is the Generator interface.
Bongo is modular, and uses interfaces to define its components.The most important interface is
the Generator interface.
So, you can implement your own Generator interface, and pass it to the bongo library to have your
own static website generator with your own rules.
I challenge you, to try implementing different Generators. Or, implement different components of the
generator interface. I have default implementations in separate packages to pave way for user submissions.
the following are the packages containing the implementations.
github.com/bongo-contrib/loaders
- FileLoader implementations
github.com/bongo-contrib/matters
- FrontMatter implementations
github.com/bongo-contrib/models
- Definitions of all interfaces
github.com/bongo-contrib/renderers
- Renderer implementations.
generator interface. I have default implementations shipped with bongo.
*/
package bongo

0 comments on commit 89b558c

Please sign in to comment.