Skip to content

Commit f154b2f

Browse files
authored
Merge pull request #697 from mattico/fix-fontawesome-gh-pages
Fix FontAwesome directory missing from Github Pages sites
2 parents b9ca108 + d7759fb commit f154b2f

10 files changed

+18
-15
lines changed

src/renderer/html_handlebars/hbs_renderer.rs

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,9 @@ impl HtmlHandlebars {
142142
) -> Result<()> {
143143
use utils::fs::write_file;
144144

145+
write_file(destination, ".nojekyll",
146+
b"This file makes sure that Github Pages doesn't process mdBook's output.")?;
147+
145148
write_file(destination, "book.js", &theme.js)?;
146149
write_file(destination, "book.css", &theme.css)?;
147150
write_file(destination, "favicon.png", &theme.favicon)?;
@@ -152,37 +155,37 @@ impl HtmlHandlebars {
152155
write_file(destination, "clipboard.min.js", &theme.clipboard_js)?;
153156
write_file(
154157
destination,
155-
"_FontAwesome/css/font-awesome.css",
158+
"FontAwesome/css/font-awesome.css",
156159
theme::FONT_AWESOME,
157160
)?;
158161
write_file(
159162
destination,
160-
"_FontAwesome/fonts/fontawesome-webfont.eot",
163+
"FontAwesome/fonts/fontawesome-webfont.eot",
161164
theme::FONT_AWESOME_EOT,
162165
)?;
163166
write_file(
164167
destination,
165-
"_FontAwesome/fonts/fontawesome-webfont.svg",
168+
"FontAwesome/fonts/fontawesome-webfont.svg",
166169
theme::FONT_AWESOME_SVG,
167170
)?;
168171
write_file(
169172
destination,
170-
"_FontAwesome/fonts/fontawesome-webfont.ttf",
173+
"FontAwesome/fonts/fontawesome-webfont.ttf",
171174
theme::FONT_AWESOME_TTF,
172175
)?;
173176
write_file(
174177
destination,
175-
"_FontAwesome/fonts/fontawesome-webfont.woff",
178+
"FontAwesome/fonts/fontawesome-webfont.woff",
176179
theme::FONT_AWESOME_WOFF,
177180
)?;
178181
write_file(
179182
destination,
180-
"_FontAwesome/fonts/fontawesome-webfont.woff2",
183+
"FontAwesome/fonts/fontawesome-webfont.woff2",
181184
theme::FONT_AWESOME_WOFF2,
182185
)?;
183186
write_file(
184187
destination,
185-
"_FontAwesome/fonts/FontAwesome.ttf",
188+
"FontAwesome/fonts/FontAwesome.ttf",
186189
theme::FONT_AWESOME_TTF,
187190
)?;
188191

src/theme/index.hbs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
<link rel="shortcut icon" href="{{ favicon }}">
1919

2020
<!-- Font Awesome -->
21-
<link rel="stylesheet" href="_FontAwesome/css/font-awesome.css">
21+
<link rel="stylesheet" href="FontAwesome/css/font-awesome.css">
2222

2323
<link rel="stylesheet" href="highlight.css">
2424
<link rel="stylesheet" href="tomorrow-night.css">

src/theme/mod.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,18 +21,18 @@ pub static TOMORROW_NIGHT_CSS: &'static [u8] = include_bytes!("tomorrow-night.cs
2121
pub static HIGHLIGHT_CSS: &'static [u8] = include_bytes!("highlight.css");
2222
pub static AYU_HIGHLIGHT_CSS: &'static [u8] = include_bytes!("ayu-highlight.css");
2323
pub static CLIPBOARD_JS: &'static [u8] = include_bytes!("clipboard.min.js");
24-
pub static FONT_AWESOME: &'static [u8] = include_bytes!("_FontAwesome/css/font-awesome.min.css");
24+
pub static FONT_AWESOME: &'static [u8] = include_bytes!("FontAwesome/css/font-awesome.min.css");
2525
pub static FONT_AWESOME_EOT: &'static [u8] =
26-
include_bytes!("_FontAwesome/fonts/fontawesome-webfont.eot");
26+
include_bytes!("FontAwesome/fonts/fontawesome-webfont.eot");
2727
pub static FONT_AWESOME_SVG: &'static [u8] =
28-
include_bytes!("_FontAwesome/fonts/fontawesome-webfont.svg");
28+
include_bytes!("FontAwesome/fonts/fontawesome-webfont.svg");
2929
pub static FONT_AWESOME_TTF: &'static [u8] =
30-
include_bytes!("_FontAwesome/fonts/fontawesome-webfont.ttf");
30+
include_bytes!("FontAwesome/fonts/fontawesome-webfont.ttf");
3131
pub static FONT_AWESOME_WOFF: &'static [u8] =
32-
include_bytes!("_FontAwesome/fonts/fontawesome-webfont.woff");
32+
include_bytes!("FontAwesome/fonts/fontawesome-webfont.woff");
3333
pub static FONT_AWESOME_WOFF2: &'static [u8] =
34-
include_bytes!("_FontAwesome/fonts/fontawesome-webfont.woff2");
35-
pub static FONT_AWESOME_OTF: &'static [u8] = include_bytes!("_FontAwesome/fonts/FontAwesome.otf");
34+
include_bytes!("FontAwesome/fonts/fontawesome-webfont.woff2");
35+
pub static FONT_AWESOME_OTF: &'static [u8] = include_bytes!("FontAwesome/fonts/FontAwesome.otf");
3636

3737

3838
/// The `Theme` struct should be used instead of the static variables because

0 commit comments

Comments
 (0)