Skip to content

Commit 3c250ff

Browse files
comply with all askama warnings
1 parent c3d682c commit 3c250ff

3 files changed

Lines changed: 7 additions & 7 deletions

File tree

src/main.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ static ALLOW_CORS_NAME: HeaderName = HeaderName::from_static("access-control-all
240240
static ALLOW_CORS_VALUE: HeaderValue = HeaderValue::from_static("*");
241241

242242
#[derive(Template)]
243-
#[template(path = "index.hbs", escape = "html")]
243+
#[template(path = "index.hbs", escape = "html", blocks = ["description"])]
244244
pub struct RootTemplate {
245245
svc_status: ServicesResponse,
246246
root_url: Arc<str>,
@@ -264,7 +264,7 @@ async fn root(
264264
}
265265

266266
#[derive(Template)]
267-
#[template(path = "api.hbs", escape = "html")]
267+
#[template(path = "api.hbs", escape = "html", blocks = ["description"])]
268268
pub struct ApiTemplate {
269269
bd: Arc<BustDir>,
270270
root_url: Arc<str>,
@@ -300,7 +300,7 @@ async fn ping_redirect(
300300
}
301301

302302
#[derive(Template)]
303-
#[template(path = "ping-page.hbs", escape = "html")]
303+
#[template(path = "ping-page.hbs", escape = "html", blocks = ["description"])]
304304
pub struct PingPageTemplate {
305305
svc_status: ServicesResponse,
306306
root_url: Arc<str>,
@@ -344,7 +344,7 @@ async fn ping_generic(
344344
}
345345

346346
#[derive(Template)]
347-
#[template(path = "ping-frame.hbs", escape = "html")]
347+
#[template(path = "ping-frame.hbs", escape = "html", blocks = ["description"])]
348348
pub struct PingFrameTemplate {
349349
ping: MCPingResponse,
350350
bd: Arc<BustDir>,
@@ -524,7 +524,7 @@ pub struct ErrorSerialization {
524524
}
525525

526526
#[derive(Template)]
527-
#[template(path = "error.hbs", escape = "html")]
527+
#[template(path = "error.hbs", escape = "html", blocks = ["description"])]
528528
pub struct ErrorTemplate {
529529
error: String,
530530
bd: Arc<BustDir>,

templates/base.hbs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
property="og:description"
2626
content="{% block description %}{% endblock %}"
2727
/>
28-
<meta name="description" content="{% block description %}{% endblock %}" />
28+
<meta name="description" content="{{ as_description() }}" />
2929
<title>Minecraft Server Tester - mcping</title>
3030
</head>
3131

templates/ping-element.hbs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{% let icon %}
1+
{% create icon %}
22
{% match ping.icon %}
33
{% when Some with (raw_icon) %}
44
{% let icon = "{}/internal/icon/{}/{}/icon.png"|format(root_url, edition, hostname) %}

0 commit comments

Comments
 (0)