1
0

meta.rs 1.0 KB

1234567891011121314151617181920212223242526272829303132333435
  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 {
  12. property: "og:title",
  13. content: "My Site",
  14. }
  15. document::Meta {
  16. property: "og:type",
  17. content: "website",
  18. }
  19. document::Meta {
  20. property: "og:url",
  21. content: "https://www.example.com",
  22. }
  23. document::Meta {
  24. property: "og:image",
  25. content: "https://example.com/image.jpg",
  26. }
  27. document::Meta {
  28. name: "description",
  29. content: "My Site is a site",
  30. }
  31. }
  32. }