improved the metadata to a better seo

pull/1/head
kirbylife 2019-12-19 16:26:10 -06:00
parent 4a305dee02
commit 2eccb530ad
3 changed files with 18 additions and 9 deletions

View File

@ -142,7 +142,7 @@ fn write_edit_post(mut cookies: Cookies<'_>, id: i32, post: Form<NewPost>) -> Re
if cookie.value() == password {
match posts::edit_post(id, &post) {
Ok(post) => Redirect::to(format!("/post/{}", post.id)),
Err(_) => Redirect::to("admin/add_post"),
Err(_) => Redirect::to("admin/edit_post"),
}
} else {
Redirect::to("/admin")

View File

@ -3,20 +3,19 @@
<html lang="es">
<head>
<meta charset="UTF-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>
{% block title %}
CódigoComentado - blog personal de kirbylife
{% endblock title %}
</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
<title>{% block title %}CódigoComentado - blog personal de kirbylife{% endblock title %}</title>
{% block seo_metadata %}
<meta name="description" content="CodigoComentado - Blog personal de kirbylife" />
<meta name="robots" content="index,follow" />
<meta name="twitter:card" value="summary">
<meta property="og:title" content="CodigoComentado" />
<meta property="og:type" content="article" />
<meta property="og:url" content="https://codigocomentado.herokuapp.com" />
<meta property="og:description" content="CodigoComentado - blog personal de kirbylife" />
<meta property="og:description" content="CodigoComentado - blog personal de kirbylife" />
{% endblock seo_metadata %}
<link href="/static/css/base.css" rel="stylesheet"/>
{% block extracss %}
{% endblock extracss %}

View File

@ -1,6 +1,16 @@
{% extends "base" %}
{% block title %}CódigoComentado - {{post.title}}{% endblock title %}
{% block seo_metadata %}
<meta name="description" content="{{ post.content | split(path=" ") | slice(end=20) | join(sep=" ") }}" />
<meta name="robots" content="index,follow" />
<meta name="twitter:card" value="summary">
<meta property="og:title" content="{{ post.title }}" />
<meta property="og:type" content="article" />
<meta property="og:url" content="https://codigocomentado.herokuapp.com" />
<meta property="og:description" content="{{ post.content | split(path=" ") | slice(end=20) | join(sep=" ") }}" />
{% endblock seo_metadata %}
{% block extracss %}
<link href="/static/css/post.css" rel="stylesheet"/>
{% if post.content is containing("<code>") %}