readers

package
v0.5.24 Latest Latest
Warning

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

Go to latest
Published: Jan 3, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package readers knows how to read different configuration files.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckConfigFileFlag added in v0.5.6

func CheckConfigFileFlag(flag string)

CheckConfigFileFlag sets global var to --config flag value (or defaults to plenti.json).

Types

type ContentType

type ContentType struct {
	Fields map[string]string `json:"-"`
}

ContentType maps to field key/values for content types.

func GetTypeFields

func GetTypeFields(typeFileContents []byte) (ContentType, error)

GetTypeFields reads the key/values for an individual content type JSON file.

type NpmConfig

type NpmConfig struct {
	Dependencies map[string]string `json:"dependencies"`
	Module       string            `json:"module"`
}

NpmConfig is the NPM configuration file values from package.json.

func GetNpmConfig

func GetNpmConfig(path string) NpmConfig

GetNpmConfig reads the prod dependencies from package.json.

type SiteConfig

type SiteConfig struct {
	BuildDir    string                  `json:"build"`
	BaseURL     string                  `json:"baseurl"`
	Theme       string                  `json:"theme"`
	EntryPoint  string                  `json:"entrypoint"`
	ThemeConfig map[string]ThemeOptions `json:"theme_config"`
	Local       struct {
		Port int `json:"port"`
	} `json:"local"`
	Routes map[string]string `json:"routes"`
	CMS    struct {
		Repo        string `json:"repo"`
		RedirectUrl string `json:"redirect_url"`
		AppId       string `json:"app_id"`
		Branch      string `json:"branch"`
	} `json:"cms"`
}

SiteConfig is the site's configuration file values.

func GetSiteConfig

func GetSiteConfig(basePath string) (SiteConfig, string)

GetSiteConfig reads the site's configuration file values.

type ThemeOptions

type ThemeOptions struct {
	URL     string   `json:"url"`
	Commit  string   `json:"commit"`
	Exclude []string `json:"exclude,omitempty"`
}

ThemeOptions is the theme configuration information.

Jump to

Keyboard shortcuts

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