conf

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2022 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CONFIG_ROOT  = "config"
	CONFIG_THEME = "theme"
	CONFIG_TYPE  = "toml"

	CONTENT_ROOT  = "content"
	CONTENT_MEDIA = "content/media"
	CONTENT_MD    = "content/%s.md"

	MESSAGE_CONTENT  = "content"
	MESSAGE_PATH     = "path"
	MESSAGE_TOC      = "toc"
	META_CATALOG     = "catalog"
	META_ARCHIVE     = "archive"
	META_CATEGORY    = "category"
	META_DATE        = "date"
	META_TAG         = "tag"
	META_LANG        = "lang"
	META_SLUG        = "slug"
	META_TITLE       = "title"
	META_DESCRIPTION = "description"
	META_AUTHOR      = "author"

	MODEL_ARTICLE   = "article"
	MODEL_DOCUMENT  = "document"
	MODEL_PAGE      = "page"
	MODEL_I18N      = "i18n"
	MODEL_CUSTOMIZE = "customize"
	MODEL_STATIC    = "static"
	MODEL_SITE      = "site"
	MODEL_THMEM     = "theme"
	MODEL_EXTEND    = "extend"

	FEEDS_ATOM = "atom.xml"
	FEEDS_RSS  = "rss.xml"
	FEEDS_JSON = "feeds.json"

	PUBLIC_ROOT    = "public"
	PUBLIC_FEEDS   = "public/%s"
	PUBLIC_ASSETS  = "public/assets"
	PUBLIC_MEIDA   = "public/media"
	PUBLIC_SITEMAP = "public/sitemap.xml"
	PUBLIC_HTML    = "public%sindex.html"
	PUBLIC_XML     = "public/sitemap/%s.xml"

	ROOT_TOML      = "config.toml"
	PREFIX_CONTENT = "content/"
	PREFIX_PAGE    = "content/%s/"

	SITEMAP_XML = "%s/sitemap/%s.xml"
	SOURCE_YAML = "source/%s.yaml"
	SUFFIX_MD   = ".md"

	THEME_ROOT    = "theme"
	THEME_DEFAULT = "fungo"

	URL_SITE  = "https://github.com/fundipper/site"
	URL_THEME = "https://github.com/fundipper/theme"

	ERROR_CONFIG  = "config is nil"
	ERROR_CONTENT = "content is nil"
	ERROR_META    = "meta is nil"
	ERROR_TOC     = "toc is nil"
	ERROR_CATALOG = "catalog is nil"
	ERROR_EXIST   = "file is exist"
	ERROR_MATCH   = "name not match"
)

Variables

View Source
var (
	PARSE_STATE     bool
	THEME_USED      string
	THEME_I18N      string
	THEME_ASSETS    string
	THEME_TEMPLATES string
	THEME_HTML      string
	THEME_TOML      string
)

Functions

This section is empty.

Types

type Config

type Config struct {
	Article   []*Model
	Customize []*Model
	Document  []*Model
	Page      []*Model
	I18N      []*Model
	Static    []*Model
	Site      *Site
	Theme     *Theme
}

func NewConfig

func NewConfig() *Config

type Model

type Model struct {
	Name     string
	Route    string
	Path     string
	Action   string
	Template string
	Size     int
	Catalog  bool
	Root     bool
	Sidebar  []*Node
	Subtree  []string
}

func NewModel

func NewModel() *Model

func (*Model) Article

func (m *Model) Article() []*Model

func (*Model) Customize

func (m *Model) Customize() []*Model

func (*Model) Document

func (m *Model) Document() []*Model

func (*Model) I18N

func (m *Model) I18N() []*Model

func (*Model) Page

func (m *Model) Page() []*Model

func (*Model) Static

func (m *Model) Static() []*Model

type Node

type Node struct {
	Number string  `json:"number,omitempty"`
	Name   string  `json:"name,omitempty"`
	Route  string  `json:"route,omitempty"`
	Node   []*Node `json:"node,omitempty"`
}

type Site

type Site struct {
	Origin   string
	Port     string
	Name     string
	Slogan   string
	Theme    string
	Markdown struct {
		State struct {
			GFM            bool
			Table          bool
			Strikethrough  bool
			Linkify        bool
			TaskList       bool
			Emoji          bool
			DefinitionList bool
			Footnote       bool
			Typographer    bool
			Mathjax        bool
			Mermaid        bool
		}
		Highlighting struct {
			State      bool
			Theme      string
			LineNumber bool
		}
		Image struct {
			State     bool
			Source    string
			Target    string
			Attribute map[string]string
		}
		Link struct {
			State     bool
			Source    map[string]bool
			Attribute map[string]string
		}
		Video struct {
			State     bool
			Source    map[string]string
			Attribute map[string]string
		}
	}
	Sitemap struct {
		Changefreq string
		Priority   string
	}
	Feeds struct {
		Action  string
		Content bool
	}
}

Site site

func NewSite

func NewSite() *Site

type Theme

type Theme map[string]interface{}

func NewTheme

func NewTheme() *Theme

Jump to

Keyboard shortcuts

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