Documentation ¶
Overview ¶
Package config ...
Package config ...
Package config ...
Package config ...
Package config ...
Package config ...
Package config ...
Package config ...
Package config ...
Package config ...
Package config ...
Index ¶
- Constants
- Variables
- type API
- type AppTemplate
- type IConfig
- type MenuConfig
- type NoPage
- type NoPageItems
- type Pages
- type Paths
- type ProjectConfig
- type PromptContent
- type PromptObject
- type ResourceItem
- type StarterTemplate
- type SveltinConfig
- func (c *SveltinConfig) GetAPIFilename() string
- func (c *SveltinConfig) GetAPIPath() string
- func (c *SveltinConfig) GetAPIVersion() string
- func (c *SveltinConfig) GetBuildPath() string
- func (c *SveltinConfig) GetConfigPath() string
- func (c *SveltinConfig) GetContentPageFilename() string
- func (c *SveltinConfig) GetContentPath() string
- func (c *SveltinConfig) GetIndexEndpointFilename() string
- func (c *SveltinConfig) GetIndexPageFilename() string
- func (c *SveltinConfig) GetLibPath() string
- func (c *SveltinConfig) GetParamsPath() string
- func (c *SveltinConfig) GetProjectRoot() string
- func (c *SveltinConfig) GetRoutesPath() string
- func (c *SveltinConfig) GetSlugEndpointFilename() string
- func (c *SveltinConfig) GetSlugPageFilename() string
- func (c *SveltinConfig) GetSrcPath() string
- func (c *SveltinConfig) GetStaticPath() string
- func (c *SveltinConfig) GetThemeComponentsPath() string
- func (c *SveltinConfig) GetThemeConfigFilename() string
- func (c *SveltinConfig) GetThemePartialsPath() string
- func (c *SveltinConfig) GetThemesPath() string
- type TemplateData
- type Theme
- type ThemeData
- type TplConfig
Constants ¶
const ( BlankTheme string = "blank" SveltinTheme string = "sveltin" ExistingTheme string = "existing" )
names for the available thems options.
Variables ¶
var AvailableThemes = []string{BlankTheme, SveltinTheme, ExistingTheme}
AvailableThemes is the list of the available themes.
Functions ¶
This section is empty.
Types ¶
type API ¶
type API struct { Version string `mapstructure:"version"` Filename string `mapstructure:"filename"` }
API represents the API folder structure in a Sveltin project.
type AppTemplate ¶
AppTemplate is the stuct presenting the github repository used by sveltin to clone the starter project repos.
type IConfig ¶
type IConfig interface { GetProjectRoot() string GetBuildPath() string GetConfigPath() string GetContentPath() string GetStaticPath() string GetSrcPath() string GetAPIPath() string GetAPIVersion() string GetAPIFilename() string GetPublicAPIFilename() string GetLibPath() string GetRoutesPath() string GetThemesPath() string GetThemeConfigFilename() string GetThemeComponentsPath() string GetThemePartialsPath() string GetIndexPageFilename() string GetSlugPageFilename() string GetContentPageFilename() string }
IConfig is the interface defining the methods to be implemented.
type MenuConfig ¶
type MenuConfig struct { Resources []*ResourceItem Pages []string WithContent bool }
MenuConfig is the struct representing a menu item.
type NoPage ¶
type NoPage struct { Config *ProjectConfig Items *NoPageItems }
NoPage is the struct representing a no-public page (sitemap and rss) for a sveltin project.
type NoPageItems ¶
type NoPageItems struct { Resources []string Content map[string][]string Metadata map[string][]string Pages []string }
NoPageItems is the struct representing an item of no-public page (sitemap and rss) for a sveltin project.
type Pages ¶
type Pages struct { Content string `mapstructure:"content"` Index string `mapstructure:"index"` IndexEndpoint string `mapstructure:"indexendpoint"` Slug string `mapstructure:"slug"` SlugEndpoint string `mapstructure:"slugendpoint"` }
Pages is the struct representing a public page and its content for a sveltin project.
type Paths ¶
type Paths struct { Build string `mapstructure:"build"` Config string `mapstructure:"config"` Content string `mapstructure:"content"` Static string `mapstructure:"static"` Themes string `mapstructure:"themes"` Src string `mapstructure:"src"` Params string `mapstructure:"params"` Lib string `mapstructure:"lib"` Routes string `mapstructure:"routes"` API string `mapstructure:"api"` }
Paths is the struct mapping the folders structure for a sveltin project.
type ProjectConfig ¶ added in v0.4.0
type ProjectConfig struct { BaseURL string `mapstructure:"VITE_PUBLIC_BASE_PATH"` SitemapChangeFreq string `mapstructure:"sitemapChangeFreq"` SitemapPriority string `mapstructure:"sitemapPriority"` SvelteKitBuildFolder string `mapstructure:"SVELTEKIT_BUILD_FOLDER"` FTPHost string `mapstructure:"FTP_HOST"` FTPPort int `mapstructure:"FTP_PORT"` FTPUser string `mapstructure:"FTP_USER"` FTPPassword string `mapstructure:"FTP_PASSWORD"` FTPServerFolder string `mapstructure:"FTP_SERVER_FOLDER"` FTPDialTimeout int `mapstructure:"FTP_DIAL_TIMEOUT"` FTPEPSVMode bool `mapstructure:"FTP_EPSV"` }
ProjectConfig is the struct used to map the env.production file props.
type PromptContent ¶
PromptContent represents an ask to the user and contains the relative error message.
type PromptObject ¶ added in v0.7.0
PromptObject represents an item to display inside the list by promptui.
func (*PromptObject) String ¶ added in v0.7.0
func (po *PromptObject) String() string
type ResourceItem ¶
type ResourceItem struct {
// contains filtered or unexported fields
}
ResourceItem is a struct representing a resource and its content as menu item.
func NewResourceItem ¶
func NewResourceItem(name string) *ResourceItem
NewResourceItem returns a pointer to a ResourceItem struct.
func (*ResourceItem) AddChild ¶
func (r *ResourceItem) AddChild(name string)
AddChild appends an item to the slice of contents.
func (*ResourceItem) GetContents ¶
func (r *ResourceItem) GetContents() []string
GetContents returns a slice of strings with contents for a resource.
func (*ResourceItem) GetName ¶
func (r *ResourceItem) GetName() string
GetName returns a string representing the resource item name.
type StarterTemplate ¶ added in v0.8.1
StarterTemplate is the stuct presenting the github repository used by sveltin to clone the starter project repos.
type SveltinConfig ¶
type SveltinConfig struct { Pages Pages `mapstructure:"pages"` Paths Paths `mapstructure:"paths"` API API `mapstructure:"api"` Theme Theme `mapstructure:"theme"` }
SveltinConfig is the struct used the map the YAML file.
func (*SveltinConfig) GetAPIFilename ¶
func (c *SveltinConfig) GetAPIFilename() string
GetAPIFilename returns a string representing the path to the 'src/routes/api/v1/<resource>/index.ts' folder relative to the current working directory.
func (*SveltinConfig) GetAPIPath ¶
func (c *SveltinConfig) GetAPIPath() string
GetAPIPath returns a string representing the path to the 'src/routes/api' folder relative to the current working directory.
func (*SveltinConfig) GetAPIVersion ¶
func (c *SveltinConfig) GetAPIVersion() string
GetAPIVersion returns a string representing the path to the 'src/routes/api/v1' folder relative to the current working directory.
func (*SveltinConfig) GetBuildPath ¶
func (c *SveltinConfig) GetBuildPath() string
GetBuildPath returns a string representing the path to the 'build' folder relative to the current working directory.
func (*SveltinConfig) GetConfigPath ¶
func (c *SveltinConfig) GetConfigPath() string
GetConfigPath returns a string representing the path to the 'config' folder relative to the current working directory.
func (*SveltinConfig) GetContentPageFilename ¶
func (c *SveltinConfig) GetContentPageFilename() string
GetContentPageFilename returns a string representing the path to the 'content' folder relative to the current working directory.
func (*SveltinConfig) GetContentPath ¶
func (c *SveltinConfig) GetContentPath() string
GetContentPath returns a string representing the path to the 'content' folder relative to the current working directory.
func (*SveltinConfig) GetIndexEndpointFilename ¶ added in v0.6.0
func (c *SveltinConfig) GetIndexEndpointFilename() string
GetIndexEndpointFilename returns a string representing the path to the 'index' file relative to the current working directory.
func (*SveltinConfig) GetIndexPageFilename ¶
func (c *SveltinConfig) GetIndexPageFilename() string
GetIndexPageFilename returns a string representing the path to the 'index' file relative to the current working directory.
func (*SveltinConfig) GetLibPath ¶
func (c *SveltinConfig) GetLibPath() string
GetLibPath returns a string representing the path to the 'src/lib' folder relative to the current working directory.
func (*SveltinConfig) GetParamsPath ¶ added in v0.8.9
func (c *SveltinConfig) GetParamsPath() string
GetParamsPath returns a string representing the path to the 'src/params' folder relative to the current working directory.
func (*SveltinConfig) GetProjectRoot ¶
func (c *SveltinConfig) GetProjectRoot() string
GetProjectRoot returns a string representing the current working directory.
func (*SveltinConfig) GetRoutesPath ¶
func (c *SveltinConfig) GetRoutesPath() string
GetRoutesPath returns a string representing the path to the 'src/routes' folder relative to the current working directory.
func (*SveltinConfig) GetSlugEndpointFilename ¶ added in v0.6.0
func (c *SveltinConfig) GetSlugEndpointFilename() string
GetSlugEndpointFilename returns a string representing the path to the 'slug' file relative to the current working directory.
func (*SveltinConfig) GetSlugPageFilename ¶
func (c *SveltinConfig) GetSlugPageFilename() string
GetSlugPageFilename returns a string representing the path to the 'slug' file relative to the current working directory.
func (*SveltinConfig) GetSrcPath ¶
func (c *SveltinConfig) GetSrcPath() string
GetSrcPath returns a string representing the path to the 'src' folder relative to the current working directory.
func (*SveltinConfig) GetStaticPath ¶
func (c *SveltinConfig) GetStaticPath() string
GetStaticPath returns a string representing the path to the 'static' folder relative to the current working directory.
func (*SveltinConfig) GetThemeComponentsPath ¶
func (c *SveltinConfig) GetThemeComponentsPath() string
GetThemeComponentsPath returns a string representing the path to the 'themes/<theme>/components' folder relative to the current working directory.
func (*SveltinConfig) GetThemeConfigFilename ¶
func (c *SveltinConfig) GetThemeConfigFilename() string
GetThemeConfigFilename returns a string representing the path to the 'themes/theme.config.js' file relative to the current working directory.
func (*SveltinConfig) GetThemePartialsPath ¶
func (c *SveltinConfig) GetThemePartialsPath() string
GetThemePartialsPath returns a string representing the path to the 'themes/<theme>/partials' folder relative to the current working directory.
func (*SveltinConfig) GetThemesPath ¶
func (c *SveltinConfig) GetThemesPath() string
GetThemesPath returns a string representing the path to the 'themes' folder relative to the current working directory.
type TemplateData ¶
type TemplateData struct { ProjectName string NPMClient string BaseURL string PortNumber string Name string Resource string Type string Config *SveltinConfig Menu *MenuConfig NoPage *NoPage Theme *ThemeData Misc string }
TemplateData is the struct representing all the data to be passed to a template file.
type Theme ¶
type Theme struct { File string `mapstructure:"file"` Components string `mapStructure:"components"` Partials string `mapstructure:"partials"` }
Theme represents the theme folder structure in a Sveltin project.