diff --git a/README.md b/README.md index 986db0a..7bb997c 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -go-LeanSite +[go-LeanSite](http://godoc.org/github.com/metaleap/go-leansite) =========== A super-minimalistic "dynamic-web-page" server written in Go, just to explore the net/http, html/template, and Gorilla web packages. diff --git a/__doc.html b/__doc.html new file mode 100644 index 0000000..4c413b0 --- /dev/null +++ b/__doc.html @@ -0,0 +1,388 @@ + + + Package github.com/metaleap/go-leansite + + + + + + + +
+
+

Package github.com/metaleap/go-leansite

+ + + + + + +
+
+
import "github.com/metaleap/go-leansite"
+
+
+
Overview
+
Index
+ + +
Subdirectories
+ +
+
+ +
+ +
+

Overview ▾

+

+A super-minimalistic "dynamic-web-page" server written in Go, just to explore the net/http, html/template, and Gorilla web packages. +

+ +
+
+ + + + + + +

Variables

+ +
var (
+    DirPath  string
+    DirWatch *uio.Watcher
+    Router   *mux.Router
+    SiteData struct {
+        TopNav NavItems
+        Blogs  map[string]BlogNav
+        // contains filtered or unexported fields
+    }
+)
+ + + + + + +

func Init

+
func Init(dirPath string) (err error)
+ + + + + +

func ListenAndServe

+
func ListenAndServe(addr string) (err error)
+ + + + + + +

type BlogNav

+
type BlogNav struct {
+    Nav BlogNavItems
+    // contains filtered or unexported fields
+}
+ + + + + + + + + + + + +

func (*BlogNav) ShowYear

+
func (me *BlogNav) ShowYear(year string) (dif bool)
+ + + + + + + +

type BlogNavItem

+
type BlogNavItem struct {
+    NavItem
+    Year, Month, Day string
+}
+ + + + + + + + + + + + + + +

type BlogNavItems

+
type BlogNavItems []BlogNavItem
+ + + + + + + + + + + + +

func (BlogNavItems) Len

+
func (me BlogNavItems) Len() int
+ + + + + +

func (BlogNavItems) Less

+
func (me BlogNavItems) Less(i, j int) bool
+ + + + + +

func (BlogNavItems) Swap

+
func (me BlogNavItems) Swap(i, j int)
+ + + + + + + + +
type NavItem struct {
+    CssClass, Href, Caption, Desc string
+}
+ + + + + + + + + + + + + +
func (me *NavItem) IsActive(pc *PageContext) bool
+ + + + + + + + +
type NavItems []NavItem
+ + + + + + + + + + + + + + +

type PageContext

+
type PageContext struct {
+    R               *http.Request
+    Path, PageTitle string
+    HtmlContent     template.HTML
+    TopNav          NavItems
+    Year            int
+}
+ + + + + + + + + + +

func NewPageContext

+
func NewPageContext(r *http.Request, path string) (me *PageContext)
+ + + + + + +

func (*PageContext) GetBlogArchive

+
func (me *PageContext) GetBlogArchive(path string) *BlogNav
+ + + + + + + + + + + + + + + +

Subdirectories

+ + + + + + + + + + + + + + + + + + + + + +
Name    Synopsis
..
helloworld    
+ + + + + +
+ + \ No newline at end of file diff --git a/doc.go b/doc.go new file mode 100644 index 0000000..0c104e4 --- /dev/null +++ b/doc.go @@ -0,0 +1,2 @@ +// A super-minimalistic "dynamic-web-page" server written in Go, just to explore the net/http, html/template, and Gorilla web packages. +package leansite diff --git a/helloworld/helloworld.go b/helloworld/helloworld.go index a342324..64a48ed 100644 --- a/helloworld/helloworld.go +++ b/helloworld/helloworld.go @@ -1,3 +1,4 @@ +// This is the app handler for running the helloworld Site on Google App Engine package helloworld import (