Documentation ¶
Index ¶
- func CleanUpBuildFiles() error
- func DeleteBuildDirectory(outputPath string) error
- func DownloadLatestRelease(versionTag string) error
- func EnsureDirExists(dirPath string) error
- func GenerateHTML(links *Links) error
- func GenerateRedirects(links *Links) error
- func ParseConfig(links *Links)
- func ReadIndexHTML() ([]byte, error)
- func ReplaceFile(srcFile, destFile string) error
- func ValidateAndCopyLinksAssets(links *Links, assetsPath string) error
- func ValidateButtonClass(name string) (bool, error)
- func ValidateButtonImage(name string) (bool, error)
- func WriteRedirectsToFile(redirects []string) error
- type Bio
- type Link
- type Links
- type Meta
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CleanUpBuildFiles ¶
func CleanUpBuildFiles() error
deletes the files specified in FILES_TO_DELETE from the build directory
func DeleteBuildDirectory ¶
func DownloadLatestRelease ¶
func EnsureDirExists ¶
checks if a directory exists and creates it if it doesn't.
func GenerateHTML ¶
GenerateHTML generates HTML from the template and JSON configuration
func GenerateRedirects ¶
GenerateRedirects generates a _redirects file based on the redirects in the links JSON
func ParseConfig ¶
func ParseConfig(links *Links)
func ReadIndexHTML ¶
func ReplaceFile ¶
func ValidateAndCopyLinksAssets ¶
verifies if the icon URLs in the links struct point to files and copies them to the build directory
func ValidateButtonClass ¶
validates if the given button class exists in the brands.css file
func ValidateButtonImage ¶
func WriteRedirectsToFile ¶
WriteRedirectsToFile writes redirects to a _redirects file in the build directory
Types ¶
type Bio ¶
type Bio struct { IconURL string `json:"ICON_URL"` Title string `json:"TITLE"` Description string `json:"DESCRIPTION"` }
Bio represents the bio section of the JSON
type Link ¶
type Link struct { Brand string `json:"brand"` Icon string `json:"icon"` Name string `json:"name"` Link string `json:"link"` Redirects []struct { Src string `json:"src"` Dest string `json:"dest"` Code int `json:"code"` } `json:"redirects"` }
Link represents a single link entry
type Links ¶
type Links struct { DownloadTagVer string `json:"DOWNLOAD_TAG_VER"` Meta Meta `json:"META"` Bio Bio `json:"BIO"` BaseShortURL string `json:"BASE_SHORT_URL"` EnableRedirects bool `json:"ENABLE_REDIRECTS"` Links []Link `json:"LINKS"` }
Links represents the entire JSON structure
func ParseLinksJSON ¶
ParseLinksJSON parses the JSON file at the given path and returns the Links structure