diff --git a/oranda-css/css/pages/artifacts.css b/oranda-css/css/pages/artifacts.css index 193badfa..d0345792 100644 --- a/oranda-css/css/pages/artifacts.css +++ b/oranda-css/css/pages/artifacts.css @@ -11,7 +11,7 @@ } .artifacts { - @apply flex gap-2 items-center flex-col mb-16 p-5; + @apply flex items-center flex-col mb-8 p-0; color: var(--light-highlight-fg-color); background-color: var(--light-highlight-bg-color); } @@ -76,6 +76,13 @@ ul.tabs li.selected { @apply hover:no-underline; } +.bottom-options { + @apply flex flex-row w-full justify-between; +} +.bottom-options.one { + @apply justify-center; +} + .install-code-wrapper { @apply flex items-stretch; } @@ -103,9 +110,6 @@ ul.tabs li.selected { @apply block mb-2; } -.arch-select { - @apply self-end; -} .arch { @apply p-0 m-0 pt-4; diff --git a/src/site/artifacts/installers.rs b/src/site/artifacts/installers.rs index 3daa6290..21086805 100644 --- a/src/site/artifacts/installers.rs +++ b/src/site/artifacts/installers.rs @@ -17,10 +17,8 @@ pub fn build_header(release: &Release, config: &Config) -> Result)); - } - let one_platform = platforms_we_want.len() == 1; + + let simple_platforms = platforms_we_want.len() <= 1; let date_html = release.source.formatted_date().map(|date| { html!(
{text!("Published on {}", date)}
) @@ -39,8 +37,8 @@ pub fn build_header(release: &Release, config: &Config) -> Result ); - // If there's only one platform we don't need scripts - let noscript = if one_platform { + // If there aren't multiple platform we don't need scripts + let noscript = if simple_platforms { None } else { Some( @@ -48,38 +46,50 @@ pub fn build_header(release: &Release, config: &Config) -> Result{text!(desc)})) + } } else { - // Otherwise mention the platform - let os_name = triple_to_display_name(target).unwrap(); - let desc = format!("Platform: {os_name}"); - Some(html!(
{text!(desc)}
)) + None } } else { Some(html!()) }; - let no_autodetect = if one_platform { + let no_autodetect = if simple_platforms { None } else { Some(html!( )) }; + + let bottom_classes = if selector.is_none() { + "bottom-options one" + } else { + "bottom-options" + }; Ok(html!(
{main_html} {no_autodetect} - {selector} {noscript} +
)) } @@ -87,23 +97,27 @@ pub fn build_header(release: &Release, config: &Config) -> Result Vec>> { let mut html = vec![]; - let one_platform = platforms.len() == 1; + let simple_platforms = platforms.len() == 1; for (target, installers) in platforms { // If there's only one installer, no need for tabs let tabs = if installers.len() == 1 { None } else { - let tabs = tab_list(target, release, installers, one_platform); + let tabs = tab_list(target, release, installers, simple_platforms); Some(html!(
    {tabs}
)) }; - let contents = content_list(target, installers, release, config, one_platform); + let contents = content_list(target, installers, release, config, simple_platforms); // If there's only one entry, make it visible by default (noscript friendly) - let classes = if one_platform { "arch" } else { "arch hidden" }; + let classes = if simple_platforms { + "arch" + } else { + "arch hidden" + }; html.push(html!(
  • {tabs} @@ -122,14 +136,14 @@ fn tab_list( target: &TargetTriple, release: &Release, installers: &[InstallerIdx], - one_platform: bool, + simple_platforms: bool, ) -> Vec>> { let mut list = vec![]; let mut is_first = true; for i in installers.iter() { let installer = release.artifacts.installer(i.to_owned()); let string_idx = i.0.to_string(); - let classes = if one_platform && is_first { + let classes = if simple_platforms && is_first { "install-tab selected" } else { "install-tab" @@ -148,7 +162,7 @@ fn content_list( installers: &Vec, release: &Release, config: &Config, - one_platform: bool, + simple_platforms: bool, ) -> Vec>> { let mut list = vec![]; let mut is_first = true; @@ -164,7 +178,7 @@ fn content_list( }; // If there's only one platform, auto-show - let classes = if one_platform && is_first { + let classes = if simple_platforms && is_first { "install-content" } else { "install-content hidden" diff --git a/src/site/mod.rs b/src/site/mod.rs index f0957503..8b7ada57 100644 --- a/src/site/mod.rs +++ b/src/site/mod.rs @@ -59,7 +59,13 @@ impl Site { } }; // FIXME: change the config so that you can set `artifacts: false` and disable this? - if context.latest().is_some() { + let artifacts_enabled = config + .components + .artifacts + .as_ref() + .map(|a| a.has_some()) + .unwrap_or(false); + if context.latest().is_some() && artifacts_enabled { context .latest_mut() .unwrap()