Improve opengraph tags
Some checks reported errors
continuous-integration/drone/push Build was killed
continuous-integration/drone/tag Build is passing

This commit is contained in:
asonix 2022-06-06 16:42:07 -05:00
parent aa86d972e2
commit f823369f30
4 changed files with 75 additions and 59 deletions

72
Cargo.lock generated
View file

@ -16,7 +16,7 @@ dependencies = [
"memchr",
"pin-project-lite",
"tokio",
"tokio-util 0.7.2",
"tokio-util 0.7.3",
]
[[package]]
@ -131,7 +131,7 @@ dependencies = [
"http",
"log",
"pin-project-lite",
"tokio-util 0.7.2",
"tokio-util 0.7.3",
]
[[package]]
@ -245,9 +245,9 @@ dependencies = [
[[package]]
name = "async-trait"
version = "0.1.53"
version = "0.1.56"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ed6aa3524a2dfcf9fe180c51eae2b58738348d819517ceadf95789c51fff7600"
checksum = "96cf8829f67d2eab0b2dfa42c5d0ef737e0724e4a82b01b3e292456202b19716"
dependencies = [
"proc-macro2",
"quote",
@ -392,15 +392,15 @@ dependencies = [
[[package]]
name = "bumpalo"
version = "3.9.1"
version = "3.10.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a4a45a46ab1f2412e53d3a0ade76ffad2025804294569aae387231a0cd6e0899"
checksum = "37ccbd214614c6783386c1af30caf03192f17891059cecc394b4fb119e363de3"
[[package]]
name = "bytecount"
version = "0.6.2"
version = "0.6.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "72feb31ffc86498dacdbd0fcebb56138e7177a8cc5cea4516031d15ae85a742e"
checksum = "2c676a478f63e9fa2dd5368a42f28bba0d6c560b775f38583c8bbaa7fcd67c9c"
[[package]]
name = "byteorder"
@ -813,7 +813,7 @@ dependencies = [
"indexmap",
"slab",
"tokio",
"tokio-util 0.7.2",
"tokio-util 0.7.3",
"tracing",
]
@ -955,9 +955,9 @@ dependencies = [
[[package]]
name = "indexmap"
version = "1.7.0"
version = "1.8.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bc633605454125dec4b66843673f01c7df2b89479b32e0ed634e43a91cff62a5"
checksum = "e6012d540c5baa3589337a98ce73408de9b5a25ec9fc2c6fd6be8f0d39e0ca5a"
dependencies = [
"autocfg",
"hashbrown",
@ -1136,9 +1136,9 @@ checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a"
[[package]]
name = "miniz_oxide"
version = "0.5.1"
version = "0.5.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d2b29bd4bc3f33391105ebee3589c19197c4271e3e5a9ec9bfe8127eeff8f082"
checksum = "6f5c75688da582b8ffc1f1799e9db273f32133c49e048f614d22ec3256773ccc"
dependencies = [
"adler",
]
@ -1306,9 +1306,9 @@ dependencies = [
[[package]]
name = "parking_lot"
version = "0.12.0"
version = "0.12.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "87f5ec2493a61ac0506c0f4199f99070cbe83857b0337006a30f3e6719b8ef58"
checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f"
dependencies = [
"lock_api",
"parking_lot_core 0.9.3",
@ -1355,9 +1355,9 @@ checksum = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e"
[[package]]
name = "petgraph"
version = "0.6.1"
version = "0.6.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "51b305cc4569dd4e8765bab46261f67ef5d4d11a4b6e745100ee5dad8948b46c"
checksum = "e6d5014253a1331579ce62aa67443b4a658c5e7dd03d4bc6d302b94474888143"
dependencies = [
"fixedbitset",
"indexmap",
@ -1365,7 +1365,7 @@ dependencies = [
[[package]]
name = "pict-rs-aggregator"
version = "0.2.0-alpha.1"
version = "0.2.0-alpha.2"
dependencies = [
"actix-rt",
"actix-web",
@ -1394,7 +1394,7 @@ dependencies = [
"tracing-opentelemetry",
"tracing-subscriber",
"url",
"uuid 1.1.0",
"uuid 1.1.1",
]
[[package]]
@ -1820,9 +1820,9 @@ checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623"
[[package]]
name = "syn"
version = "1.0.95"
version = "1.0.96"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fbaf6116ab8924f39d52792136fb74fd60a80194cf1b1c6ffa6453eef1c3f942"
checksum = "0748dd251e24453cb8717f0354206b91557e4ec8703673a4b30208f2abaf1ebf"
dependencies = [
"proc-macro2",
"quote",
@ -1921,9 +1921,9 @@ checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c"
[[package]]
name = "tokio"
version = "1.18.2"
version = "1.19.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4903bf0427cf68dddd5aa6a93220756f8be0c34fcfa9f5e6191e103e15a31395"
checksum = "c51a52ed6686dd62c320f9b89299e9dfb46f730c7a48e635c19f21d116cb1439"
dependencies = [
"bytes",
"libc",
@ -1931,7 +1931,7 @@ dependencies = [
"mio",
"num_cpus",
"once_cell",
"parking_lot 0.12.0",
"parking_lot 0.12.1",
"pin-project-lite",
"signal-hook-registry",
"socket2",
@ -1952,9 +1952,9 @@ dependencies = [
[[package]]
name = "tokio-macros"
version = "1.7.0"
version = "1.8.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b557f72f448c511a979e2564e55d74e6c4432fc96ff4f6241bc6bded342643b7"
checksum = "9724f9a975fb987ef7a3cd9be0350edcbe130698af5b8f7a631e23d42d052484"
dependencies = [
"proc-macro2",
"quote",
@ -1963,9 +1963,9 @@ dependencies = [
[[package]]
name = "tokio-stream"
version = "0.1.8"
version = "0.1.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "50145484efff8818b5ccd256697f36863f587da82cf8b409c53adf1e840798e3"
checksum = "df54d54117d6fdc4e4fea40fe1e4e566b3505700e148a6827e59b34b0d2600d9"
dependencies = [
"futures-core",
"pin-project-lite",
@ -1988,9 +1988,9 @@ dependencies = [
[[package]]
name = "tokio-util"
version = "0.7.2"
version = "0.7.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f988a1a1adc2fb21f9c12aa96441da33a1728193ae0b95d2be22dbd17fcb4e5c"
checksum = "cc463cd8deddc3770d20f9852143d50bf6094e640b485cb2e189a2099085ff45"
dependencies = [
"bytes",
"futures-core",
@ -2055,7 +2055,7 @@ dependencies = [
"prost-derive 0.10.1",
"tokio",
"tokio-stream",
"tokio-util 0.7.2",
"tokio-util 0.7.3",
"tower",
"tower-layer",
"tower-service",
@ -2089,7 +2089,7 @@ dependencies = [
"rand",
"slab",
"tokio",
"tokio-util 0.7.2",
"tokio-util 0.7.3",
"tower-layer",
"tower-service",
"tracing",
@ -2097,9 +2097,9 @@ dependencies = [
[[package]]
name = "tower-http"
version = "0.3.3"
version = "0.3.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7d342c6d58709c0a6d48d48dabbb62d4ef955cf5f0f3bbfd845838e7ae88dbae"
checksum = "3c530c8675c1dbf98facee631536fa116b5fb6382d7dd6dc1b118d970eafe3ba"
dependencies = [
"bitflags",
"bytes",
@ -2317,9 +2317,9 @@ dependencies = [
[[package]]
name = "uuid"
version = "1.1.0"
version = "1.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "93bbc61e655a4833cf400d0d15bf3649313422fa7572886ad6dab16d79886365"
checksum = "c6d5d669b51467dcf7b2f1a796ce0f955f05f01cafda6c19d6e95f730df29238"
dependencies = [
"getrandom",
"serde",

View file

@ -1,7 +1,7 @@
[package]
name = "pict-rs-aggregator"
description = "A simple image aggregation service for pict-rs"
version = "0.2.0-alpha.1"
version = "0.2.0-alpha.2"
authors = ["asonix <asonix@asonix.dog>"]
license = "AGPL-3.0"
readme = "README.md"

View file

@ -3,26 +3,36 @@
@(state: &State, title: &str, description: Option<&str>, head: Content, body: Content)
<!DOCTYPE html>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>@title</title>
<link rel="stylesheet" href="@state.statics_path(layout_css.name)" type="text/css" />
<meta property="og:title" content="@title" />
@if let Some(description) = description {
<meta property="og:description" content="@description" />
} else {
<meta property="og:description" content="Collect and share images" />
}
<meta property="og:type" content="website" />
<link rel="shortcut icon" type="image/png" href="@state.statics_path(favicon_ico.name)">
@:head()
</head>
<body>
<div class="title"><h1>pict-rs aggregator</h1></div>
@:body()
</body>
</html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>@title</title>
<meta property="og:title" content="@title" />
@if let Some(description) = description {
<meta property="description" content="@description" />
<meta property="og:description" content="@description" />
<meta property="twitter:description" content="@description" />
} else {
<meta property="description" content="Collect and share images" />
<meta property="og:description" content="Collect and share images" />
<meta property="twitter:description" content="Collect and share images" />
}
<meta property="og:type" content="website" />
<link rel="stylesheet" href="@state.statics_path(layout_css.name)" type="text/css" />
<link rel="shortcut icon" type="image/png" href="@state.statics_path(favicon_ico.name)">
@:head()
</head>
<body>
<div class="title">
<h1>pict-rs aggregator</h1>
</div>
@:body()
</body>
</html>

View file

@ -5,10 +5,16 @@
@(id: Uuid, collection: &Collection, entries: &[(Uuid, Entry)], state: &State)
@:layout(state, &collection.title, Some(&collection.description), {
<meta property="twitter:card" content="summary_large_image" />
<meta property="twitter:url" content="@state.public_collection_path(id)" />
<meta property="og:url" content="@state.public_collection_path(id)" />
@for (_, entry) in entries {
@if let Some(filename) = entry.filename() {
<meta property="og:image" content="@state.image_path(filename)" />
<meta property="og:image:secure_url" content="@state.image_path(filename)" />
<meta property="og:image:alt" content="Image: @filename" />
<meta property="twitter:image" content="@state.image_path(filename)" />
<meta property="twitter:image:alt" content="Image: @filename" />
}
}
}, {