readers

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2022 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

This section is empty.

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

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"`
	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"`
	} `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