File tree 3 files changed +7
-13
lines changed
3 files changed +7
-13
lines changed Original file line number Diff line number Diff line change @@ -8,9 +8,8 @@ use crate::html::format::{Buffer, Print};
8
8
use crate :: html:: render:: { ensure_trailing_slash, StylePath } ;
9
9
10
10
use askama:: Template ;
11
- use serde:: Serialize ;
12
11
13
- #[ derive( Clone , Serialize ) ]
12
+ #[ derive( Clone ) ]
14
13
crate struct Layout {
15
14
crate logo : String ,
16
15
crate favicon : String ,
@@ -27,7 +26,6 @@ crate struct Layout {
27
26
crate scrape_examples_extension : bool ,
28
27
}
29
28
30
- #[ derive( Serialize ) ]
31
29
crate struct Page < ' a > {
32
30
crate title : & ' a str ,
33
31
crate css_class : & ' a str ,
@@ -46,7 +44,7 @@ impl<'a> Page<'a> {
46
44
}
47
45
}
48
46
49
- #[ derive( Serialize , Template ) ]
47
+ #[ derive( Template ) ]
50
48
#[ template( path = "page.html" ) ]
51
49
struct PageLayout < ' a > {
52
50
static_root_path : & ' a str ,
Original file line number Diff line number Diff line change @@ -33,21 +33,19 @@ use crate::html::layout::Page;
33
33
use crate :: html:: markdown:: { HeadingOffset , MarkdownSummaryLine } ;
34
34
35
35
use askama:: Template ;
36
- use serde:: Serialize ;
37
36
38
37
const ITEM_TABLE_OPEN : & str = "<div class=\" item-table\" >" ;
39
38
const ITEM_TABLE_CLOSE : & str = "</div>" ;
40
39
const ITEM_TABLE_ROW_OPEN : & str = "<div class=\" item-row\" >" ;
41
40
const ITEM_TABLE_ROW_CLOSE : & str = "</div>" ;
42
41
43
42
// A component in a `use` path, like `string` in std::string::ToString
44
- #[ derive( Serialize ) ]
45
43
struct PathComponent < ' a > {
46
44
path : String ,
47
45
name : & ' a str ,
48
46
}
49
47
50
- #[ derive( Serialize , Template ) ]
48
+ #[ derive( Template ) ]
51
49
#[ template( path = "print_item.html" ) ]
52
50
struct ItemVars < ' a > {
53
51
page : & ' a Page < ' a > ,
Original file line number Diff line number Diff line change 49
49
< link rel ="stylesheet " {# -#}
50
50
href ="{{static_root_path|safe}}noscript{{page.resource_suffix}}.css "> {#- -#}
51
51
</ noscript > {#- -#}
52
- {%- match layout.css_file_extension -%}
53
- {%- when Some with (ext) -%}
54
- < link rel ="stylesheet " type ="text/css " {# -#}
55
- href ="{{static_root_path|safe}}theme{{page.resource_suffix}}.css "> {#- -#}
56
- {%- else -%}
57
- {%- endmatch -%}
52
+ {%- if layout.css_file_extension.is_some() -%}
53
+ < link rel ="stylesheet " type ="text/css " {# -#}
54
+ href ="{{static_root_path|safe}}theme{{page.resource_suffix}}.css "> {#- -#}
55
+ {%- endif -%}
58
56
{%- if !layout.favicon.is_empty() -%}
59
57
< link rel ="shortcut icon " href ="{{layout.favicon}} "> {#- -#}
60
58
{%- else -%}
You can’t perform that action at this time.
0 commit comments