webutil

package
v2.5.1+incompatible Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 21, 2018 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package webutil holds functions and data that other packages may need in order to generate URLs, find static files, etc.

Index

Constants

This section is empty.

Variables

View Source
var IIIFBaseURL string

IIIFBaseURL is the IIIF server URL

View Source
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

View Source
var WorkflowPath string

WorkflowPath is the path to the workflow directory for serving IIIF images

Functions

func FullPath

func FullPath(parts ...string) string

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

func IIIFInfoURL(jp2Path string) string

IIIFInfoURL returns what a IIIF viewer needs to find a JP2

func ImageURL

func ImageURL(file string) string

ImageURL takes a file and constructs an absolute web path string

func IncludeCSS

func IncludeCSS(file string) template.HTML

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

func IncludeJS(file string) template.HTML

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

func RawCSS(file string) template.HTML

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

func RawJS(file string) template.HTML

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

func StaticPath(dir, file string) string

StaticPath returns the absolute path to static assets (CSS, JS, etc)

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL