cms

package
v0.0.0-...-e633eee Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ConfigPath     = "moonbase.yaml"
	ImagesFolder   = "_images"
	SettingsFolder = "_settings"
)
View Source
const PackageJSONFile = "package.json"

Variables

This section is empty.

Functions

func GenerateSchema

func GenerateSchema(name string, contents string) (string, error)

func GetEmptyLocalisedContent

func GetEmptyLocalisedContent(cs content.Schema, locales []string) (*content.MergedContentData, error)

func GetNameLocaleFromPath

func GetNameLocaleFromPath(path string) (string, string)

func JsonToMarkdown

func JsonToMarkdown(json string) (string, error)

func ParseBlob

func ParseBlob(contentType string, content string) (map[string]interface{}, error)

func ParseJSON

func ParseJSON(content string) (map[string]interface{}, error)

func ResolveDepsVersions

func ResolveDepsVersions(pkgJson *PackageJSON, depNames []string) map[string]string

func SeparateLocalisedContent

func SeparateLocalisedContent(mcd content.MergedContentData, locales []string, workDir, collection string) ([]gh.BlobEntry, error)

Types

type CollectionSchema

type CollectionSchema struct {
	Name   string        `json:"name"`
	Fields []SchemaField `json:"fields,omitempty"`
}

type Config

type Config struct {
	WorkDir string `json:"workdir" yaml:"workdir"`
}

func ParseConfig

func ParseConfig(data []byte) *Config

type PackageJSON

type PackageJSON struct {
	Dependencies map[string]string `json:"dependencies"`
}

func ParsePackageJSON

func ParsePackageJSON(data []byte) *PackageJSON

type Schema

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

func NewSchema

func NewSchema(schema []byte) *Schema

func (*Schema) Available

func (s *Schema) Available() bool

func (*Schema) Validate

func (s *Schema) Validate(v map[string]interface{}) error

func (*Schema) ValidateString

func (s *Schema) ValidateString(data string) error

type SchemaField

type SchemaField struct {
	Name     string            `json:"name"`
	Label    string            `json:"label"`
	Type     string            `json:"type"`
	List     bool              `json:"list"`
	Required bool              `json:"required"`
	Object   *CollectionSchema `json:"object,omitempty"`
}

Jump to

Keyboard shortcuts

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