Documentation
¶
Index ¶
- Constants
- Variables
- func Build(c *config.Config) error
- func MakeAppJS(c *config.Config) ([]byte, error)
- func MakeAppWorkerJS(c *config.Config) ([]byte, error)
- func MakeFiles(c *config.Config) error
- func MakeIndexHTML(c *config.Config, basePath string, title string) ([]byte, error)
- func MakeManifestJSON(c *config.Config) ([]byte, error)
- func MakePages(c *config.Config) error
- func Serve(c *config.Config) error
- func WASMExecJS() string
- type AppJSData
- type AppWorkerJSData
- type IndexHTMLData
- type ManifestJSONData
Constants ¶
const ( // DefaultAppWorkersJS is the default template used in [MakeAppWorkerJS] to generate app-worker.js. DefaultAppWorkerJS = "" /* 2722-byte string literal not displayed */ // WASMExecJSGoCurrent is the wasm_exec.js file for the current version of Go. WASMExecJSGoCurrent = "" /* 18065-byte string literal not displayed */ // AppJS is the string used for [AppJSTmpl]. AppJS = "" /* 9365-byte string literal not displayed */ // ManifestJSON is the string used for [ManifestJSONTmpl]. ManifestJSON = "" /* 528-byte string literal not displayed */ // AppCSS is the string used for app.css. AppCSS = "" /* 3033-byte string literal not displayed */ // IndexHTML is the string used for [IndexHTMLTmpl]. IndexHTML = "" /* 2378-byte string literal not displayed */ )
Variables ¶
AppJSTmpl is the template used in MakeAppJS to build the app.js file
IndexHTMLTmpl is the template used in MakeIndexHTML to build the index.html file
var ManifestJSONTmpl = template.Must(template.New("manifest.webmanifest").Parse(ManifestJSON))
ManifestJSONTmpl is the template used in MakeManifestJSON to build the mainfest.webmanifest file
Functions ¶
func MakeAppWorkerJS ¶
MakeWorkerJS executes [config.Config.Web.ServiceWorkerTemplate]. If it empty, it sets it to DefaultAppWorkerJS.
func MakeFiles ¶
MakeFiles makes the necessary static web files based on the given configuration information.
func MakeIndexHTML ¶
MakeIndexHTML exectues IndexHTMLTmpl based on the given configuration information, base path for app resources (used in MakePages), and optional title (used in MakePages, defaults to config.Config.Name otherwise).
func MakeManifestJSON ¶
MakeManifestJSON exectues ManifestJSONTmpl based on the given configuration information.
func MakePages ¶ added in v0.1.1
MakePages makes a directory structure of pages for the core pages located at config.Config.Pages.
func Serve ¶
Serve serves the build output directory on the default network address at the config port.
func WASMExecJS ¶
func WASMExecJS() string
WASMExecJS returns the wasm_exec.js file appropriate for the Go verison being used.
Types ¶
type AppWorkerJSData ¶
AppWorkerJSData is the data passed to [config.Config.Web.ServiceWorkerTemplate]
type IndexHTMLData ¶
type IndexHTMLData struct { BasePath string Author string Desc string Keywords []string Title string SiteName string Image string VanityURL string GithubVanityRepository string }
IndexHTMLData is the data passed to IndexHTMLTmpl
type ManifestJSONData ¶
ManifestJSONData is the data passed to ManifestJSONTmpl