File tree Expand file tree Collapse file tree 6 files changed +19
-8
lines changed Expand file tree Collapse file tree 6 files changed +19
-8
lines changed Original file line number Diff line number Diff line change @@ -200,7 +200,7 @@ The following configuration options are available:
200200- ** git-repository-url:** A url to the git repository for the book. If provided
201201 an icon link will be output in the menu bar of the book.
202202- ** git-repository-icon:** The FontAwesome icon class to use for the git
203- repository link. Defaults to ` fa -github` .
203+ repository link. Defaults to ` fab -github` .
204204- ** redirect:** A subtable used for generating redirects when a page is moved.
205205 The table contains key-value pairs where the key is where the redirect file
206206 needs to be created, as an absolute path from the build directory, (e.g.
@@ -285,7 +285,7 @@ additional-css = ["custom.css", "custom2.css"]
285285additional-js = [" custom.js" ]
286286no-section-label = false
287287git-repository-url = " https://github.com/rust-lang/mdBook"
288- git-repository-icon = " fa -github"
288+ git-repository-icon = " fab -github"
289289site-url = " /example-book/"
290290cname = " myproject.rs"
291291input-404 = " not-found.md"
Original file line number Diff line number Diff line change @@ -205,9 +205,9 @@ contents (sidebar) by including a `\{{#title ...}}` near the top of the page.
205205## Font-Awesome icons
206206
207207mdBook includes a copy of [ Font Awesome Free's] ( https://fontawesome.com )
208- MIT-licensed SVG files. It emulates the ` <i class="fa" > ` syntax, but converts
209- the results to inline SVG. Only the regular, solid, and brands icons are
210- included; paid features like the light icons are not.
208+ MIT-licensed SVG files. It emulates the ` <i> ` syntax, but converts the results
209+ to inline SVG. Only the regular, solid, and brands icons are included; paid
210+ features like the light icons are not.
211211
212212For example, given this HTML syntax:
213213
Original file line number Diff line number Diff line change @@ -87,7 +87,7 @@ They are used like this
8787``` handlebars
8888{{#previous}}
8989 <a href="{{link}}" class="nav-chapters previous">
90- <i class="fa fa- angle-left"></i>
90+ {{fa "solid" " angle-left"}}
9191 </a>
9292{{/previous}}
9393```
Original file line number Diff line number Diff line change @@ -651,9 +651,16 @@ fn make_data(
651651
652652 let git_repository_icon = match html_config. git_repository_icon {
653653 Some ( ref git_repository_icon) => git_repository_icon,
654- None => "fa-github" ,
654+ None => "fab-github" ,
655+ } ;
656+ let git_repository_icon_class = match git_repository_icon. split ( '-' ) . next ( ) {
657+ Some ( "fa" ) => "regular" ,
658+ Some ( "fas" ) => "solid" ,
659+ Some ( "fab" ) => "brands" ,
660+ _ => "regular" ,
655661 } ;
656662 data. insert ( "git_repository_icon" . to_owned ( ) , json ! ( git_repository_icon) ) ;
663+ data. insert ( "git_repository_icon_class" . to_owned ( ) , json ! ( git_repository_icon_class) ) ;
657664
658665 let mut chapters = vec ! [ ] ;
659666
Original file line number Diff line number Diff line change @@ -26,6 +26,10 @@ pub fn fa_helper(
2626
2727 let name = if name. starts_with ( "fa-" ) {
2828 & name[ 3 ..]
29+ } else if name. starts_with ( "fab-" ) {
30+ & name[ 4 ..]
31+ } else if name. starts_with ( "fas-" ) {
32+ & name[ 4 ..]
2933 } else {
3034 & name[ ..]
3135 } ;
Original file line number Diff line number Diff line change 144144 {{ /if }}
145145 {{ #if git_repository_url }}
146146 <a href =" {{ git_repository_url }} " title =" Git repository" aria-label =" Git repository" >
147- {{ fa " solid " git_repository_icon }}
147+ {{ fa git_repository_icon_class git_repository_icon }}
148148 </a >
149149 {{ /if }}
150150 </div >
You can’t perform that action at this time.
0 commit comments