Skip to main content

WebCfg

Struct WebCfg 

Source
pub struct WebCfg {
Show 24 fields pub out_dir: Option<String>, pub base_path: Option<String>, pub url: Option<String>, pub description: Option<String>, pub og_image: Option<String>, pub canonical: Option<String>, pub locales: Option<Vec<String>>, pub default_locale: Option<String>, pub skin: Option<String>, pub css: WebCssMode, pub widgets: WebWidgets, pub render: WebRender, pub runtime: Option<bool>, pub prerender: WebPrerender, pub hash_assets: Option<bool>, pub debug_attrs: Option<bool>, pub menubar: WebMenubar, pub sitemap: Option<bool>, pub robots: Option<bool>, pub host: WebHost, pub navigation: WebNavigation, pub seed: BTreeMap<String, WebSeedValue>, pub pages: BTreeMap<String, WebPageCfg>, pub ssr: WebSsrCfg,
}
Expand description

[web] block - how lumenc web emits the app as a static site.

The rest of lumen.toml still describes the app: [window] title is the documents’ title, [app] id / entry / locale, [pages], [asset_roots] and [script] engine all apply. This block covers what only a site has: where it is served from, what a crawler is told, and which locales it is emitted in.

[capabilities] does not apply. A desktop build compiles a runtime per app; a site loads one prebuilt runtime that ships with the toolchain, so there is nothing per-app to trim.

[web]
out_dir   = "dist/web"       # where the site is written
base_path = "/"              # URL prefix the site is served under
url = "https://example.com"  # an address; canonical link + sitemap need one
description = "A Lumen app"  # used by any page without its own
locales = ["en-US", "de-DE"] # one tree per locale
host = "netlify"             # also write that host's deep-path rewrite file
render = "ssr"               # a document per request
runtime = false              # and no browser runtime in it

[web.seed]
count = 3                    # signal values the pages are rendered with

[web.pages.settings]
title = "Settings"
index = false                # and keep it out of a search index

Fields§

§out_dir: Option<String>

Directory the site is written to, relative to the app dir unless absolute. Defaults to dist/web.

§base_path: Option<String>

URL prefix the site is served under, such as / or /docs/. Every link and asset reference in the documents hangs off it.

§url: Option<String>

Absolute site URL, such as https://example.com. The canonical link, the social metadata, the hreflang links and the sitemap need an address; without this or Self::canonical they are left out.

§description: Option<String>

Description used by any page that does not set its own.

§og_image: Option<String>

Image for social previews, relative to the site root or absolute.

§canonical: Option<String>

Absolute URL the pages declare as canonical, for a site published at more than one address. Defaults to Self::url.

§locales: Option<Vec<String>>

Every locale the site is emitted in, one document tree each. Absent emits the default locale alone.

§default_locale: Option<String>

The locale whose tree sits at the site root; the others sit under /<tag>/. Defaults to [app] locale, then en-US.

§skin: Option<String>

Skin the site is styled with. Defaults to [skin] name, then default. auto is not read here: it means “the machine’s OS”, and a site is served to every OS.

§css: WebCssMode

How the pages are styled.

§widgets: WebWidgets

Which shape a widget the parser built out of smaller elements is emitted as.

§render: WebRender

Where a page’s document comes from.

§runtime: Option<bool>

Whether the documents carry the browser runtime. Unset takes what Self::render implies, which is the only thing static and csr differ about; render = "ssr" is the one that leaves it open.

§prerender: WebPrerender

Where the state the pages are rendered with comes from.

§hash_assets: Option<bool>

Add a content hash to asset file names, so a cache can hold them forever. A build does not apply this yet.

§debug_attrs: Option<bool>

Write the extra data-lm-* attributes that name what an element came from. A build does not write them yet.

§menubar: WebMenubar

What an app menu bar becomes in a document.

§sitemap: Option<bool>

Write sitemap.xml: every page in every locale, each entry dated and cross-linked to its other languages. Needs an address to build absolute URLs from, Self::canonical else Self::url, and is written whenever the site has one.

§robots: Option<bool>

Write robots.txt, naming the sitemap. Defaults to on when a sitemap is written.

§host: WebHost

Host the site is deployed to, which decides the rewrite file that makes a deep path serve the app instead of the host’s own 404.

§navigation: WebNavigation

How a link to another page of the same site is followed.

§seed: BTreeMap<String, WebSeedValue>

[web.seed] - signal values every page is rendered with.

§pages: BTreeMap<String, WebPageCfg>

[web.pages.<key>] - what each page says about itself. A key naming a page the app does not have is accepted and reaches nothing.

§ssr: WebSsrCfg

[web.ssr] - what a render of the app may reach, when its pages are rendered per request.

Trait Implementations§

Source§

impl Clone for WebCfg

Source§

fn clone(&self) -> WebCfg

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for WebCfg

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for WebCfg

Source§

fn default() -> WebCfg

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for WebCfg
where WebCfg: Default,

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
§

impl<T> Downcast for T
where T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

Convert Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.
§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

Convert Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait.
§

fn as_any(&self) -> &(dyn Any + 'static)

Convert &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s.
§

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
§

impl<T> DowncastSync for T
where T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> FromTemplate for T
where T: Clone + Default + Unpin,

§

type Template = T

The [Template] for this type.
§

impl<T> FromWorld for T
where T: Default,

§

fn from_world(_world: &mut World) -> T

Creates Self using default().

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
§

impl<T> IntoResult<T> for T

§

fn into_result(self) -> Result<T, RunSystemError>

Converts this type into the system output type.
§

impl<T> NoneValue for T
where T: Default,

§

type NoneType = T

§

fn null_value() -> T

The none-equivalent value.
§

impl<T, S> SimdFrom<T, S> for T
where S: Simd,

§

fn simd_from(_simd: S, value: T) -> T

§

impl<F, T, S> SimdInto<T, S> for F
where T: SimdFrom<F, S>, S: Simd,

§

fn simd_into(self, simd: S) -> T

§

impl<T> Template for T
where T: Clone + Default + Unpin,

§

type Output = T

The type of value produced by this [Template].
§

fn build_template( &self, _context: &mut TemplateContext<'_, '_>, ) -> Result<<T as Template>::Output, BevyError>

Uses this template and the given entity context to produce a [Template::Output].
§

fn clone_template(&self) -> T

Clones this template. See Clone.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<T> ConditionalSend for T
where T: Send,

Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

§

impl<T> ErasedDestructor for T
where T: 'static,

§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

§

impl<T> WasmNotSend for T
where T: Send,

§

impl<T> WasmNotSendSync for T
where T: WasmNotSend + WasmNotSync,

§

impl<T> WasmNotSync for T
where T: Sync,