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 { if cookie.value() == password {
match posts::edit_post(id, &post) { match posts::edit_post(id, &post) {
Ok(post) => Redirect::to(format!("/post/{}", post.id)), Ok(post) => Redirect::to(format!("/post/{}", post.id)),
Err(_) => Redirect::to("admin/add_post"), Err(_) => Redirect::to("admin/edit_post"),
} }
} else { } else {
Redirect::to("/admin") Redirect::to("/admin")

View File

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

View File

@ -1,6 +1,16 @@
{% extends "base" %} {% extends "base" %}
{% block title %}CódigoComentado - {{post.title}}{% endblock title %} {% 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 %} {% block extracss %}
<link href="/static/css/post.css" rel="stylesheet"/> <link href="/static/css/post.css" rel="stylesheet"/>
{% if post.content is containing("<code>") %} {% if post.content is containing("<code>") %}