config

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2021 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AssetsConfig

type AssetsConfig struct {
	// path to a directory containing CSS and JS files
	StaticDir string `json:"static-dir"`
	// path to a directory containing JSON files for asset injection
	JSONDir string `json:"json-dir"`
	// path to a directory containing generate files
	GeneratedDir string `json:"generated-dir"`
}

AssetsConfig defines config options for assets

type Config

type Config struct {
	// The path to a directory containing HTML files
	HTMLDir string `json:"html-dir"`

	// The base URL of the site
	BaseURL string `json:"base-url"`

	// The assets to be used by the html-asset-manager
	Assets *AssetsConfig `json:"assets"`

	// The gen-images to generate and use by the html-asset-manager
	GenAssets *GeneratedImagesConfig `json:"gen-assets"`

	// The img-to-picture manipulation config
	ImgToPicture []*ImgToPicConfig `json:"img-to-picture"`

	// The ratio-wrapper manipulation config
	RatioWrapper []string `json:"ratio-wrapper"`
}

Config defines all config options for a config file.

func Get

func Get(filePath string) (*Config, error)

Get reads and parses a Config file

type GeneratedImagesConfig

type GeneratedImagesConfig struct {
	// path to a directory containing static assets
	StaticDir string `json:"static-dir"`
	// The path to a directory containing generated files
	OutputDir string `json:"output-dir"`
	// The maximum width in CSS pixels images should be
	MaxWidth int64 `json:"max-width"`
	// The maximum density to cater for
	MaxDensity int64 `json:"max-density"`
}

GeneratedImagesConfig defines config options for gen-imgs cmd

type ImgToPicConfig

type ImgToPicConfig struct {
	// The classname or tag of elements to replace img to picture
	ID string `json:"id"`
	// The maximum width the image will be in CSS pixels
	MaxWidth int64 `json:"max-width"`
	// The source sizes the picture should have
	SourceSizes []string `json:"source-sizes"`
	// Class to apply to the picture element
	Class string `json:"class"`
}

ImgToPicConfig defines config options for the img-to-picture manipulation

Jump to

Keyboard shortcuts

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