url

Macro url 

Source
macro_rules! url {
    () => { ... };
    ($path:expr) => { ... };
    (@root) => { ... };
}
Expand description

Returns the input appended to URL_ROOT

Note that URL_ROOT:

  • Must be defined in the root of the crate (crate::URL_ROOT)
  • Should BEGIN and END with a slash. Eg. const URL_ROOT: &str = "/my-site/"
  • May be "/" (same as development) for sites hosted at root URL path

This macro will always resolve to a String

The ‘url root path’ is used for when a site is not hosted at the root of the domain (Eg. https://example.com), but at a sub-path (Eg. https://example.com/my-site). This is very useful for hosting on GitHub Pages