Add aggregation opengraph tags
This commit is contained in:
parent
35853612c3
commit
5aa9f2ed42
2
Cargo.lock
generated
2
Cargo.lock
generated
|
@ -1334,7 +1334,7 @@ checksum = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "pict-rs-aggregator"
|
name = "pict-rs-aggregator"
|
||||||
version = "0.1.0"
|
version = "0.1.1"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"actix-web",
|
"actix-web",
|
||||||
"anyhow",
|
"anyhow",
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
[package]
|
[package]
|
||||||
name = "pict-rs-aggregator"
|
name = "pict-rs-aggregator"
|
||||||
version = "0.1.0"
|
version = "0.1.1"
|
||||||
authors = ["asonix <asonix@asonix.dog>"]
|
authors = ["asonix <asonix@asonix.dog>"]
|
||||||
edition = "2018"
|
edition = "2018"
|
||||||
build = "src/build.rs"
|
build = "src/build.rs"
|
||||||
|
|
|
@ -448,7 +448,13 @@ async fn view_aggregation(
|
||||||
|
|
||||||
let mut cursor = Cursor::new(vec![]);
|
let mut cursor = Cursor::new(vec![]);
|
||||||
|
|
||||||
self::templates::view_aggregation(&mut cursor, &aggregation, &entries, &state)?;
|
self::templates::view_aggregation(
|
||||||
|
&mut cursor,
|
||||||
|
path.aggregation,
|
||||||
|
&aggregation,
|
||||||
|
&entries,
|
||||||
|
&state,
|
||||||
|
)?;
|
||||||
|
|
||||||
Ok(HttpResponse::Ok()
|
Ok(HttpResponse::Ok()
|
||||||
.content_type(mime::TEXT_HTML.essence_str())
|
.content_type(mime::TEXT_HTML.essence_str())
|
||||||
|
|
|
@ -2,9 +2,14 @@
|
||||||
@use super::{layout, image_preview};
|
@use super::{layout, image_preview};
|
||||||
@use uuid::Uuid;
|
@use uuid::Uuid;
|
||||||
|
|
||||||
@(aggregation: &Aggregation, entries: &[(Uuid, Entry)], state: &State)
|
@(id: Uuid, aggregation: &Aggregation, entries: &[(Uuid, Entry)], state: &State)
|
||||||
|
|
||||||
@:layout(state, "Aggregation", None, {}, {
|
@:layout(state, &aggregation.title, Some(&aggregation.description), {
|
||||||
|
<meta property="og:url" content="@state.public_aggregation_path(id)" />
|
||||||
|
@for (_, entry) in entries {
|
||||||
|
<meta property="og:image" content="@state.image_path(entry)" />
|
||||||
|
}
|
||||||
|
}, {
|
||||||
<section>
|
<section>
|
||||||
<article>
|
<article>
|
||||||
<div class="content-group">
|
<div class="content-group">
|
||||||
|
|
Loading…
Reference in a new issue