Address feedback

This commit is contained in:
Dirkjan Ochtman 2022-01-03 21:16:05 +01:00
parent 93a16cb7e2
commit b00d6668b7
3 changed files with 7 additions and 13 deletions

View File

@ -8,9 +8,8 @@
use crate::html::render::{ensure_trailing_slash, StylePath};
use askama::Template;
use serde::Serialize;
#[derive(Clone, Serialize)]
#[derive(Clone)]
crate struct Layout {
crate logo: String,
crate favicon: String,
@ -27,7 +26,6 @@
crate scrape_examples_extension: bool,
}
#[derive(Serialize)]
crate struct Page<'a> {
crate title: &'a str,
crate css_class: &'a str,
@ -46,7 +44,7 @@ impl<'a> Page<'a> {
}
}
#[derive(Serialize, Template)]
#[derive(Template)]
#[template(path = "page.html")]
struct PageLayout<'a> {
static_root_path: &'a str,

View File

@ -33,7 +33,6 @@
use crate::html::markdown::{HeadingOffset, MarkdownSummaryLine};
use askama::Template;
use serde::Serialize;
const ITEM_TABLE_OPEN: &str = "<div class=\"item-table\">";
const ITEM_TABLE_CLOSE: &str = "</div>";
@ -41,13 +40,12 @@
const ITEM_TABLE_ROW_CLOSE: &str = "</div>";
// A component in a `use` path, like `string` in std::string::ToString
#[derive(Serialize)]
struct PathComponent<'a> {
path: String,
name: &'a str,
}
#[derive(Serialize, Template)]
#[derive(Template)]
#[template(path = "print_item.html")]
struct ItemVars<'a> {
page: &'a Page<'a>,

View File

@ -49,12 +49,10 @@
<link rel="stylesheet" {# -#}
href="{{static_root_path|safe}}noscript{{page.resource_suffix}}.css"> {#- -#}
</noscript> {#- -#}
{%- match layout.css_file_extension -%}
{%- when Some with (ext) -%}
<link rel="stylesheet" type="text/css" {# -#}
href="{{static_root_path|safe}}theme{{page.resource_suffix}}.css"> {#- -#}
{%- else -%}
{%- endmatch -%}
{%- if layout.css_file_extension.is_some() -%}
<link rel="stylesheet" type="text/css" {# -#}
href="{{static_root_path|safe}}theme{{page.resource_suffix}}.css"> {#- -#}
{%- endif -%}
{%- if !layout.favicon.is_empty() -%}
<link rel="shortcut icon" href="{{layout.favicon}}"> {#- -#}
{%- else -%}