1
0

meta.rs 1010 B

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