Genie.Assets.add_fileroute — Function
add_fileroute(route::String, filename::AbstractString;
  basedir = pwd(),
  content_type::Union{Nothing, Symbol} = nothing,
  named::Union{Symbol, Nothing} = nothing,
  cache_control::Union{String, Nothing} = default_cache_control(),
  headers = HTTP.Headers())

Registers a Genie route at the literal route path that serves filename (resolved as joinpath(basedir, filename)) as a static asset. Unlike the AssetsConfig-based method, route is used verbatim – there's no assets/<type>/ path convention or package host/version involved. Useful for exposing an individual file (e.g. a document) at a specific URL with its own caching behaviour.

cache_control defaults to default_cache_control (the GENIE_ASSETS_CACHE_MAXAGE env var) like the other method, but since this method targets one specific route rather than a whole package's assets, passing cache_control explicitly here is the way to give that one route a Cache-Control different from the general setting – including cache_control = nothing to suppress the header for just this route.

Example

add_fileroute("/docs/handbook.pdf", "handbook.pdf"; basedir = "files", cache_control = "no-cache")
source
Genie.Assets.AssetsConfig — Type
mutable struct AssetsConfig

Manages the assets configuration for the current package. Define your own instance of AssetsConfig if you want to add support for asset management for your package through Genie.Assets.

source
Genie.Assets.assets_config! — Function
assets_config!(packages::Vector{Module}; config...) :: Nothing
assets_config!(package::Module; config...) :: Nothing

Utility function which allows bulk configuration of the assets.

Example

Genie.Assets.assets_config!([Genie, Stipple, StippleUI], host = "https://cdn.statically.io/gh/GenieFramework")
source
assets_config!(; config...) :: Nothing

Updates the assets configuration for the current package.

source
Missing docstring.

Missing docstring for assets_endpoint. Check Documenter's build log for details.

Genie.Assets.asset_file — Function
asset_file(; cwd = "", file::String, path::String = "", type::String = "", prefix::String = "assets",
              ext::String = "", min::Bool = false, skip_ext::Bool = false) :: String

Generates the file system path to an asset file.

source
Genie.Assets.asset_path — Function
asset_path(; file::String, host::String = Genie.config.base_path, package::String = "", version::String = "",
              prefix::String = "assets", type::String = "", path::String = "", min::Bool = false,
              ext::String = "", skip_ext::Bool = false, query::String = "") :: String
asset_path(file::String; kwargs...) :: String
asset_path(ac::AssetsConfig, tp::Union{Symbol,String}; type::String = string(tp), path::String = "",
                file::String = "", ext::String = "", skip_ext::Bool = false, query::String = "") :: String

Generates the path to an asset file.

source
Genie.Assets.asset_route — Function
asset_route(; file::String, package::String = "", version::String = "", prefix::String = "assets",
              type::String = "", path::String = "", min::Bool = false,
              ext::String = "", skip_ext::Bool = false, query::String = "") :: String
asset_route(file::String; kwargs...) :: String
asset_route(ac::AssetsConfig, tp::Union{Symbol,String}; type::String = string(tp), path::String = "",
            file::String = "", ext::String = "", skip_ext::Bool = false, query::String = "") :: String

Generates the route to an asset file.

source
Genie.Assets.channels — Function
channels(channel::AbstractString = Genie.config.webchannels_default_route) :: String

Outputs the channels.js file included with the Genie package.

source
Missing docstring.

Missing docstring for channels_route. Check Documenter's build log for details.

Genie.Assets.channels_script — Function
channels_script(channel::AbstractString = Genie.config.webchannels_default_route) :: String

Outputs the channels JavaScript content within <script>...</script> tags, for embedding into the page.

source
Missing docstring.

Missing docstring for channels_script_tag. Check Documenter's build log for details.

Genie.Assets.channels_subscribe — Function
channels_subscribe(channel::AbstractString = Genie.config.webchannels_default_route) :: Nothing

Registers subscription and unsubscription channels for channel.

source
Genie.Assets.channels_support — Function
channels_support(channel = Genie.config.webchannels_default_route) :: String

Provides full web channels support, setting up routes for loading support JS files, web sockets subscription and returning the <script> tag for including the linked JS file into the web page.

source
Genie.Assets.css_asset — Function
css_asset(file_name::String) :: String

Path to a css asset. The file_name should not include the extension.

source
Genie.Assets.external_assets — Function
external_assets(host::String) :: Bool
external_assets(ac::AssetsConfig) :: Bool
external_assets() :: Bool

Returns true if the current package is using external assets.

source
Genie.Assets.include_asset — Function
include_asset(asset_type::Union{String,Symbol}, file_name::Union{String,Symbol}) :: String

Returns the path to an asset. asset_type can be one of :js, :css. The file_name should not include the extension.

source
Genie.Assets.js_asset — Function
js_asset(file_name::String) :: String

Path to a js asset. file_name should not include the extension.

source
Missing docstring.

Missing docstring for jsliteral. Check Documenter's build log for details.

Genie.Assets.js_settings — Function
js_settings(channel::String = Genie.config.webchannels_default_route) :: String

Sets up a window.Genie.Settings JavaScript object which exposes relevant Genie app settings from Genie.config

source
Missing docstring.

Missing docstring for webthreads_endpoint. Check Documenter's build log for details.

Missing docstring.

Missing docstring for webthreads_route. Check Documenter's build log for details.

Genie.Assets.webthreads_script — Function
webthreads_script() :: String

Outputs the channels JavaScript content within <script>...</script> tags, for embedding into the page.

source
Missing docstring.

Missing docstring for webthreads_script_tag. Check Documenter's build log for details.

Genie.Assets.webthreads_support — Function
webthreads_support(channel = Genie.config.webthreads_default_route) :: String

Provides full web channels support, setting up routes for loading support JS files, web sockets subscription and returning the <script> tag for including the linked JS file into the web page.

source