Documentation
¶
Overview ¶
Package webutil holds functions and data that other packages may need in order to generate URLs, find static files, etc.
Index ¶
- Variables
- func FullPath(parts ...string) string
- func HomePath() string
- func IIIFInfoURL(jp2Path string) string
- func ImageURL(file string) string
- func IncludeCSS(file string) template.HTML
- func IncludeJS(file string) template.HTML
- func RawCSS(file string) template.HTML
- func RawJS(file string) template.HTML
- func StaticPath(dir, file string) string
Constants ¶
This section is empty.
Variables ¶
var IIIFBaseURL string
IIIFBaseURL is the IIIF server URL
var Webroot string
Webroot must be set by main to tell us where we are within the main website, such as "/reports", and is used to generate absolute paths to various handlers and site assets
var WorkflowPath string
WorkflowPath is the path to the workflow directory for serving IIIF images
Functions ¶
func FullPath ¶
FullPath uses the webroot, if not empty, to join together all the path parts with a slash, returning an absolute path to something
func HomePath ¶
func HomePath() string
HomePath returns the absolute path to the home page (title list)
func IIIFInfoURL ¶
IIIFInfoURL returns what a IIIF viewer needs to find a JP2
func IncludeCSS ¶
IncludeCSS generates a <link> tag with an absolute path for including the given file's CSS. ".css" is automatically appended to the filename for less verbose use.
func IncludeJS ¶
IncludeJS generates a <script> tag with an absolute path for including the given file's JS. ".js" is automatically appended to the filename for less verbose use.
func RawCSS ¶
RawCSS generates a <link> tag with an absolute path for including the given file's CSS. It doesn't assume the path is /css, and it doesn't auto-append ".css".
func RawJS ¶
RawJS generates a <script> tag with an absolute path for including the given file's JS. It doesn't assume the path is /js, and it doesn't auto-append ".js".
func StaticPath ¶
StaticPath returns the absolute path to static assets (CSS, JS, etc)
Types ¶
This section is empty.