diff options
author | Louis Pilfold <louis@lpil.uk> | 2024-01-18 19:51:27 +0000 |
---|---|---|
committer | Louis Pilfold <louis@lpil.uk> | 2024-01-18 19:51:27 +0000 |
commit | 632fb31359d5baf2fd5581ccdedc39fa60069bb0 (patch) | |
tree | ce3b0cfdc77f881f63adddd712c8ed2456fef1ff /src/tour.gleam | |
parent | dbbb3a7d2608563b9e2468c127a899e055f2c739 (diff) | |
download | tour-632fb31359d5baf2fd5581ccdedc39fa60069bb0.tar.gz tour-632fb31359d5baf2fd5581ccdedc39fa60069bb0.zip |
Meta tags
Diffstat (limited to 'src/tour.gleam')
-rw-r--r-- | src/tour.gleam | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/src/tour.gleam b/src/tour.gleam index 1d0d51c..2a9607b 100644 --- a/src/tour.gleam +++ b/src/tour.gleam @@ -506,6 +506,14 @@ fn lesson_html(page: Lesson) -> String { } } + let metaprop = fn(property, content) { + h("meta", [#("property", property), #("content", content)], []) + } + + let title = page.name <> " - The Gleam Language Tour" + let description = + "An interactive introduction reference to the Gleam programming language" + h("html", [#("lang", "en-gb")], [ h("head", [], [ h("meta", [#("charset", "utf-8")], []), @@ -517,7 +525,18 @@ fn lesson_html(page: Lesson) -> String { ], [], ), - h("title", [], [text(page.name <> " - The Gleam Language Tour")]), + h("title", [], [text(title)]), + h("meta", [#("name", "description"), #("content", description)], []), + metaprop("og:type", "website"), + metaprop("og:title", title), + metaprop("og:description", description), + metaprop("og:url", "https://tour.gleam.run/" <> page.path), + metaprop("og:image", "https://gleam.run/images/og-image.png"), + metaprop("twitter:card", "summary_large_image"), + metaprop("twitter:url", "https://tour.gleam.run/" <> page.path), + metaprop("twitter:title", title), + metaprop("twitter:description", description), + metaprop("twitter:image", "https://gleam.run/images/og-image.png"), h("link", [#("rel", "stylesheet"), #("href", "/style.css")], []), ]), h("body", [], [ |