fix: clean up some problems from the implementations
This commit is contained in:
@@ -915,7 +915,9 @@ fn terminate_child(child: &mut std::process::Child) {
|
||||
let _ = child.kill();
|
||||
}
|
||||
|
||||
fn prepend_tool_paths(_command: &mut Command) {
|
||||
fn prepend_tool_paths(command: &mut Command) {
|
||||
#[cfg(not(target_os = "macos"))]
|
||||
let _ = command;
|
||||
#[cfg(target_os = "macos")]
|
||||
{
|
||||
let mut paths = vec![
|
||||
|
||||
@@ -674,6 +674,12 @@ fn build_language_routes(
|
||||
|
||||
for (category, records) in category_posts {
|
||||
let slug = slugify(&category);
|
||||
let display_name = category_settings
|
||||
.get(&category)
|
||||
.and_then(|settings| settings.title.as_deref())
|
||||
.map(str::trim)
|
||||
.filter(|title| !title.is_empty())
|
||||
.unwrap_or(&category);
|
||||
routes.extend(paginated_route_specs(
|
||||
&records,
|
||||
per_page,
|
||||
@@ -682,7 +688,7 @@ fn build_language_routes(
|
||||
language_root_prefix(language, metadata)
|
||||
),
|
||||
page_title.clone(),
|
||||
Some(json!({"kind": "category", "name": category})),
|
||||
Some(json!({"kind": "category", "name": display_name})),
|
||||
category_settings
|
||||
.get(&category)
|
||||
.and_then(|settings| settings.list_template_slug.clone()),
|
||||
|
||||
@@ -609,7 +609,7 @@ fn generation_respects_category_list_settings_and_writes_bundled_images() {
|
||||
db.conn(),
|
||||
&make_list_template(
|
||||
"featured-list",
|
||||
"FEATURED:{% for day_block in day_blocks %}{% for post in day_block.posts %}[{{ post.title }}|{{ post.show_title }}]{% endfor %}{% endfor %}",
|
||||
"FEATURED:{% if archive_context %}{% if archive_context.kind == 'category' %}{{ archive_context.name }}{% endif %}{% endif %}:{% for day_block in day_blocks %}{% for post in day_block.posts %}[{{ post.title }}|{{ post.show_title }}]{% endfor %}{% endfor %}",
|
||||
),
|
||||
)
|
||||
.unwrap();
|
||||
@@ -629,7 +629,7 @@ fn generation_respects_category_list_settings_and_writes_bundled_images() {
|
||||
(
|
||||
"featured".to_string(),
|
||||
CategorySettings {
|
||||
title: None,
|
||||
title: Some("Featured Archive".to_string()),
|
||||
render_in_lists: true,
|
||||
show_title: false,
|
||||
post_template_slug: None,
|
||||
@@ -692,7 +692,7 @@ fn generation_respects_category_list_settings_and_writes_bundled_images() {
|
||||
|
||||
let featured_html =
|
||||
std::fs::read_to_string(dir.path().join("category/featured/index.html")).unwrap();
|
||||
assert!(featured_html.contains("FEATURED:[Featured Post|false]"));
|
||||
assert!(featured_html.contains("FEATURED:Featured Archive:[Featured Post|false]"));
|
||||
|
||||
let rss = std::fs::read_to_string(dir.path().join("rss.xml")).unwrap();
|
||||
assert!(rss.contains("hidden-post"));
|
||||
|
||||
Reference in New Issue
Block a user