Skip to content

Commit

Permalink
fix: kurage correct page name
Browse files Browse the repository at this point in the history
  • Loading branch information
madonuko committed Feb 3, 2025
1 parent 6bf4335 commit bf2b757
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions src/prelude.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,17 @@ kurage::generate_generator! { page => [<$name Page>]
}

macro_rules! pagename {
() => {
&std::path::Path::new(file!())
() => {{
let s = std::path::Path::new(file!())
.file_name()
.and_then(|s| s.to_str())
.unwrap()
.to_ascii_uppercase()
};
.unwrap();
&format!(
"{}{}",
s.chars().nth(0).unwrap().to_ascii_uppercase(),
&s[1..s.len() - 3]
)
}};
}

// pub(crate) use kurage_generated_macros::kurage_page_pre;
Expand Down

0 comments on commit bf2b757

Please sign in to comment.