1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
//! Search engines and link previews read a page's `<head>`, so each page needs its own title,
//! description, and share image, on top of defaults for the whole site.
//!
//! A [`Head`] holds the title, description, canonical URL, robots rules, Open Graph and Twitter
//! tags, icons, resource hints, alternates, feeds, custom tags, and JSON-LD. [`merge`] adds to the
//! current request's head, and [`render`] renders it. To learn more, check out the
//! [head guide](https://github.com/laravel/rust-framework/blob/0.x/docs/head.md).
//!
//! The same [`Head`] type describes every layer. The application sets defaults and error
//! metadata with [`with_head`](crate::foundation::ApplicationBuilder::with_head). A route adds
//! its own with [`with_head`](crate::routing::Route::with_head), and handlers and middleware add
//! the page's with [`merge`]:
//!
//! ```no_run
//! use laravel::head::{self, Head, OgImage, OgType};
//! use laravel::view::{View, view};
//!
//! pub async fn show() -> View {
//! head::merge(
//! Head::new()
//! .title("Hello World")
//! .description("The first post.")
//! .og_type(OgType::Article)
//! .og_image(OgImage::new("https://example.com/hero.jpg").alt("A sunrise").size(1200, 630)),
//! );
//!
//! view("posts.show", ())
//! }
//! ```
//!
//! Layouts render the result with `{{ head() }}`. When several layers set a single value, such as
//! the title, the highest layer's value wins. A repeatable value, such as an Open Graph image, has
//! a key that identifies it, so adding an entry with the same key replaces the earlier entry in
//! place.
//!
//! From lowest to highest, the layers are:
//!
//! 1. The application's name, as the title.
//! 2. The application's defaults.
//! 3. The route's head.
//! 4. The head that handlers and middleware merge.
//! 5. On an error page, the status reason as the title.
//! 6. On an error page, the application's error metadata.
pub use ;
pub use ;