Skip to content

Commit

Permalink
modify formatting of table of contents
Browse files Browse the repository at this point in the history
Signed-off-by: Ryan Brue <[email protected]>
  • Loading branch information
ryanabx committed Sep 5, 2024
1 parent bb64330 commit 68e1d60
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ authors = ["Ryan Brue <[email protected]>"]
repository = "https://github.com/ryanabx/simple-ssg"
license = "MIT"
readme = "README.md"
version = "3.0.1"
version = "3.0.2"
edition = "2021"
description = "Plain and simple static site generator for Djot and Markdown light markup languages"

Expand Down
6 changes: 3 additions & 3 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ fn generate_table_of_contents(
prev_depth = *depth;
if *depth > 0 {
table_of_contents_html.push_str(&format!(
"<li>{}</li><ul>",
"<li><b><u>{}:</u></b></li><ul>",
&relative_path.to_string_lossy(),
));
}
Expand All @@ -361,7 +361,7 @@ fn generate_table_of_contents(
prev_depth = *depth;
if relative_path == my_result {
table_of_contents_html
.push_str(&format!("<li>{}</li>", &relative_path.to_string_lossy()))
.push_str(&format!("<li><b>{}</b></li>", &relative_path.to_string_lossy()))
} else {
table_of_contents_html.push_str(&format!(
"<li><a href=\"{}{}{}\">{}</a></li>",
Expand All @@ -370,7 +370,7 @@ fn generate_table_of_contents(
} else {
"".to_string()
},
&web_prefix.unwrap_or("./"),
&web_prefix.unwrap_or(""), // "./" if "" doesn't work
&relative_path.to_string_lossy(),
&relative_path.to_string_lossy()
))
Expand Down

0 comments on commit 68e1d60

Please sign in to comment.