fix(web): add social preview image assets
This commit is contained in:
1 parent
83218ba602
commit
667503c8f6
5 files changed
+91
No files matched your search
@@ -39,6 +39,9 @@ services:
|
||||
- type: bind
|
||||
source: /DATA/AppData/bzod/www
|
||||
target: /app/www
|
||||
- type: bind
|
||||
source: /DATA/AppData/bzod/images
|
||||
target: /app/images
|
||||
devices: []
|
||||
cap_add: []
|
||||
networks:
|
||||
|
||||
@@ -181,3 +181,51 @@ pub async fn deploy_script() -> Response {
|
||||
Err(_) => (StatusCode::NOT_FOUND, "deploy.sh not found").into_response(),
|
||||
}
|
||||
}
|
||||
|
||||
pub async fn social_preview() -> Response {
|
||||
let mut target_path = std::path::PathBuf::from("www/images/preview.png");
|
||||
|
||||
if !target_path.exists() {
|
||||
if let Ok(exe_path) = std::env::current_exe() {
|
||||
if let Some(exe_dir) = exe_path.parent() {
|
||||
let path1 = exe_dir.join("www/images/preview.png");
|
||||
if path1.exists() {
|
||||
target_path = path1;
|
||||
} else if let Some(parent1) = exe_dir.parent() {
|
||||
let path2 = parent1.join("www/images/preview.png");
|
||||
if path2.exists() {
|
||||
target_path = path2;
|
||||
} else if let Some(parent2) = parent1.parent() {
|
||||
let path3 = parent2.join("www/images/preview.png");
|
||||
if path3.exists() {
|
||||
target_path = path3;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if !target_path.exists() {
|
||||
if let Ok(manifest_dir) = std::env::var("CARGO_MANIFEST_DIR") {
|
||||
let path = std::path::PathBuf::from(manifest_dir).join("www/images/preview.png");
|
||||
if path.exists() {
|
||||
target_path = path;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
match tokio::fs::read(target_path).await {
|
||||
Ok(content) => (
|
||||
StatusCode::OK,
|
||||
[
|
||||
("content-type", "image/png"),
|
||||
("cache-control", "public, max-age=86400"),
|
||||
],
|
||||
content,
|
||||
)
|
||||
.into_response(),
|
||||
|
||||
Err(_) => (StatusCode::NOT_FOUND, "preview.png not found").into_response(),
|
||||
}
|
||||
}
|
||||
@@ -95,6 +95,7 @@ pub fn create_router(state: AppState) -> Router {
|
||||
.route("/admin/pages/delete/:id", post(admin::pages_delete))
|
||||
.route("/admin/analytics/url/:id", get(admin::url_analytics_get))
|
||||
.route("/deploy.sh", get(pages::deploy_script))
|
||||
.route("/images/preview.png", get(pages::social_preview))
|
||||
.route(
|
||||
"/admin/analytics/url/:id/export/csv",
|
||||
get(admin::url_analytics_csv_export),
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 476 KiB |
@@ -4,6 +4,45 @@
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<meta name="description" content="BZOD ? Self-hosted Multi-User URL Management Platform written in Rust with landing pages, QR codes, analytics, audit logging, and SQLite backend.">
|
||||
<!-- Primary SEO -->
|
||||
<meta name="title" content="BZOD | Self-Hosted Multi-User URL Management Platform">
|
||||
<meta name="description" content="BZOD is a self-hosted URL management platform written in Rust featuring URL shortening, landing pages, QR codes, analytics, audit logging, multi-user support, and SQLite backend.">
|
||||
|
||||
<meta name="keywords" content="BZOD,Rust,URL Shortener,Self Hosted,Analytics,QR Code,SQLite,Axum,FOSS,Open Source">
|
||||
<meta name="author" content="Sunil Thakare">
|
||||
<meta name="robots" content="index,follow,max-image-preview:large">
|
||||
<meta name="theme-color" content="#0b0f14">
|
||||
|
||||
<link rel="canonical" href="https://bzo.in/">
|
||||
|
||||
<!-- Open Graph -->
|
||||
<meta property="og:site_name" content="BZOD">
|
||||
<meta property="og:type" content="website">
|
||||
<meta property="og:title" content="BZOD | Self-Hosted Multi-User URL Management Platform">
|
||||
<meta property="og:description" content="Modern Rust-powered URL management with landing pages, QR codes, analytics, audit logging, tenant isolation, and SQLite.">
|
||||
<meta property="og:url" content="https://bzo.in/">
|
||||
<meta property="og:image" content="https://bzo.in/images/social-preview.png">
|
||||
<meta property="og:image:width" content="1200">
|
||||
<meta property="og:image:height" content="630">
|
||||
<meta property="og:image:alt" content="BZOD Self-Hosted URL Management Platform">
|
||||
|
||||
<!-- Optional if this is the home page -->
|
||||
<meta property="article:author" content="Sunil Thakare">
|
||||
|
||||
<!-- Twitter / X -->
|
||||
<meta name="twitter:card" content="summary_large_image">
|
||||
<meta name="twitter:title" content="BZOD | Self-Hosted Multi-User URL Management Platform">
|
||||
<meta name="twitter:description" content="Enterprise-grade self-hosted URL management written in Rust with analytics, landing pages, QR codes, audit logging, and SQLite.">
|
||||
<meta name="twitter:image" content="https://bzo.in/images/preview.png">
|
||||
<meta name="twitter:site" content="@thakares">
|
||||
<meta name="twitter:creator" content="@thakares">
|
||||
|
||||
<!-- Application -->
|
||||
<meta name="application-name" content="BZOD">
|
||||
<meta name="apple-mobile-web-app-title" content="BZOD">
|
||||
<meta name="apple-mobile-web-app-capable" content="yes">
|
||||
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
|
||||
|
||||
<title>BZOD | Self-Hosted URL Management in Rust</title>
|
||||
<link rel="preconnect" href="https://fonts.googleapis.com">
|
||||
<link href="https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@300;400;500;600&family=Inter:wght@300;400;500;600;700&display=swap" rel="stylesheet">
|
||||
|
||||
Reference in new issue
Block a user