* Better opengraph meta tagging
This commit is contained in:
parent
57181ee75e
commit
baedfc72ea
@ -64,7 +64,6 @@ fn map_base_vfile(category: &PathBuf, base: &PathBuf) -> String {
|
|||||||
let file = dir.read_dir().ok().unwrap().find(|item| {
|
let file = dir.read_dir().ok().unwrap().find(|item| {
|
||||||
if let Ok(item) = item {
|
if let Ok(item) = item {
|
||||||
let name = item.file_name().into_string().unwrap();
|
let name = item.file_name().into_string().unwrap();
|
||||||
println!("Checking name {:?}", name);
|
|
||||||
name.starts_with(basename.as_ref())
|
name.starts_with(basename.as_ref())
|
||||||
} else {
|
} else {
|
||||||
false
|
false
|
||||||
@ -95,13 +94,17 @@ pub fn video(cat: PathBuf, file_base: PathBuf) -> Template {
|
|||||||
|
|
||||||
let url = format!("/clip/{}/{}", &cat, &file);
|
let url = format!("/clip/{}/{}", &cat, &file);
|
||||||
h.insert("url", &url);
|
h.insert("url", &url);
|
||||||
h.insert("desc", &file_pretty);
|
h.insert("desc", &SITEDESC);
|
||||||
|
|
||||||
let thumbnail = format!("/thumbnail/{}/{}", cat, file);
|
let thumbnail = format!("/thumbnail/{}/{}", cat, file);
|
||||||
h.insert("ogimg", &thumbnail);
|
h.insert("ogimg", &thumbnail);
|
||||||
|
|
||||||
let clip_url = format!("/video/{}/{}", &cat, &file);
|
let clip_url = format!("/video/{}/{}", &cat, &file);
|
||||||
h.insert("clip_url", &clip_url);
|
h.insert("clip_url", &clip_url);
|
||||||
|
|
||||||
|
let clip_thumbnail = format!("/thumbnail/{}/{}.jpg", &cat, &file);
|
||||||
|
h.insert("clip_thumbnail", &clip_thumbnail);
|
||||||
|
|
||||||
return Template::render("video", &h);
|
return Template::render("video", &h);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3" crossorigin="anonymous">
|
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3" crossorigin="anonymous">
|
||||||
<link rel="stylesheet" type="text/css" href="/static/css/style.css">
|
<link rel="stylesheet" type="text/css" href="/static/css/style.css">
|
||||||
<title>Shockrah's Clips</title>
|
<title>{{title}}</title>
|
||||||
<link rel="shortcut icon" type="image/png" href="/static/favicon.png"/>
|
<link rel="shortcut icon" type="image/png" href="/static/favicon.png"/>
|
||||||
<meta property="og:title" content="{{title}}">
|
<meta property="og:title" content="{{title}}">
|
||||||
<meta property="og:site_name" content="Clippable">
|
<meta property="og:site_name" content="Clippable">
|
||||||
@ -13,7 +13,7 @@
|
|||||||
<meta property="og:description" content="{{desc}}">
|
<meta property="og:description" content="{{desc}}">
|
||||||
<meta property="og:type" content="website">
|
<meta property="og:type" content="website">
|
||||||
{# Image tag requires a default in case of disk memery #}
|
{# Image tag requires a default in case of disk memery #}
|
||||||
<meta property="og:image" content="/static/favicon.png">
|
<meta property="og:image" content="{{clip_thumbnail}}">
|
||||||
{% if script %}
|
{% if script %}
|
||||||
<script src="/static/js/{{script_src}}"></script>
|
<script src="/static/js/{{script_src}}"></script>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
Loading…
Reference in New Issue
Block a user