model

package
v0.0.0-...-8d66981 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2022 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ContentPath

type ContentPath struct {
	// Common
	IsDir   bool
	URLPath string
	Title   string

	// File only
	UpdateTime time.Time

	// Dir only
	NChild int
}

ContentPath is path to a content.

type DirData

type DirData struct {
	URLPath    string
	PathTrails []ContentPath

	Title       string
	Description string
	Author      string
	Content     template.HTML
	ChildItems  []ContentPath
	ChildTags   []TagPath

	PageSize    int
	CurrentPage int
	MaxPage     int
}

DirData is data that used when rendering a directory.

type FileData

type FileData struct {
	URLPath    string
	PathTrails []ContentPath

	Title       string
	Description string
	Author      string
	CreateTime  time.Time
	UpdateTime  time.Time
	Content     template.HTML

	Tags     []TagPath
	PrevFile ContentPath
	NextFile ContentPath
}

FileData is data that used when rendering a file.

type Metadata

type Metadata struct {
	// Content's metadatas
	Title       string    `toml:",omitempty"`
	Description string    `toml:",omitempty"`
	Author      string    `toml:",omitempty"`
	CreateTime  time.Time `toml:",omitempty"`
	UpdateTime  time.Time `toml:",omitempty"`
	Tags        []string  `toml:",omitempty"`
	Draft       bool      `toml:",omitempty"`

	// Theme's metadatas
	Theme            string `toml:",omitempty"`
	DirTemplate      string `toml:",omitempty"`
	FileTemplate     string `toml:",omitempty"`
	TagFilesTemplate string `toml:",omitempty"`
	Pagination       int    `toml:",omitempty"`
}

Metadata is metadata of a content.

type TagFilesData

type TagFilesData struct {
	URLPath    string
	PathTrails []ContentPath
	ActiveTag  string

	Title       string
	Files       []ContentPath
	PageSize    int
	CurrentPage int
	MaxPage     int
}

TagFilesData is template model for rendering a tag file list.

type TagPath

type TagPath struct {
	URLPath string
	Name    string
	Count   int
}

TagPath is path to a tag files.

Jump to

Keyboard shortcuts

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