Pour tout problème contactez-nous par mail : support@froggit.fr | La FAQ :grey_question: | Rejoignez-nous sur le Chat :speech_balloon:

Skip to content
Snippets Groups Projects
Commit 68c5ee54 authored by Pierre Jarriges's avatar Pierre Jarriges
Browse files

static views og meta

parent 2e553a88
No related branches found
No related tags found
1 merge request!1Dev
......@@ -47,13 +47,15 @@ pub fn create_static_view(app_state: &AppState, article: &Article) -> Result<(),
art_image_uri = format!("/assets/images/{}", art_image_uri);
}
let default_url = String::new();
let art_json = serde_json::to_string(&article).unwrap();
let (locale, title, subtitle, description) = {
let (locale, title, subtitle, description, url) = {
(
&article.locale,
&article.title,
&article.subtitle,
&article.metadata.description,
&article.metadata.view_uri.as_ref().unwrap_or(&default_url),
)
};
let html = format!(
......@@ -66,6 +68,15 @@ pub fn create_static_view(app_state: &AppState, article: &Article) -> Result<(),
<meta name='author' content='Kuadrado Software' />
<meta name='image' content='{art_image_uri}'/>
<meta name='description' content='{description}'>
<!-- Open Graph Protocol meta data -->
<meta property='og:title' content='{title}' />
<meta property='og:description' content='{description}' />
<meta property='og:url' content='{url}' />
<meta property='og:image' content='{art_image_uri}'/ />
<meta property='twitter:image' content='{art_image_uri}'/ />
<link rel='icon' type='image/svg+xml' href='/favicon.svg' />
<title>Kuadrado Software | {title}</title>
<link href='/style/style.css' rel='stylesheet' />
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment