glubcms

package module
v0.0.0-...-7d16fb1 Latest Latest
Warning

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

Go to latest
Published: Aug 22, 2021 License: MIT Imports: 18 Imported by: 0

README

glubcms

fast and lightweight stand-alone cms for small blogs and homepages backed by git

Roadmap

Documentation

Index

Constants

View Source
const GCTimeLayout = "2006-01-02 15:04"
View Source
const (
	PSep = string(os.PathSeparator)
)

Variables

View Source
var (
	ErrHidden = errors.New("Hidden")
)

Functions

func NewMdModifier

func NewMdModifier(r bf.Renderer) bf.Renderer

Types

type ContentRenderer

type ContentRenderer interface {
	Render() ([]byte, error)
}

type Entries

type Entries []Entry

func SplitEntries

func SplitEntries(e Entries) (Menu, Articles Entries)

func (Entries) Less

func (e Entries) Less(i, j int) bool

type Entry

type Entry struct {
	// contains filtered or unexported fields
}

func (*Entry) Active

func (e *Entry) Active() bool

func (*Entry) Author

func (a *Entry) Author() string

func (*Entry) Context

func (e *Entry) Context(c int) Entries

func (*Entry) Date

func (e *Entry) Date() time.Time

func (*Entry) ExtraScript

func (e *Entry) ExtraScript() []string

func (*Entry) ExtraStyle

func (e *Entry) ExtraStyle() []string

func (*Entry) HTML

func (e *Entry) HTML() template.HTML

func (*Entry) IsArticle

func (e *Entry) IsArticle() bool

func (*Entry) IsIndex

func (e *Entry) IsIndex() bool
func (e *Entry) Link() string

func (*Entry) Next

func (e *Entry) Next() *Entry

func (*Entry) Prev

func (e *Entry) Prev() *Entry

func (*Entry) Priority

func (e *Entry) Priority() int

func (*Entry) Title

func (e *Entry) Title() string

type GCTime

type GCTime time.Time

func (GCTime) MarshalJSON

func (t GCTime) MarshalJSON() ([]byte, error)

func (GCTime) String

func (t GCTime) String() string

func (*GCTime) UnmarshalJSON

func (t *GCTime) UnmarshalJSON(b []byte) error

type Meta

type Meta struct {
	Author      string
	Date        GCTime
	Title       string
	Priority    int
	Hidden      bool `json:",omitempty"`
	Unsafe      bool `json:",omitempty"`
	IsIndex     bool `json:",omitempty"`
	ExtraStyle  []string
	ExtraScript []string
}

type Page

type Page struct {
	Menu     []Entries
	Articles Entries
	Content  *Entry
	Index    *Entry
	ModTime  time.Time
}

func PageFromDir

func PageFromDir(fs backend.Backend, path string) (Page, error)

func (Page) Outline

func (p Page) Outline() string

For debugging

type StaticHandler

type StaticHandler struct {
	// contains filtered or unexported fields
}

The StaticHandler behaves like http.ServeContent without directoy listings. It also implements the http.Filesystem interface.

func NewStaticHandler

func NewStaticHandler(fs http.FileSystem) StaticHandler

Serves all files from fs.

func (StaticHandler) Cd

func (sh StaticHandler) Cd(path string) StaticHandler

Return a new StaticHandler with new root directory.

func (StaticHandler) Open

func (sh StaticHandler) Open(name string) (http.File, error)

Implement the http.Filesystem interface.

func (StaticHandler) ServeHTTP

func (sh StaticHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)

Serve the file requestet by r. Error 404 on directory access.

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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