Skip to content

Commit e05446f

Browse files
chore(release): bump versions and changelogs
* chore(release): bump versions and changelogs * fix: remove unwanted changes --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Princesseuh <3019731+Princesseuh@users.noreply.github.com>
1 parent 398e2ca commit e05446f

11 files changed

Lines changed: 110 additions & 109 deletions

File tree

.sampo/changesets/cantankerous-wavetamer-akka.md

Lines changed: 0 additions & 7 deletions
This file was deleted.

.sampo/changesets/jovial-forgemaster-hiisi.md

Lines changed: 0 additions & 7 deletions
This file was deleted.

.sampo/changesets/resolute-thunderbearer-kullervo.md

Lines changed: 0 additions & 51 deletions
This file was deleted.

.sampo/changesets/stalwart-lord-tursas.md

Lines changed: 0 additions & 34 deletions
This file was deleted.

Cargo.lock

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/maudit-cli/CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# maudit-cli
2+
3+
## 0.4.1
4+
5+
### Patch changes
6+
7+
- [52eda9e](https://github.com/bruits/maudit/commit/52eda9ea4eac8efd3efd945d00f39a1b99f284ab) Improve performance — Thanks @Princesseuh!
8+

crates/maudit-cli/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "maudit-cli"
33
description = "CLI to operate on maudit projects."
4-
version = "0.4.0"
4+
version = "0.4.1"
55
license = "MIT"
66
edition = "2021"
77

@@ -38,4 +38,4 @@ tar = "0.4.43"
3838
toml_edit = "0.22.23"
3939
local-ip-address = "0.6.3"
4040
flate2 = "1.0.35"
41-
quanta = "0.12.6"
41+
quanta = "0.12.6"

crates/maudit-macros/CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# maudit-macros
2+
3+
## 0.4.0
4+
5+
### Minor changes
6+
7+
- [52eda9e](https://github.com/bruits/maudit/commit/52eda9ea4eac8efd3efd945d00f39a1b99f284ab) Update generated code to support returning properties in dynamic routes. — Thanks @Princesseuh!
8+

crates/maudit-macros/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22
name = "maudit-macros"
33
description = "Procedural macros for the maudit crate"
44
license = "MIT"
5-
version = "0.3.0"
5+
version = "0.4.0"
66
edition = "2021"
77

88
[lib]
99
proc-macro = true
1010

1111
[dependencies]
1212
syn = { version = "2.0", features = ["full"] }
13-
quote = "1.0"
13+
quote = "1.0"

crates/maudit/CHANGELOG.md

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
# maudit
2+
3+
## 0.4.0
4+
5+
### Minor changes
6+
7+
- [52eda9e](https://github.com/bruits/maudit/commit/52eda9ea4eac8efd3efd945d00f39a1b99f284ab) Adds support for image processing. Maudit can now resize and convert images during the build process.
8+
9+
To process an image, add it using `ctx.assets.add_image_with_options` in your page's `render` method, specifying the desired transformations.
10+
11+
```rs
12+
use maudit::page::prelude::*;
13+
14+
#[route("/image")]
15+
pub struct ImagePage;
16+
17+
impl Page for ImagePage {
18+
fn render(&self, ctx: &mut RouteContext) -> RenderResult {
19+
let image = ctx.assets.add_image_with_options(
20+
"path/to/image.jpg",
21+
ImageOptions {
22+
width: Some(800),
23+
height: None,
24+
format: Some(ImageFormat::Png),
25+
quality: Some(80),
26+
},
27+
)?;
28+
29+
format!("<img src=\"{}\" alt=\"Processed Image\" />", image.url).into()
30+
}
31+
}
32+
```
33+
34+
See the [Assets documentation](https://maudit.org/docs/assets/) for more details. — Thanks @Princesseuh!
35+
- [52eda9e](https://github.com/bruits/maudit/commit/52eda9ea4eac8efd3efd945d00f39a1b99f284ab) Adds support for dynamic routes with properties. In addition to its parameters, a dynamic route can now provide additional properties that can be used during rendering.
36+
37+
```rs
38+
use maudit::page::prelude::*;
39+
40+
#[route("/posts/[slug]")]
41+
pub struct Post;
42+
43+
#[derive(Params, Clone)]
44+
pub struct Params {
45+
pub slug: String,
46+
}
47+
48+
#[derive(Clone)]
49+
pub struct Props {
50+
pub title: String,
51+
pub content: String,
52+
}
53+
54+
impl Page<Params, Props> for Post {
55+
fn render(&self, ctx: &mut RouteContext) -> RenderResult {
56+
let params = ctx.params::<Params>();
57+
let props = ctx.props::<Props>();
58+
59+
format!(
60+
"<h1>{}</h1><p>{}</p><small>Slug: {}</small>",
61+
props.title, props.content, params.slug
62+
).into()
63+
}
64+
65+
fn routes(&self, ctx: &mut DynamicRouteContext) -> Routes<Params, Props> {
66+
vec![Route::from_params_and_props(
67+
Params {
68+
slug: "hello-world".to_string(),
69+
},
70+
Props {
71+
title: "Hello World".to_string(),
72+
content: "This is my first post.".to_string(),
73+
},
74+
)]
75+
}
76+
}
77+
```
78+
79+
For more information on dynamic routes, see the [Routing documentation](https://maudit.org/docs/routing/#dynamic-routes). — Thanks @Princesseuh!
80+
81+
### Patch changes
82+
83+
- Updated dependencies: maudit-macros@0.4.0
84+

0 commit comments

Comments
 (0)