vss

package module
v0.13.0 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2024 License: Apache-2.0 Imports: 37 Imported by: 0

README

go vss

Documentation

Read: https://vss.veltiosoft.dev/

Development

Requirements
Commands

test

make test

build

make build

run server for docs

make serve-docs

fmt

make fmt

lint

make lint

LICENSE

MIT

References

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateSkeleton

func GenerateSkeleton(distDir string) error

func Run

func Run(args []string) int

func Version

func Version() string

Types

type BuildCommand

type BuildCommand struct {
	Meta
}

func (*BuildCommand) Help

func (c *BuildCommand) Help() string

func (*BuildCommand) Run

func (c *BuildCommand) Run(args []string) int

func (*BuildCommand) Synopsis

func (c *BuildCommand) Synopsis() string

type BuildConfig

type BuildConfig struct {
	IgnoreFiles []string       `toml:"ignore_files"`
	Goldmark    GoldMarkConfig `toml:"goldmark"`
}

type Builder

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

Builder is a struct for building a static site.

func NewBuilder

func NewBuilder(config *Config) *Builder

NewBuilder returns a new Builder.

func (Builder) GetDistPath

func (b Builder) GetDistPath() string

GetDistPath returns the dist directory path.

func (*Builder) ReloadConfig

func (b *Builder) ReloadConfig() error

ReloadConfig reloads the config file.

func (Builder) Run

func (b Builder) Run() error

Run builds the static site.

func (*Builder) SetBaseUrl

func (b *Builder) SetBaseUrl(baseURL string)

SetBaseUrl sets the base URL.

type Config

type Config struct {
	Build           BuildConfig `toml:"build"`
	SiteTitle       string      `toml:"site_title"`
	SiteDescription string      `toml:"site_description"`
	BaseUrl         string      `toml:"base_url"`

	// The following settings are not in config.toml
	Dist    string // dist directory
	Static  string // static directory
	Layouts string // layouts directory
}

func LoadConfig

func LoadConfig() (*Config, error)

LoadConfig loads a TOML text into a Config struct.

func (*Config) AsMap

func (c *Config) AsMap() map[string]interface{}

AsMap returns a map[string]interface{} representation of the Config struct.

type FileData

type FileData struct {
	Path        string
	Content     string
	FrontMatter YamlFrontMatter
}

FileData is a struct for markdown file data.

type GoldMarkConfig

type GoldMarkConfig struct {
	HighlightConfig *GoldMarkHighlightConfig `toml:"highlight"`
	RendererOptions *GoldMarkRendererOptions `toml:"renderer"`
}

GoldMarkConfig is a struct for configuring goldmark. なぜ Pointer なのか? config file にキーを設定したかどうかを判定するため

type GoldMarkHighlightConfig

type GoldMarkHighlightConfig struct {
	Style       *string
	WithNumbers *bool `toml:"with_numbers"`
}

type GoldMarkRendererOptions added in v0.12.0

type GoldMarkRendererOptions struct {
	WithUnsafe *bool `toml:"with_unsafe"`
}

type Meta

type Meta struct {
	Version  string
	Revision string
}

Meta contains the common fields required by all commands.

type NewCommand

type NewCommand struct {
	Meta
}

func (*NewCommand) Help

func (c *NewCommand) Help() string

func (*NewCommand) Run

func (c *NewCommand) Run(args []string) int

func (*NewCommand) Synopsis

func (c *NewCommand) Synopsis() string

type SelfUpdateCommand

type SelfUpdateCommand struct {
	Meta
}

func (*SelfUpdateCommand) Help

func (c *SelfUpdateCommand) Help() string

func (*SelfUpdateCommand) Run

func (c *SelfUpdateCommand) Run(args []string) int

func (*SelfUpdateCommand) Synopsis

func (c *SelfUpdateCommand) Synopsis() string

type SelfVersionCommand

type SelfVersionCommand struct {
	Meta
}

func (*SelfVersionCommand) Help

func (c *SelfVersionCommand) Help() string

func (*SelfVersionCommand) Run

func (c *SelfVersionCommand) Run(args []string) int

func (*SelfVersionCommand) Synopsis

func (c *SelfVersionCommand) Synopsis() string

type ServeCommand

type ServeCommand struct {
	Meta
	// contains filtered or unexported fields
}

func (*ServeCommand) Help

func (c *ServeCommand) Help() string

func (*ServeCommand) Run

func (c *ServeCommand) Run(args []string) int

func (*ServeCommand) Synopsis

func (c *ServeCommand) Synopsis() string

type YamlFrontMatter

type YamlFrontMatter struct {
	Author      string   `yaml:"author"`
	Title       string   `yaml:"title"`
	PubDatetime string   `yaml:"pub_datetime"`
	PostSlug    string   `yaml:"post_slug"`
	Description string   `yaml:"description"`
	Tags        []string `yaml:"tags"`
	Emoji       string   `yaml:"emoji"`
	OgImage     string   `yaml:"og_image"`
}

func (*YamlFrontMatter) AsMap

func (y *YamlFrontMatter) AsMap() map[string]interface{}

func (*YamlFrontMatter) SaveTwemojiPng

func (y *YamlFrontMatter) SaveTwemojiPng(w io.Writer) error

func (*YamlFrontMatter) SaveTwemojiSvg

func (y *YamlFrontMatter) SaveTwemojiSvg(w io.Writer) error

Directories

Path Synopsis
cmd
vss

Jump to

Keyboard shortcuts

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