gotools/blog/blog.go

var validJSONPFunc

var golangOrgAbsLinkReplacer

type Config

type Doc

type Server

// NewServer constructs a new Server using the specified config.
func NewServer(cfg Config) (*Server, error) {}

var funcMap

// sectioned returns true if the provided Doc contains more than one section.
// This is used to control whether to display the table of contents and headings.
func sectioned(d *present.Doc) bool {}

// authors returns a comma-separated list of author names.
func authors(authors []present.Author) string {}

// authorName returns the first line of the Author text: the author's name.
func authorName(a present.Author) string {}

// loadDocs reads all content from the provided file system root, renders all
// the articles it finds, adds them to the Server's docs field, computes the
// denormalized docPaths, docTags, and tags fields, and populates the various
// helper fields (Next, Previous, Related) for each Doc.
func (s *Server) loadDocs(root string) error {}

// renderAtomFeed generates an XML Atom feed and stores it in the Server's
// atomFeed field.
func (s *Server) renderAtomFeed() error {}

type jsonItem

// renderJSONFeed generates a JSON feed and stores it in the Server's jsonFeed
// field.
func (s *Server) renderJSONFeed() error {}

// summary returns the first paragraph of text from the provided Doc.
func summary(d *Doc) string {}

type rootData

// ServeHTTP serves the front, index, and article pages
// as well as the ATOM and JSON feeds.
func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request) {}

type docsByTime

func (s docsByTime) Len() int           {}

func (s docsByTime) Swap(i, j int)      {}

func (s docsByTime) Less(i, j int) bool {}

// notExist reports whether the path exists or not.
func notExist(path string) bool {}