File tree Expand file tree Collapse file tree 3 files changed +7
-13
lines changed Expand file tree Collapse file tree 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};
88use crate :: html:: render:: { ensure_trailing_slash, StylePath } ;
99
1010use askama:: Template ;
11- use serde:: Serialize ;
1211
13- #[ derive( Clone , Serialize ) ]
12+ #[ derive( Clone ) ]
1413crate struct Layout {
1514 crate logo : String ,
1615 crate favicon : String ,
@@ -27,7 +26,6 @@ crate struct Layout {
2726 crate scrape_examples_extension : bool ,
2827}
2928
30- #[ derive( Serialize ) ]
3129crate struct Page < ' a > {
3230 crate title : & ' a str ,
3331 crate css_class : & ' a str ,
@@ -46,7 +44,7 @@ impl<'a> Page<'a> {
4644 }
4745}
4846
49- #[ derive( Serialize , Template ) ]
47+ #[ derive( Template ) ]
5048#[ template( path = "page.html" ) ]
5149struct PageLayout < ' a > {
5250 static_root_path : & ' a str ,
Original file line number Diff line number Diff line change @@ -33,21 +33,19 @@ use crate::html::layout::Page;
3333use crate :: html:: markdown:: { HeadingOffset , MarkdownSummaryLine } ;
3434
3535use askama:: Template ;
36- use serde:: Serialize ;
3736
3837const ITEM_TABLE_OPEN : & str = "<div class=\" item-table\" >" ;
3938const ITEM_TABLE_CLOSE : & str = "</div>" ;
4039const ITEM_TABLE_ROW_OPEN : & str = "<div class=\" item-row\" >" ;
4140const ITEM_TABLE_ROW_CLOSE : & str = "</div>" ;
4241
4342// A component in a `use` path, like `string` in std::string::ToString
44- #[ derive( Serialize ) ]
4543struct PathComponent < ' a > {
4644 path : String ,
4745 name : & ' a str ,
4846}
4947
50- #[ derive( Serialize , Template ) ]
48+ #[ derive( Template ) ]
5149#[ template( path = "print_item.html" ) ]
5250struct ItemVars < ' a > {
5351 page : & ' a Page < ' a > ,
Original file line number Diff line number Diff line change 4949 < link rel ="stylesheet " {# -#}
5050 href ="{{static_root_path|safe}}noscript{{page.resource_suffix}}.css "> {#- -#}
5151 </ 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 -%}
5856 {%- if !layout.favicon.is_empty() -%}
5957 < link rel ="shortcut icon " href ="{{layout.favicon}} "> {#- -#}
6058 {%- else -%}
You can’t perform that action at this time.
0 commit comments