From 2eea120eaf796fbb924d84bdd10281beda633e91 Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Mon, 30 Sep 2024 23:10:34 +0200 Subject: [PATCH 1/4] Put SVG images into CSS --- Cargo.toml | 2 +- build.rs | 183 +++++++++++++++++++++- crates/font-awesome-as-a-crate/src/lib.rs | 14 +- src/lib.rs | 5 +- src/web/csp.rs | 2 +- src/web/page/mod.rs | 2 +- src/web/page/templates.rs | 52 ------ templates/about-base.html | 12 +- templates/base.html | 1 + templates/core/home.html | 4 +- templates/crate/build_details.html | 2 +- templates/crate/builds.html | 8 +- templates/crate/details.html | 18 +-- templates/crate/source.html | 18 +-- templates/header/global_alert.html | 2 +- templates/header/package_navigation.html | 12 +- templates/header/topbar_begin.html | 2 +- templates/header/topbar_end.html | 2 +- templates/macros.html | 4 +- templates/releases/header.html | 14 +- templates/releases/releases.html | 8 +- templates/releases/search_results.html | 6 +- templates/rustdoc/head.html | 10 +- templates/rustdoc/topbar.html | 36 ++--- templates/style/_fa.scss | 7 +- 25 files changed, 283 insertions(+), 143 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 64177f9f3..a8879cf3a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -54,7 +54,6 @@ once_cell = { version = "1.4.0", features = ["parking_lot"] } base64 = "0.22" strum = { version = "0.26.1", features = ["derive"] } lol_html = "1.0.0" -font-awesome-as-a-crate = { path = "crates/font-awesome-as-a-crate" } dashmap = "6.0.0" string_cache = "0.8.0" zip = {version = "2.2.0", default-features = false, features = ["bzip2"]} @@ -136,6 +135,7 @@ anyhow = { version = "1.0.42", features = ["backtrace"] } grass = { version = "0.13.1", default-features = false } once_cell = { version = "1.4.0", features = ["parking_lot"] } syntect = { version = "5.0.0", default-features = false, features = ["parsing", "dump-create", "yaml-load", "regex-onig"] } +font-awesome-as-a-crate = { path = "crates/font-awesome-as-a-crate" } [[bench]] name = "compression" diff --git a/build.rs b/build.rs index 41fd76b86..a6d39e22c 100644 --- a/build.rs +++ b/build.rs @@ -1,5 +1,9 @@ use anyhow::{Context as _, Error, Result}; -use std::{env, path::Path}; +use font_awesome_as_a_crate as f_a; +use std::{ + env, + path::{Path, PathBuf}, +}; mod tracked { use once_cell::sync::Lazy; @@ -80,11 +84,188 @@ fn main() -> Result<()> { write_known_targets(out_dir)?; compile_syntax(out_dir).context("could not compile syntax files")?; + println!("cargo::rustc-check-cfg=cfg(icons_out_dir)"); + println!("cargo:rustc-cfg=icons_out_dir"); + + let package_dir = env::var("CARGO_MANIFEST_DIR").context("missing CARGO_MANIFEST_DIR")?; + let package_dir = Path::new(&package_dir); + generate_css_icons(package_dir.join("static/icons.css"), out_dir)?; + // trigger recompilation when a new migration is added println!("cargo:rerun-if-changed=migrations"); Ok(()) } +fn capitalize(s: &str) -> String { + let mut c = s.chars(); + match c.next() { + None => String::new(), + Some(f) => f.to_uppercase().chain(c).collect(), + } +} + +fn render_icon( + icon_name: &str, + icon_str: &str, + type_name: String, + code_output: &mut String, + css_output: &mut String, + icon_kind: &str, +) { + let css_class = format!("f-a_{icon_name}_{icon_kind}"); + css_output.push_str(&format!( + "\ +.{css_class} {{ + --svg_{icon_name}_{icon_kind}: url('data:image/svg+xml,{icon_str}'); + -webkit-mask: var(--svg_{icon_name}_{icon_kind}) no-repeat center; + mask: var(--svg_{icon_name}_{icon_kind}) no-repeat center; +}} +", + )); + let type_name = format!("{type_name}{}", capitalize(icon_kind)); + code_output.push_str(&format!( + r#"#[derive(Clone, Copy, Debug, PartialEq, Eq)] +pub struct {type_name}; +impl {type_name} {{ + pub fn render(&self, fw: bool, spin: bool, extra: &str) -> rinja::filters::Safe {{ + render({css_class:?}, fw, spin, extra) + }} +}} +"#, + )); +} + +fn generate_css_icons(css_path: PathBuf, out_dir: &Path) -> Result<()> { + let mut code_output = r#"pub(crate) mod icons { + fn render( + css_class: &str, + fw: bool, + spin: bool, + extra: &str, + ) -> rinja::filters::Safe { + let mut classes = vec!["fa-svg"]; + if fw { + classes.push("fa-svg-fw"); + } + if spin { + classes.push("fa-svg-spin"); + } + if !extra.is_empty() { + classes.push(extra); + } + let icon = format!( + "", + class = classes.join(" "), + ); + + rinja::filters::Safe(icon) + }"# + .to_string(); + let mut css_output = r#".svg-clipboard { + /* This icon is copied from crates.io */ + --svg-clipboard: url('data:image/svg+xml,'); + -webkit-mask: var(--svg-clipboard) no-repeat center; + mask: var(--svg-clipboard) no-repeat center; +}"#.to_string(); + + let brands: &[&dyn f_a::Brands] = &[ + &f_a::icons::IconFonticons, + &f_a::icons::IconRust, + &f_a::icons::IconMarkdown, + &f_a::icons::IconGitAlt, + ]; + let regular: &[&dyn f_a::Regular] = &[ + &f_a::icons::IconFileLines, + &f_a::icons::IconFolderOpen, + &f_a::icons::IconFile, + &f_a::icons::IconStar, + ]; + let solid: &[&dyn f_a::Solid] = &[ + &f_a::icons::IconCircleInfo, + &f_a::icons::IconGears, + &f_a::icons::IconTable, + &f_a::icons::IconRoad, + &f_a::icons::IconDownload, + &f_a::icons::IconCubes, + &f_a::icons::IconSquareRss, + &f_a::icons::IconFileLines, + &f_a::icons::IconCheck, + &f_a::icons::IconTriangleExclamation, + &f_a::icons::IconGear, + &f_a::icons::IconX, + &f_a::icons::IconHouse, + &f_a::icons::IconCodeBranch, + &f_a::icons::IconStar, + &f_a::icons::IconCircleExclamation, + &f_a::icons::IconCube, + &f_a::icons::IconChevronLeft, + &f_a::icons::IconChevronRight, + &f_a::icons::IconFolderOpen, + &f_a::icons::IconLock, + &f_a::icons::IconFlag, + &f_a::icons::IconBook, + &f_a::icons::IconMagnifyingGlass, + &f_a::icons::IconLeaf, + &f_a::icons::IconChartLine, + &f_a::icons::IconList, + &f_a::icons::IconUser, + &f_a::icons::IconTrash, + &f_a::icons::IconArrowLeft, + &f_a::icons::IconArrowRight, + &f_a::icons::IconLink, + &f_a::icons::IconScaleUnbalancedFlip, + &f_a::icons::IconSpinner, + ]; + + for icon in brands { + render_icon( + icon.icon_name(), + icon.icon_str(), + format!("{icon:?}"), + &mut code_output, + &mut css_output, + "brands", + ); + } + for icon in regular { + render_icon( + icon.icon_name(), + icon.icon_str(), + format!("{icon:?}"), + &mut code_output, + &mut css_output, + "regular", + ); + } + for icon in solid { + render_icon( + icon.icon_name(), + icon.icon_str(), + format!("{icon:?}"), + &mut code_output, + &mut css_output, + "solid", + ); + } + + std::fs::write(&css_path, css_output).map_err(|error| { + Error::msg(format!( + "Failed to write into `{}`: {error:?}", + css_path.display() + )) + })?; + + code_output.push('}'); + let icons_file = out_dir.join("icons.rs"); + std::fs::write(&icons_file, code_output).map_err(|error| { + Error::msg(format!( + "Failed to write `{}`: {error:?}", + icons_file.display() + )) + })?; + Ok(()) +} + fn write_git_version(out_dir: &Path) -> Result<()> { let maybe_hash = get_git_hash()?; let git_hash = maybe_hash.as_deref().unwrap_or("???????"); diff --git a/crates/font-awesome-as-a-crate/src/lib.rs b/crates/font-awesome-as-a-crate/src/lib.rs index 4afab7d18..bcc19b210 100644 --- a/crates/font-awesome-as-a-crate/src/lib.rs +++ b/crates/font-awesome-as-a-crate/src/lib.rs @@ -6,7 +6,7 @@ If you have problems, [contact us](https://github.com/rust-lang/docs.rs/issues), */ use std::error::Error; -use std::fmt::{self, Display, Formatter}; +use std::fmt::{self, Debug, Display, Formatter}; #[cfg(font_awesome_out_dir)] include!(concat!(env!("OUT_DIR"), "/fontawesome.rs")); @@ -94,18 +94,18 @@ pub trait IconStr { fn icon_str(&self) -> &'static str; } -pub trait Brands: IconStr { - fn get_type() -> Type { +pub trait Brands: IconStr + Debug { + fn get_type(&self) -> Type { Type::Brands } } -pub trait Regular: IconStr { - fn get_type() -> Type { +pub trait Regular: IconStr + Debug { + fn get_type(&self) -> Type { Type::Regular } } -pub trait Solid: IconStr { - fn get_type() -> Type { +pub trait Solid: IconStr + Debug { + fn get_type(&self) -> Type { Type::Solid } } diff --git a/src/lib.rs b/src/lib.rs index 6036c74f7..93b01a1eb 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -13,7 +13,10 @@ pub use self::registry_api::RegistryApi; pub use self::storage::{AsyncStorage, Storage}; pub use self::web::{start_background_metrics_webserver, start_web_server}; -pub(crate) use font_awesome_as_a_crate as f_a; +#[cfg(icons_out_dir)] +include!(concat!(env!("OUT_DIR"), "/icons.rs")); +#[cfg(not(icons_out_dir))] +include!("icons.rs"); mod build_queue; pub mod cdn; diff --git a/src/web/csp.rs b/src/web/csp.rs index 44608df4a..0ae903fc1 100644 --- a/src/web/csp.rs +++ b/src/web/csp.rs @@ -54,7 +54,7 @@ impl Csp { // the MIME type to allow loading favicons. // // Images from other HTTPS origins are also temporary allowed until issue #66 is fixed. - result.push_str("; img-src 'self' https:"); + result.push_str("; img-src 'self' https: data:"); match content_type { ContentType::Html => self.render_html(&mut result), diff --git a/src/web/page/mod.rs b/src/web/page/mod.rs index 2de262813..3e8267ce3 100644 --- a/src/web/page/mod.rs +++ b/src/web/page/mod.rs @@ -8,5 +8,5 @@ pub(crate) struct GlobalAlert { pub(crate) url: &'static str, pub(crate) text: &'static str, pub(crate) css_class: &'static str, - pub(crate) fa_icon: crate::f_a::icons::IconTriangleExclamation, + pub(crate) fa_icon: crate::icons::IconTriangleExclamationSolid, } diff --git a/src/web/page/templates.rs b/src/web/page/templates.rs index 898a18126..c26b8408f 100644 --- a/src/web/page/templates.rs +++ b/src/web/page/templates.rs @@ -200,33 +200,6 @@ pub mod filters { Ok(unindented) } - pub fn fas( - value: T, - fw: bool, - spin: bool, - extra: &str, - ) -> rinja::Result> { - super::render_icon(value.icon_str(), fw, spin, extra) - } - - pub fn far( - value: T, - fw: bool, - spin: bool, - extra: &str, - ) -> rinja::Result> { - super::render_icon(value.icon_str(), fw, spin, extra) - } - - pub fn fab( - value: T, - fw: bool, - spin: bool, - extra: &str, - ) -> rinja::Result> { - super::render_icon(value.icon_str(), fw, spin, extra) - } - pub fn highlight(code: impl std::fmt::Display, lang: &str) -> rinja::Result> { let highlighted_code = crate::web::highlight::with_lang(Some(lang), &code.to_string()); Ok(Safe(format!( @@ -254,28 +227,3 @@ pub mod filters { )) } } - -fn render_icon( - icon_str: &str, - fw: bool, - spin: bool, - extra: &str, -) -> rinja::Result> { - let mut classes = vec!["fa-svg"]; - if fw { - classes.push("fa-svg-fw"); - } - if spin { - classes.push("fa-svg-spin"); - } - if !extra.is_empty() { - classes.push(extra); - } - let icon = format!( - "\ -{icon_str}", - class = classes.join(" "), - ); - - Ok(rinja::filters::Safe(icon)) -} diff --git a/templates/about-base.html b/templates/about-base.html index 93e40fbad..7c013a585 100644 --- a/templates/about-base.html +++ b/templates/about-base.html @@ -11,27 +11,27 @@

Docs.rs documentation

    - {% set text = crate::f_a::icons::IconCircleInfo|fas(false, false, "") %} + {% set text = crate::icons::IconCircleInfoSolid.render(false, false, "") %} {% set text = "{} About"|format(text) %} {% call macros::active_link(expected="index", href="/about", text=text) %} - {% set text = crate::f_a::icons::IconFonticons|fab(false, false, "") %} + {% set text = crate::icons::IconFonticonsBrands.render(false, false, "") %} {% set text = "{} Badges"|format(text) %} {% call macros::active_link(expected="badges", href="/about/badges", text=text) %} - {% set text = crate::f_a::icons::IconGears|fas(false, false, "") %} + {% set text = crate::icons::IconGearsSolid.render(false, false, "") %} {% set text = "{} Builds"|format(text) %} {% call macros::active_link(expected="builds", href="/about/builds", text=text) %} - {% set text = crate::f_a::icons::IconTable|fas(false, false, "") %} + {% set text = crate::icons::IconTableSolid.render(false, false, "") %} {% set text = "{} Metadata"|format(text) %} {% call macros::active_link(expected="metadata", href="/about/metadata", text=text) %} - {% set text = crate::f_a::icons::IconRoad|fas(false, false, "") %} + {% set text = crate::icons::IconRoadSolid.render(false, false, "") %} {% set text = "{} Shorthand URLs"|format(text) %} {% call macros::active_link(expected="redirections", href="/about/redirections", text=text) %} - {% set text = crate::f_a::icons::IconDownload|fas(false, false, "") %} + {% set text = crate::icons::IconDownloadSolid.render(false, false, "") %} {% set text = "{} Download"|format(text) %} {% call macros::active_link(expected="download", href="/about/download", text=text) %}
diff --git a/templates/base.html b/templates/base.html index 79d67e594..63f98e9cc 100644 --- a/templates/base.html +++ b/templates/base.html @@ -11,6 +11,7 @@ {%- set build_slug = slug::slugify(crate::BUILD_VERSION) -%} + diff --git a/templates/core/home.html b/templates/core/home.html index 9715eaf2b..e6e10b919 100644 --- a/templates/core/home.html +++ b/templates/core/home.html @@ -12,7 +12,7 @@ {%- block body -%}
-

{{ crate::f_a::icons::IconCubes|fas(false, false, "") }} Docs.rs

+

{{ crate::icons::IconCubesSolid.render(false, false, "") }} Docs.rs

@@ -36,7 +36,7 @@

{{ crate::f_a::icons::IconCubes|fas(false, false, "") }} Docs. Recent Releases - {{ crate::f_a::icons::IconSquareRss|fas(false, false, "") }} + {{ crate::icons::IconSquareRssSolid.render(false, false, "") }}

diff --git a/templates/crate/build_details.html b/templates/crate/build_details.html index fa6fb2cdd..3484cd449 100644 --- a/templates/crate/build_details.html +++ b/templates/crate/build_details.html @@ -30,7 +30,7 @@
  • -
    {{ crate::f_a::icons::IconFileLines|fas(false, false, "") }}
    +
    {{ crate::icons::IconFileLinesSolid.render(false, false, "") }}
    {% if current_filename.as_deref().unwrap_or_default() == filename.as_str() %} {{ filename }} diff --git a/templates/crate/builds.html b/templates/crate/builds.html index 4b61a564b..425b2f394 100644 --- a/templates/crate/builds.html +++ b/templates/crate/builds.html @@ -44,13 +44,13 @@
    {%- if build.build_status == "success" -%} - {{ crate::f_a::icons::IconCheck|fas(false, false, "") }} + {{ crate::icons::IconCheckSolid.render(false, false, "") }} {%- elif build.build_status == "failure" -%} - {{ crate::f_a::icons::IconTriangleExclamation|fas(false, false, "") }} + {{ crate::icons::IconTriangleExclamationSolid.render(false, false, "") }} {%- elif build.build_status == "in_progress" -%} - {{ crate::f_a::icons::IconGear|fas(false, true, "") }} + {{ crate::icons::IconGearSolid.render(false, true, "") }} {%- else -%} - {{ crate::f_a::icons::IconX|fas(false, false, "") }} + {{ crate::icons::IconXSolid.render(false, false, "") }} {%- endif -%}
    diff --git a/templates/crate/details.html b/templates/crate/details.html index dad034034..fc8153cd7 100644 --- a/templates/crate/details.html +++ b/templates/crate/details.html @@ -43,7 +43,7 @@ {%- if let Some(homepage_url) = homepage_url -%}
  • - {{ crate::f_a::icons::IconHouse|fas(false, false, "") }} Homepage + {{ crate::icons::IconHouseSolid.render(false, false, "") }} Homepage
  • {%- endif -%} @@ -52,7 +52,7 @@ {%- if let Some(documentation_url) = documentation_url -%}
  • - {{ crate::f_a::icons::IconFileLines|far(false, false, "") }} Documentation + {{ crate::icons::IconFileLinesRegular.render(false, false, "") }} Documentation
  • {%- endif -%} @@ -64,20 +64,20 @@ {# If the repo link is for github or gitlab, show some stats #} {# TODO: add support for hosts besides github and gitlab (#35) #} {%- if let Some(repository_metadata) = repository_metadata -%} - {{ crate::f_a::icons::IconCodeBranch|fas(false, false, "") }} + {{ crate::icons::IconCodeBranchSolid.render(false, false, "") }} {% if let Some(name) = repository_metadata.name %} {{name}} {% else %} Repository {% endif %}
    - {{ crate::f_a::icons::IconStar|fas(false, false, "left-margin") }} {{ repository_metadata.stars }} - {{ crate::f_a::icons::IconCodeBranch|fas(false, false, "") }} {{ repository_metadata.forks }} - {{ crate::f_a::icons::IconCircleExclamation|fas(false, false, "") }} {{ repository_metadata.issues }} + {{ crate::icons::IconStarSolid.render(false, false, "left-margin") }} {{ repository_metadata.stars }} + {{ crate::icons::IconCodeBranchSolid.render(false, false, "") }} {{ repository_metadata.forks }} + {{ crate::icons::IconCircleExclamationSolid.render(false, false, "") }} {{ repository_metadata.issues }} {# If the repo link is unknown, just show a normal link #} {%- else -%} - {{ crate::f_a::icons::IconCodeBranch|fas(false, false, "") }} Repository + {{ crate::icons::IconCodeBranchSolid.render(false, false, "") }} Repository {%- endif -%} @@ -87,7 +87,7 @@
  • - {{ crate::f_a::icons::IconCube|fas(false, false, "") }} crates.io + {{ crate::icons::IconCubeSolid.render(false, false, "") }} crates.io
  • @@ -160,7 +160,7 @@
    {%- elif build_status == "in_progress" -%}
    - {{ crate::f_a::icons::IconGear|fas(false, true, "") }} + {{ crate::icons::IconGearSolid.render(false, true, "") }} Build is in progress, it will be available soon
    {%- endif -%} diff --git a/templates/crate/source.html b/templates/crate/source.html index 7249b414c..62cacd059 100644 --- a/templates/crate/source.html +++ b/templates/crate/source.html @@ -29,13 +29,13 @@ {# If we are displaying a file, we also add a button to hide the file sidebar #} {% if has_file_content %}
  • - +
  • {% endif %} {# If this isn't the root folder, show a 'back' button #} {%- if show_parent_link -%}
  • - {{ crate::f_a::icons::IconFolderOpen|far(false, false, "") }} .. + {{ crate::icons::IconFolderOpenRegular.render(false, false, "") }} ..
  • {%- endif -%} @@ -48,23 +48,23 @@ {# Directories #} {%- if file.mime == "dir" -%} - {{ crate::f_a::icons::IconFolderOpen|far(false, false, "") }} + {{ crate::icons::IconFolderOpenRegular.render(false, false, "") }} {# Rust files #} {%- elif file.mime == "text/rust" -%} - {{ crate::f_a::icons::IconRust|fab(false, false, "") }} + {{ crate::icons::IconRustBrands.render(false, false, "") }} {# Cargo.lock #} {%- elif file.mime == "text/plain" && file.name == "Cargo.lock" -%} - {{ crate::f_a::icons::IconLock|fas(false, false, "") }} + {{ crate::icons::IconLockSolid.render(false, false, "") }} {# Markdown files #} {% elif file.mime == "text/markdown" %} - {{ crate::f_a::icons::IconMarkdown|fab(false, false, "") }} + {{ crate::icons::IconMarkdownBrands.render(false, false, "") }} {# .gitignore #} {% elif file.mime == "text/plain" && file.name == ".gitignore" %} - {{ crate::f_a::icons::IconGitAlt|fab(false, false, "") }} + {{ crate::icons::IconGitAltBrands.render(false, false, "") }} {# More ideas @@ -86,11 +86,11 @@ {# Text files or files which mime starts with `text` #} {%- elif file.mime == "text/plain" || file.mime|split_first("/") == Some("text") -%} - {{ crate::f_a::icons::IconFileLines|far(false, false, "") }} + {{ crate::icons::IconFileLinesRegular.render(false, false, "") }} {# Binary files and any unrecognized types #} {% else -%} - {{ crate::f_a::icons::IconFile|far(false, false, "") }} + {{ crate::icons::IconFileRegular.render(false, false, "") }} {%- endif -%} {{ file.name }} diff --git a/templates/header/global_alert.html b/templates/header/global_alert.html index 65743ef33..f45d18b9a 100644 --- a/templates/header/global_alert.html +++ b/templates/header/global_alert.html @@ -4,7 +4,7 @@ {%- if let Some(global_alert) = crate::GLOBAL_ALERT -%}
  • - {{- global_alert.fa_icon.clone()|fas(false, false, "") }} + {{- global_alert.fa_icon.render(false, false, "") }} {{ global_alert.text -}}
  • diff --git a/templates/header/package_navigation.html b/templates/header/package_navigation.html index dbcd0f516..8d71d8896 100644 --- a/templates/header/package_navigation.html +++ b/templates/header/package_navigation.html @@ -23,7 +23,7 @@ {# Page title #}

    {{ metadata.name }} {{ metadata.version }} - {%- include "clipboard.svg" -%} +

    {# Page description #} @@ -39,7 +39,7 @@

    {# The crate information tab #}
  • - {{ crate::f_a::icons::IconCube|fas(false, false, "") }} + {{ crate::icons::IconCubeSolid.render(false, false, "") }} Crate
  • @@ -48,7 +48,7 @@

  • - {{ crate::f_a::icons::IconFolderOpen|far(false, false, "") }} + {{ crate::icons::IconFolderOpenRegular.render(false, false, "") }} Source
  • @@ -57,7 +57,7 @@

  • - {{ crate::f_a::icons::IconGears|fas(false, false, "") }} + {{ crate::icons::IconGearsSolid.render(false, false, "") }} Builds
  • @@ -66,7 +66,7 @@

  • - {{ crate::f_a::icons::IconFlag|fas(false, false, "") }} + {{ crate::icons::IconFlagSolid.render(false, false, "") }} Feature flags
  • @@ -76,7 +76,7 @@

    {%- if metadata.rustdoc_status.unwrap_or_default() -%} - {{ crate::f_a::icons::IconBook|fas(false, false, "") }} Documentation + {{ crate::icons::IconBookSolid.render(false, false, "") }} Documentation {%- endif -%}

    diff --git a/templates/header/topbar_begin.html b/templates/header/topbar_begin.html index 9e6005821..f792ddce0 100644 --- a/templates/header/topbar_begin.html +++ b/templates/header/topbar_begin.html @@ -15,7 +15,7 @@ {# The top-left logo and name #} {# diff --git a/templates/header/topbar_end.html b/templates/header/topbar_end.html index 8700b882b..51eba310e 100644 --- a/templates/header/topbar_end.html +++ b/templates/header/topbar_end.html @@ -60,7 +60,7 @@ {# The search bar #}
    {# If there is a search query, put it in the search bar #} diff --git a/templates/macros.html b/templates/macros.html index c5ddd2c2d..535ad6c06 100644 --- a/templates/macros.html +++ b/templates/macros.html @@ -143,10 +143,10 @@ {% if retain_fragment %}data-fragment="retain"{% endif %} > {% if warning %} - {{ crate::f_a::icons::IconTriangleExclamation|fas(false, false, "") }} + {{ crate::icons::IconTriangleExclamationSolid.render(false, false, "") }} {% endif %} {% if release.build_status == "in_progress" %} - {{ crate::f_a::icons::IconGear|fas(true, true, "") }} + {{ crate::icons::IconGearSolid.render(true, true, "") }} {% endif %} {{ release.version }} diff --git a/templates/releases/header.html b/templates/releases/header.html index 2ad3d7548..8b4de5928 100644 --- a/templates/releases/header.html +++ b/templates/releases/header.html @@ -23,14 +23,14 @@

    {{ title }}

    • - {{ crate::f_a::icons::IconLeaf|fas(false, false, "") }} + {{ crate::icons::IconLeafSolid.render(false, false, "") }} Recent
    • - {{ crate::f_a::icons::IconStar|fas(false, false, "") }} + {{ crate::icons::IconStarSolid.render(false, false, "") }} Stars
    • @@ -38,7 +38,7 @@

      {{ title }}

    • - {{ crate::f_a::icons::IconTriangleExclamation|fas(false, false, "") }} + {{ crate::icons::IconTriangleExclamationSolid.render(false, false, "") }} Recent Failures
    • @@ -46,7 +46,7 @@

      {{ title }}

    • - {{ crate::f_a::icons::IconStar|far(false, false, "") }} + {{ crate::icons::IconStarRegular.render(false, false, "") }} Failures By Stars
    • @@ -54,14 +54,14 @@

      {{ title }}

    • - {{ crate::f_a::icons::IconChartLine|fas(false, false, "") }} + {{ crate::icons::IconChartLineSolid.render(false, false, "") }} Activity
    • - {{ crate::f_a::icons::IconList|fas(false, false, "") }} + {{ crate::icons::IconListSolid.render(false, false, "") }} Queue
    • @@ -69,7 +69,7 @@

      {{ title }}

      {%- if !owner.is_empty() -%}
    • - {{ crate::f_a::icons::IconUser|fas(false, false, "") }} + {{ crate::icons::IconUserSolid.render(false, false, "") }} {{ owner }}
    • diff --git a/templates/releases/releases.html b/templates/releases/releases.html index f02a1eab9..7323db6af 100644 --- a/templates/releases/releases.html +++ b/templates/releases/releases.html @@ -50,7 +50,7 @@ {{ release.name }}-{{ release.version }} {% if !has_unyanked_releases %} - {{ crate::f_a::icons::IconTrash|fas(false, false, "") }} + {{ crate::icons::IconTrashSolid.render(false, false, "") }} Yanked {% endif %} @@ -64,7 +64,7 @@
      {{ release.stars }} - {{ crate::f_a::icons::IconStar|fas(false, false, "") }} + {{ crate::icons::IconStarSolid.render(false, false, "") }}
      {%- elif let Some(build_time) = release.build_time -%}
      - {{ crate::f_a::icons::IconArrowLeft|fas(false, false, "") }} Previous Page + {{ crate::icons::IconArrowLeftSolid.render(false, false, "") }} Previous Page {%- endif -%} {%- if show_next_page -%} - Next Page {{ crate::f_a::icons::IconArrowRight|fas(false, false, "") }} + Next Page {{ crate::icons::IconArrowRightSolid.render(false, false, "") }} {%- endif -%} {% endblock pagination %} diff --git a/templates/releases/search_results.html b/templates/releases/search_results.html index 1ace55fe3..9ca938177 100644 --- a/templates/releases/search_results.html +++ b/templates/releases/search_results.html @@ -15,7 +15,7 @@
      Sort by {% set search_sort_by_val = search_sort_by.as_deref().unwrap_or_default() %}