1
0

meta.rs 866 B

1234567891011121314151617181920
  1. //! This example shows how to add metadata to the page with the Meta component
  2. use dioxus::prelude::*;
  3. fn main() {
  4. dioxus::launch(app);
  5. }
  6. fn app() -> Element {
  7. rsx! {
  8. // You can use the Meta component to render a meta tag into the head of the page
  9. // Meta tags are useful to provide information about the page to search engines and social media sites
  10. // This example sets up meta tags for the open graph protocol for social media previews
  11. document::Meta { property: "og:title", content: "My Site" }
  12. document::Meta { property: "og:type", content: "website" }
  13. document::Meta { property: "og:url", content: "https://www.example.com" }
  14. document::Meta { property: "og:image", content: "https://example.com/image.jpg" }
  15. document::Meta { name: "description", content: "My Site is a site" }
  16. }
  17. }