mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-04-02 09:35:28 +00:00
set filename as title for image mime types
This commit is contained in:
parent
6cbcfb07d9
commit
58fba8d8f4
1 changed files with 6 additions and 1 deletions
|
|
@ -575,7 +575,12 @@ impl Page {
|
||||||
Ok(buffer) => {
|
Ok(buffer) => {
|
||||||
// Update page meta
|
// Update page meta
|
||||||
meta.borrow_mut().status = Some(Status::Success);
|
meta.borrow_mut().status = Some(Status::Success);
|
||||||
meta.borrow_mut().title = Some(gformat!("Image"));
|
meta.borrow_mut().title = Some(
|
||||||
|
match url.split('/').last() {
|
||||||
|
Some(filename) => gformat!("{filename}"),
|
||||||
|
None => gformat!("Image")
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
// Update page content
|
// Update page content
|
||||||
content.set_image(&buffer);
|
content.set_image(&buffer);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue