Fix bug with heading link & styles.
This commit is contained in:
parent
ce34180296
commit
2063037bb2
@ -14,6 +14,7 @@ pub struct Config {
|
||||
pub extension: String,
|
||||
pub headings: Headings,
|
||||
pub links_classes: String,
|
||||
pub file_tree_title_classes: String,
|
||||
}
|
||||
|
||||
pub struct Headings {
|
||||
@ -141,6 +142,11 @@ pub fn parse(yaml_str: &String) -> Result<Config, String> {
|
||||
_ => String::from(""),
|
||||
};
|
||||
|
||||
let file_tree_title_classes = match config_yaml.get(ystr!("file_tree_title_classes")) {
|
||||
Some(Yaml::String(input)) => input.clone(),
|
||||
_ => String::from(""),
|
||||
};
|
||||
|
||||
|
||||
Ok(Config {
|
||||
input: input_folder.clone(),
|
||||
@ -149,6 +155,7 @@ pub fn parse(yaml_str: &String) -> Result<Config, String> {
|
||||
extension: file_extension,
|
||||
headings: headings_yaml,
|
||||
links_classes: link_classes,
|
||||
file_tree_title_classes,
|
||||
})
|
||||
}
|
||||
|
||||
|
@ -28,7 +28,7 @@ impl Printable for Heading {
|
||||
|
||||
format!(
|
||||
"<h{} id=\"{}\" class=\"heading-linked {}\"><a href=\"#{}\">{}</a></h{}>",
|
||||
self.depth, extra_classes, html_fragment_text, html_fragment_text, text, self.depth
|
||||
self.depth, html_fragment_text, extra_classes, html_fragment_text, text, self.depth
|
||||
)
|
||||
} else {
|
||||
format!("<h{}>{}</h{}>", self.depth, text, self.depth)
|
||||
|
@ -122,9 +122,10 @@ pub fn generate_pages_html(file_tree: &Node, current_path: &Path, config: &Confi
|
||||
} else {
|
||||
format!(
|
||||
"<li class=\"my-1\">
|
||||
<div class=\"uppercase opacity-80 mt-6 font-semibold\">{}</div>
|
||||
<div class=\"opacity-80 mt-6 {}\">{}</div>
|
||||
<ul>{}</ul>
|
||||
</li>",
|
||||
&config.file_tree_title_classes,
|
||||
folder.name,
|
||||
sub_nodes_html.join("")
|
||||
)
|
||||
|
Loading…
Reference in New Issue
Block a user