Skip to content

Commit c7e5cf9

Browse files
committed
add github button to homepage
1 parent 186f10b commit c7e5cf9

3 files changed

Lines changed: 22 additions & 3 deletions

File tree

crates/www/layouts/document.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,12 @@ impl Component for Document {
3333
meta()
3434
.attribute("content", "Tangram makes it easy for programmers to train, deploy, and monitor machine learning models.")
3535
.attribute("name", "description"),
36+
)
37+
.child(
38+
script()
39+
.attribute("async", true)
40+
.attribute("defer", true)
41+
.attribute("src", "https://buttons.github.io/buttons.js"),
3642
);
3743
let client_script = self.client.map(|client| {
3844
let paths = sunfish::client_paths(client);

crates/www/layouts/layout.rs

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,22 @@ struct Topbar;
2424

2525
impl Component for Topbar {
2626
fn into_node(self) -> Node {
27+
let gh_button = a()
28+
.class("github-button")
29+
.class("link")
30+
.style("color", "var(--text-color)")
31+
.href("https://github.com/tangramdotdev/tangram")
32+
.attribute(
33+
"data-color-scheme",
34+
"no-preference: light; light: light; dark: dark;",
35+
)
36+
.attribute("data-size", "large")
37+
.attribute("data-show-count", "true")
38+
.attribute("aria-label", "Star tangramdotdev/tangram on GitHub")
39+
.child("GitHub");
2740
let topbar_items = vec![
2841
ui::TopbarItem {
29-
element: None,
42+
element: Some(gh_button.into_node()),
3043
href: "https://github.com/tangramdotdev/tangram".to_owned(),
3144
title: "GitHub".to_owned(),
3245
},

crates/www/pages/index/server/tuning.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -220,11 +220,11 @@ impl Component for Tuning {
220220
let title = div()
221221
.class("index-step-title")
222222
.child("Tune your model to get the best performance.");
223-
let text = ui::Markdown::new(ui::doc!(
223+
let text = div().class("index-step-text").child(ui::Markdown::new(ui::doc!(
224224
r#"
225225
Tune binary classification models to your preferred tradeoff between precision and recall. To use your selected threshold, update the `predict` call in your code.
226226
"#
227-
).into());
227+
).into()));
228228
let left = div().child(title).child(text);
229229
let right = ui::Window::new().child(Dehydrate::new(
230230
"tuning",

0 commit comments

Comments
 (0)