Documentation ¶
Index ¶
- Constants
- func PostProcessing(parsedContent string) string
- type Parser
- func (parser *Parser) APILoad()
- func (parser *Parser) APISave(payloads []*get3w.SavePayload) error
- func (parser *Parser) Build(copy bool) error
- func (parser *Parser) DeletePage(summary *get3w.PageSummary) error
- func (parser *Parser) EachSite(callback func())
- func (parser *Parser) GetPosts(path string) []*get3w.Post
- func (parser *Parser) IsLocalFile(file *get3w.File) bool
- func (parser *Parser) LoadBasicFiles()
- func (parser *Parser) LoadSiteLayouts()
- func (parser *Parser) LoadSitePageSummaries()
- func (parser *Parser) LoadSitePages()
- func (parser *Parser) LoadSiteParameters()
- func (parser *Parser) LoadSitePosts()
- func (parser *Parser) LoadSiteSectionsFromDir()
- func (parser *Parser) LoadSiteSectionsFromPages(pages []*get3w.Page)
- func (parser *Parser) LogError(pageURL string, err error)
- func (parser *Parser) LogWarn(templateURL, pageURL, warning string)
- func (parser *Parser) Push(authConfig *home.AuthConfig, out io.Writer) (shouldLogin bool, err error)
- func (parser *Parser) WriteConfig() error
- func (parser *Parser) WritePage(page *get3w.Page) error
- type Storage
Constants ¶
const ( KeyConfig = "_config.yml" KeyPages = "_pages.md" KeySites = "_sites.md" KeyReadme = "README.md" PrefixLogs = "_logs" PrefixPosts = "_posts" PrefixIncludes = "_includes" PrefixLayouts = "_layouts" PrefixSections = "_sections" )
system const
const ( ExtHTML = ".html" ExtMD = ".md" ExtCSS = ".css" ExtJS = ".js" ExtPNG = ".png" )
system file or folder names
Variables ¶
This section is empty.
Functions ¶
func PostProcessing ¶
PostProcessing add additional content to html
Types ¶
type Parser ¶
type Parser struct { Owner string Name string Path string Storage Storage Config *get3w.Config Sites []*get3w.Site Default *get3w.Site Current *get3w.Site // contains filtered or unexported fields }
Parser contains attributes and operations of the app
func NewLocalParser ¶
NewLocalParser return local site
func NewS3Parser ¶
NewS3Parser returns a new s3 site
func (*Parser) APISave ¶
func (parser *Parser) APISave(payloads []*get3w.SavePayload) error
APISave returns true if the file is local only
func (*Parser) DeletePage ¶
func (parser *Parser) DeletePage(summary *get3w.PageSummary) error
DeletePage delete page file
func (*Parser) EachSite ¶
func (parser *Parser) EachSite(callback func())
EachSite trigger callback in each site
func (*Parser) IsLocalFile ¶
IsLocalFile returns true if the file is local only
func (*Parser) LoadBasicFiles ¶
func (parser *Parser) LoadBasicFiles()
LoadBasicFiles load resources for each site
func (*Parser) LoadSiteLayouts ¶
func (parser *Parser) LoadSiteLayouts()
LoadSiteLayouts load layouts for current site
func (*Parser) LoadSitePageSummaries ¶
func (parser *Parser) LoadSitePageSummaries()
LoadSitePageSummaries load summary summaries for current site
func (*Parser) LoadSitePages ¶
func (parser *Parser) LoadSitePages()
LoadSitePages load pages for current site
func (*Parser) LoadSiteParameters ¶
func (parser *Parser) LoadSiteParameters()
LoadSiteParameters load parameters for current site
func (*Parser) LoadSitePosts ¶
func (parser *Parser) LoadSitePosts()
LoadSitePosts load posts for current site
func (*Parser) LoadSiteSectionsFromDir ¶
func (parser *Parser) LoadSiteSectionsFromDir()
LoadSiteSectionsFromDir load sections for _sections directory
func (*Parser) LoadSiteSectionsFromPages ¶
LoadSiteSectionsFromPages load sections for pages
func (*Parser) Push ¶
func (parser *Parser) Push(authConfig *home.AuthConfig, out io.Writer) (shouldLogin bool, err error)
Push local to cloud.
func (*Parser) WriteConfig ¶
WriteConfig write content to config file
type Storage ¶
type Storage interface { GetRootPrefix(prefix ...string) string GetRootKey(url ...string) string GetSourcePrefix(prefix ...string) string GetSourceKey(url ...string) string GetDestinationPrefix(prefix ...string) string GetDestinationKey(url ...string) string Read(key string) ([]byte, error) Checksum(key string) (string, error) Write(key string, bs []byte) error WriteDestination(key string, bs []byte) error Download(key, downloadURL string) error Rename(owner, newName string, deleteAll bool) error CopyToDestination(sourceKey, destinationKey string) error Delete(key string) error DeleteDestination(key string) error GetFiles(prefix string) ([]*get3w.File, error) GetAllFiles(prefix string) ([]*get3w.File, error) IsExist(key string) bool DeleteFolder(prefix string) error NewFolder(prefix string) error }
Storage contains methods of storage operations