Skip to content

Commit

Permalink
Upgrade to using FontAwesome 6.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
JorelAli committed Sep 8, 2022
1 parent 1a08927 commit 8738b8b
Show file tree
Hide file tree
Showing 17 changed files with 52 additions and 2,708 deletions.
26 changes: 13 additions & 13 deletions src/renderer/html_handlebars/hbs_renderer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -239,38 +239,38 @@ impl HtmlHandlebars {
write_file(destination, "clipboard.min.js", &theme.clipboard_js)?;
write_file(
destination,
"FontAwesome/css/font-awesome.css",
"fontawesome/css/fontawesome.css",
theme::FONT_AWESOME,
)?;
write_file(
destination,
"FontAwesome/fonts/fontawesome-webfont.eot",
theme::FONT_AWESOME_EOT,
"fontawesome/css/brands.css",
theme::FONT_AWESOME_BRANDS,
)?;
write_file(
destination,
"FontAwesome/fonts/fontawesome-webfont.svg",
theme::FONT_AWESOME_SVG,
"fontawesome/css/solid.css",
theme::FONT_AWESOME_SOLID,
)?;
write_file(
destination,
"FontAwesome/fonts/fontawesome-webfont.ttf",
theme::FONT_AWESOME_TTF,
"fontawesome/webfonts/fa-brands-400.ttf",
theme::FONT_AWESOME_BRANDS_TTF,
)?;
write_file(
destination,
"FontAwesome/fonts/fontawesome-webfont.woff",
theme::FONT_AWESOME_WOFF,
"fontawesome/webfonts/fa-brands-400.woff2",
theme::FONT_AWESOME_BRANDS_WOFF2,
)?;
write_file(
destination,
"FontAwesome/fonts/fontawesome-webfont.woff2",
theme::FONT_AWESOME_WOFF2,
"fontawesome/webfonts/fa-solid-900.ttf",
theme::FONT_AWESOME_SOLID_TTF,
)?;
write_file(
destination,
"FontAwesome/fonts/FontAwesome.ttf",
theme::FONT_AWESOME_TTF,
"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
4 changes: 0 additions & 4 deletions src/theme/FontAwesome/css/font-awesome.min.css

This file was deleted.

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.
6 changes: 6 additions & 0 deletions src/theme/fontawesome/css/brands.min.css

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions src/theme/fontawesome/css/fontawesome.min.css

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions src/theme/fontawesome/css/solid.min.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/*!
* Font Awesome Free 6.2.0 by @fontawesome - https://fontawesome.com
* License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License)
* Copyright 2022 Fonticons, Inc.
*/
:host,:root{--fa-style-family-classic:"Font Awesome 6 Free";--fa-font-solid:normal 900 1em/1 "Font Awesome 6 Free"}@font-face{font-family:"Font Awesome 6 Free";font-style:normal;font-weight:900;font-display:block;src:url(../webfonts/fa-solid-900.woff2) format("woff2"),url(../webfonts/fa-solid-900.ttf) format("truetype")}.fa-solid,.fas{font-weight:900}
Binary file added src/theme/fontawesome/webfonts/fa-brands-400.ttf
Binary file not shown.
Binary file not shown.
Binary file added src/theme/fontawesome/webfonts/fa-solid-900.ttf
Binary file not shown.
Binary file not shown.
26 changes: 14 additions & 12 deletions src/theme/index.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,10 @@
<link rel="stylesheet" href="{{ path_to_root }}css/print.css" media="print">
{{/if}}

<!-- Fonts -->
<link rel="stylesheet" href="{{ path_to_root }}FontAwesome/css/font-awesome.css">
<!-- Fonts (including FontAwesome 6.2.0 free content) -->
<link rel="stylesheet" href="{{ path_to_root }}fontawesome/css/fontawesome.css">
<link rel="stylesheet" href="{{ path_to_root }}fontawesome/css/brands.css">
<link rel="stylesheet" href="{{ path_to_root }}fontawesome/css/solid.css">
{{#if copy_fonts}}
<link rel="stylesheet" href="{{ path_to_root }}fonts/fonts.css">
{{/if}}
Expand Down Expand Up @@ -116,10 +118,10 @@
<div id="menu-bar" class="menu-bar sticky bordered">
<div class="left-buttons">
<button id="sidebar-toggle" class="icon-button" type="button" title="Toggle Table of Contents" aria-label="Toggle Table of Contents" aria-controls="sidebar">
<i class="fa fa-bars"></i>
<i class="fa-solid 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-solid fa-paintbrush"></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 @@ -130,7 +132,7 @@
</ul>
{{#if search_enabled}}
<button id="search-toggle" class="icon-button" type="button" title="Search. (Shortkey: s)" aria-label="Toggle Searchbar" aria-expanded="false" aria-keyshortcuts="S" aria-controls="searchbar">
<i class="fa fa-search"></i>
<i class="fa-solid fa-magnifying-glass"></i>
</button>
{{/if}}
</div>
Expand All @@ -140,17 +142,17 @@
<div class="right-buttons">
{{#if print_enable}}
<a href="{{ path_to_root }}print.html" title="Print this book" aria-label="Print this book">
<i id="print-button" class="fa fa-print"></i>
<i id="print-button" class="fa-solid fa-print"></i>
</a>
{{/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="fa-brands {{git_repository_icon}}"></i>
</a>
{{/if}}
{{#if git_repository_edit_url}}
<a href="{{git_repository_edit_url}}" title="Suggest an edit" aria-label="Suggest an edit">
<i id="git-edit-button" class="fa fa-edit"></i>
<i id="git-edit-button" class="fa-solid fa-pen-to-square"></i>
</a>
{{/if}}

Expand Down Expand Up @@ -188,13 +190,13 @@
<!-- Mobile navigation buttons -->
{{#previous}}
<a rel="prev" href="{{ path_to_root }}{{link}}" class="mobile-nav-chapters previous" title="Previous chapter" aria-label="Previous chapter" aria-keyshortcuts="Left">
<i class="fa fa-angle-left"></i>
<i class="fa-solid fa-angle-left"></i>
</a>
{{/previous}}

{{#next}}
<a rel="next" href="{{ path_to_root }}{{link}}" class="mobile-nav-chapters next" title="Next chapter" aria-label="Next chapter" aria-keyshortcuts="Right">
<i class="fa fa-angle-right"></i>
<i class="fa-solid fa-angle-right"></i>
</a>
{{/next}}

Expand All @@ -206,13 +208,13 @@
<nav class="nav-wide-wrapper" aria-label="Page navigation">
{{#previous}}
<a rel="prev" href="{{ path_to_root }}{{link}}" class="nav-chapters previous" title="Previous chapter" aria-label="Previous chapter" aria-keyshortcuts="Left">
<i class="fa fa-angle-left"></i>
<i class="fa-solid fa-angle-left"></i>
</a>
{{/previous}}

{{#next}}
<a rel="next" href="{{ path_to_root }}{{link}}" class="nav-chapters next" title="Next chapter" aria-label="Next chapter" aria-keyshortcuts="Right">
<i class="fa fa-angle-right"></i>
<i class="fa-solid fa-angle-right"></i>
</a>
{{/next}}
</nav>
Expand Down
15 changes: 7 additions & 8 deletions src/theme/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,13 @@ 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/fontawesome.min.css");
pub static FONT_AWESOME_BRANDS: &[u8] = include_bytes!("fontawesome/css/brands.min.css");
pub static FONT_AWESOME_SOLID: &[u8] = include_bytes!("fontawesome/css/solid.min.css");
pub static FONT_AWESOME_BRANDS_TTF: &[u8] = include_bytes!("fontawesome/webfonts/fa-brands-400.ttf");
pub static FONT_AWESOME_BRANDS_WOFF2: &[u8] = include_bytes!("fontawesome/webfonts/fa-brands-400.woff2");
pub static FONT_AWESOME_SOLID_TTF: &[u8] = include_bytes!("fontawesome/webfonts/fa-solid-900.ttf");
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

0 comments on commit 8738b8b

Please sign in to comment.