Skip to content

Another attempt at updating FontAwesome to version 5 #1423

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 10 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
74 changes: 60 additions & 14 deletions src/renderer/html_handlebars/hbs_renderer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -218,40 +218,86 @@ impl HtmlHandlebars {
write_file(destination, "ayu-highlight.css", &theme.ayu_highlight_css)?;
write_file(destination, "highlight.js", &theme.highlight_js)?;
write_file(destination, "clipboard.min.js", &theme.clipboard_js)?;
write_file(destination, "FontAwesome/css/all.css", theme::FONT_AWESOME)?;
write_file(
destination,
"FontAwesome/css/font-awesome.css",
theme::FONT_AWESOME,
"FontAwesome/css/v4-shims.css",
theme::FONT_AWESOME_V4_SHIMS,
)?;
write_file(
destination,
"FontAwesome/fonts/fontawesome-webfont.eot",
theme::FONT_AWESOME_EOT,
"FontAwesome/webfonts/fa-regular-400.eot",
theme::FONT_AWESOME_REGULAR_EOT,
)?;
write_file(
destination,
"FontAwesome/fonts/fontawesome-webfont.svg",
theme::FONT_AWESOME_SVG,
"FontAwesome/webfonts/fa-regular-400.svg",
theme::FONT_AWESOME_REGULAR_SVG,
)?;
write_file(
destination,
"FontAwesome/fonts/fontawesome-webfont.ttf",
theme::FONT_AWESOME_TTF,
"FontAwesome/webfonts/fa-regular-400.ttf",
theme::FONT_AWESOME_REGULAR_TTF,
)?;
write_file(
destination,
"FontAwesome/fonts/fontawesome-webfont.woff",
theme::FONT_AWESOME_WOFF,
"FontAwesome/webfonts/fa-regular-400.woff",
theme::FONT_AWESOME_REGULAR_WOFF,
)?;
write_file(
destination,
"FontAwesome/fonts/fontawesome-webfont.woff2",
theme::FONT_AWESOME_WOFF2,
"FontAwesome/webfonts/fa-regular-400.woff2",
theme::FONT_AWESOME_REGULAR_WOFF2,
)?;
write_file(
destination,
"FontAwesome/fonts/FontAwesome.ttf",
theme::FONT_AWESOME_TTF,
"FontAwesome/webfonts/fa-brands-400.eot",
theme::FONT_AWESOME_BRANDS_EOT,
)?;
write_file(
destination,
"FontAwesome/webfonts/fa-brands-400.svg",
theme::FONT_AWESOME_BRANDS_SVG,
)?;
write_file(
destination,
"FontAwesome/webfonts/fa-brands-400.ttf",
theme::FONT_AWESOME_BRANDS_TTF,
)?;
write_file(
destination,
"FontAwesome/webfonts/fa-brands-400.woff",
theme::FONT_AWESOME_BRANDS_WOFF,
)?;
write_file(
destination,
"FontAwesome/webfonts/fa-brands-400.woff2",
theme::FONT_AWESOME_BRANDS_WOFF2,
)?;
write_file(
destination,
"FontAwesome/webfonts/fa-solid-900.eot",
theme::FONT_AWESOME_SOLID_EOT,
)?;
write_file(
destination,
"FontAwesome/webfonts/fa-solid-900.svg",
theme::FONT_AWESOME_SOLID_SVG,
)?;
write_file(
destination,
"FontAwesome/webfonts/fa-solid-900.ttf",
theme::FONT_AWESOME_SOLID_TTF,
)?;
write_file(
destination,
"FontAwesome/webfonts/fa-solid-900.woff",
theme::FONT_AWESOME_SOLID_WOFF,
)?;
write_file(
destination,
"FontAwesome/webfonts/fa-solid-900.woff2",
theme::FONT_AWESOME_SOLID_WOFF2,
)?;
if html_config.copy_fonts {
write_file(destination, "fonts/fonts.css", theme::fonts::CSS)?;
Expand Down
5 changes: 5 additions & 0 deletions src/theme/FontAwesome/css/all.min.css

Large diffs are not rendered by default.

4 changes: 0 additions & 4 deletions src/theme/FontAwesome/css/font-awesome.min.css

This file was deleted.

5 changes: 5 additions & 0 deletions src/theme/FontAwesome/css/v4-shims.min.css

Large diffs are not rendered by default.

Binary file removed src/theme/FontAwesome/fonts/FontAwesome.otf
Binary file not shown.
Binary file removed src/theme/FontAwesome/fonts/fontawesome-webfont.eot
Binary file not shown.
2,671 changes: 0 additions & 2,671 deletions src/theme/FontAwesome/fonts/fontawesome-webfont.svg

This file was deleted.

Binary file removed src/theme/FontAwesome/fonts/fontawesome-webfont.ttf
Binary file not shown.
Binary file removed src/theme/FontAwesome/fonts/fontawesome-webfont.woff
Binary file not shown.
Binary file not shown.
Binary file added src/theme/FontAwesome/webfonts/fa-brands-400.eot
Binary file not shown.
3,717 changes: 3,717 additions & 0 deletions src/theme/FontAwesome/webfonts/fa-brands-400.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/theme/FontAwesome/webfonts/fa-brands-400.ttf
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added src/theme/FontAwesome/webfonts/fa-regular-400.eot
Binary file not shown.
801 changes: 801 additions & 0 deletions src/theme/FontAwesome/webfonts/fa-regular-400.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/theme/FontAwesome/webfonts/fa-regular-400.ttf
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added src/theme/FontAwesome/webfonts/fa-solid-900.eot
Binary file not shown.
5,028 changes: 5,028 additions & 0 deletions src/theme/FontAwesome/webfonts/fa-solid-900.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/theme/FontAwesome/webfonts/fa-solid-900.ttf
Binary file not shown.
Binary file added src/theme/FontAwesome/webfonts/fa-solid-900.woff
Binary file not shown.
Binary file added src/theme/FontAwesome/webfonts/fa-solid-900.woff2
Binary file not shown.
9 changes: 6 additions & 3 deletions src/theme/index.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,11 @@
<link rel="stylesheet" href="{{ path_to_root }}css/print.css" media="print">
{{/if}}

<!-- Font Awesome 5.13 free content -->
<link rel="stylesheet" href="{{ path_to_root }}FontAwesome/css/all.css">
<link rel="stylesheet" href="{{ path_to_root }}FontAwesome/css/v4-shims.css">

<!-- Fonts -->
<link rel="stylesheet" href="{{ path_to_root }}FontAwesome/css/font-awesome.css">
{{#if copy_fonts}}
<link rel="stylesheet" href="{{ path_to_root }}fonts/fonts.css">
{{/if}}
Expand Down Expand Up @@ -119,7 +122,7 @@
<i class="fa fa-bars"></i>
</button>
<button id="theme-toggle" class="icon-button" type="button" title="Change theme" aria-label="Change theme" aria-haspopup="true" aria-expanded="false" aria-controls="theme-list">
<i class="fa fa-paint-brush"></i>
<i class="fa fa-palette"></i>
</button>
<ul id="theme-list" class="theme-popup" aria-label="Themes" role="menu">
<li role="none"><button role="menuitem" class="theme" id="light">{{ theme_option "Light" }}</button></li>
Expand All @@ -145,7 +148,7 @@
{{/if}}
{{#if git_repository_url}}
<a href="{{git_repository_url}}" title="Git repository" aria-label="Git repository">
<i id="git-repository-button" class="fa {{git_repository_icon}}"></i>
<i id="git-repository-button" class="fab {{git_repository_icon}}"></i>
</a>
{{/if}}
</div>
Expand Down
37 changes: 29 additions & 8 deletions src/theme/mod.rs
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,35 @@ pub static TOMORROW_NIGHT_CSS: &[u8] = include_bytes!("tomorrow-night.css");
pub static HIGHLIGHT_CSS: &[u8] = include_bytes!("highlight.css");
pub static AYU_HIGHLIGHT_CSS: &[u8] = include_bytes!("ayu-highlight.css");
pub static CLIPBOARD_JS: &[u8] = include_bytes!("clipboard.min.js");
pub static FONT_AWESOME: &[u8] = include_bytes!("FontAwesome/css/font-awesome.min.css");
pub static FONT_AWESOME_EOT: &[u8] = include_bytes!("FontAwesome/fonts/fontawesome-webfont.eot");
pub static FONT_AWESOME_SVG: &[u8] = include_bytes!("FontAwesome/fonts/fontawesome-webfont.svg");
pub static FONT_AWESOME_TTF: &[u8] = include_bytes!("FontAwesome/fonts/fontawesome-webfont.ttf");
pub static FONT_AWESOME_WOFF: &[u8] = include_bytes!("FontAwesome/fonts/fontawesome-webfont.woff");
pub static FONT_AWESOME_WOFF2: &[u8] =
include_bytes!("FontAwesome/fonts/fontawesome-webfont.woff2");
pub static FONT_AWESOME_OTF: &[u8] = include_bytes!("FontAwesome/fonts/FontAwesome.otf");
pub static FONT_AWESOME: &[u8] = include_bytes!("FontAwesome/css/all.min.css");
pub static FONT_AWESOME_V4_SHIMS: &[u8] = include_bytes!("FontAwesome/css/v4-shims.min.css");
pub static FONT_AWESOME_BRANDS_EOT: &[u8] =
include_bytes!("FontAwesome/webfonts/fa-brands-400.eot");
pub static FONT_AWESOME_BRANDS_SVG: &[u8] =
include_bytes!("FontAwesome/webfonts/fa-brands-400.svg");
pub static FONT_AWESOME_BRANDS_TTF: &[u8] =
include_bytes!("FontAwesome/webfonts/fa-brands-400.ttf");
pub static FONT_AWESOME_BRANDS_WOFF: &[u8] =
include_bytes!("FontAwesome/webfonts/fa-brands-400.woff");
pub static FONT_AWESOME_BRANDS_WOFF2: &[u8] =
include_bytes!("FontAwesome/webfonts/fa-brands-400.woff2");
pub static FONT_AWESOME_REGULAR_EOT: &[u8] =
include_bytes!("FontAwesome/webfonts/fa-regular-400.eot");
pub static FONT_AWESOME_REGULAR_SVG: &[u8] =
include_bytes!("FontAwesome/webfonts/fa-regular-400.svg");
pub static FONT_AWESOME_REGULAR_TTF: &[u8] =
include_bytes!("FontAwesome/webfonts/fa-regular-400.ttf");
pub static FONT_AWESOME_REGULAR_WOFF: &[u8] =
include_bytes!("FontAwesome/webfonts/fa-regular-400.woff");
pub static FONT_AWESOME_REGULAR_WOFF2: &[u8] =
include_bytes!("FontAwesome/webfonts/fa-regular-400.woff2");
pub static FONT_AWESOME_SOLID_EOT: &[u8] = include_bytes!("FontAwesome/webfonts/fa-solid-900.eot");
pub static FONT_AWESOME_SOLID_SVG: &[u8] = include_bytes!("FontAwesome/webfonts/fa-solid-900.svg");
pub static FONT_AWESOME_SOLID_TTF: &[u8] = include_bytes!("FontAwesome/webfonts/fa-solid-900.ttf");
pub static FONT_AWESOME_SOLID_WOFF: &[u8] =
include_bytes!("FontAwesome/webfonts/fa-solid-900.woff");
pub static FONT_AWESOME_SOLID_WOFF2: &[u8] =
include_bytes!("FontAwesome/webfonts/fa-solid-900.woff2");

/// The `Theme` struct should be used instead of the static variables because
/// the `new()` method will look if the user has a theme directory in their
Expand Down