config

package
v0.0.0-...-8988724 Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2023 License: MPL-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package config provides the structure of toml and yaml metadata found in collections (main site index), books (book index) and chapters.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Author

type Author struct {
	Name   string `toml:"name"`
	Bio    string `toml:"bio,omitempty"`
	Donate []Donation
}

type Book

type Book struct {
	Root             string        `toml:-`
	ID               string        `toml:"id,omitempty"`
	Title            string        `toml:"title"`
	Author           Author        `toml:"author,omitempty"`
	Mirrors          []string      `toml:"mirrors,omitempty"`
	ShortDescription string        `toml:"shortDescription,omitempty"`
	Genre            []string      `toml:"genre,omitempty"`
	Status           string        `toml:"status,omitempty"`
	CoverPath        string        `toml:"coverPath,omitempty"`
	LanguageCode     string        `toml:"languageCode,omitempty"`
	Copyright        string        `toml:"copyright,omitempty"`
	License          string        `toml:"license,omitempty"`
	ChaptersDir      string        `toml:"chaptersDir"`
	Blurb            template.HTML `toml:-`
	Chapters         []Chapter     `toml:-`
	StaticAssets     []string      `toml:-`
	Collection       *Collection   `toml:-`
}

type Chapter

type Chapter struct {
	ID           string
	Title        string
	Description  string
	Published    time.Time
	LastModified time.Time
	Content      template.HTML
	Parent       *Book
	Collection   *Collection
	Next         *Chapter
	Prev         *Chapter
}

func (Chapter) EstimatedReadingTime

func (c Chapter) EstimatedReadingTime() *readingtime.Result

func (Chapter) SlugHTML

func (c Chapter) SlugHTML() string

type Collection

type Collection struct {
	Root         string `toml:-`
	BooksDir     string `toml:"booksDir"`
	LayoutDir    string `toml:"layoutDir"`
	OutputDir    string `toml:"outputDir"`
	StaticDir    string `toml:"staticDir"`
	Title        string `toml:"title"`
	BaseURL      string `toml:"baseURL,omitempty"`
	LanguageCode string `toml:"languageCode,omitempty"`
	Books        []Book `toml:-`
}

type Donation

type Donation struct {
	Name        string `toml:"name,omitempty"`
	Link        string `toml:"link"`
	NonLinkItem bool   `toml:"nonLinkItem,omitempty"`
}

Jump to

Keyboard shortcuts

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