diff options
author | Samy Pessé <samypesse@gmail.com> | 2014-06-06 20:00:38 +0200 |
---|---|---|
committer | Samy Pessé <samypesse@gmail.com> | 2014-06-06 20:00:38 +0200 |
commit | 57491e3a8bbd20672fe80198f2bf8325c1f3e149 (patch) | |
tree | 82a923ce48ccb40a5060c1adb3be8df2ac4dd659 /theme | |
parent | f7a442d297d3914b9e2bfea7709fd38e41a40e2a (diff) | |
download | gitbook-57491e3a8bbd20672fe80198f2bf8325c1f3e149.zip gitbook-57491e3a8bbd20672fe80198f2bf8325c1f3e149.tar.gz gitbook-57491e3a8bbd20672fe80198f2bf8325c1f3e149.tar.bz2 |
Improve meta tags for books
Diffstat (limited to 'theme')
-rwxr-xr-x | theme/templates/layout.html | 30 | ||||
-rw-r--r-- | theme/templates/site.html | 18 |
2 files changed, 22 insertions, 26 deletions
diff --git a/theme/templates/layout.html b/theme/templates/layout.html index 5f76e5e..cd4e3ab 100755 --- a/theme/templates/layout.html +++ b/theme/templates/layout.html @@ -1,38 +1,18 @@ <!DOCTYPE HTML> <html lang="en-US" {% block htmlTag %}{% endblock %}> {{ htmlSnippet("html:start")|default("") }} - <head prefix="og: http://ogp.me/ns# book: http://ogp.me/ns/book#"> + <head> {{ htmlSnippet("head:start")|default("") }} {% block head %} <meta charset="UTF-8"> - <title>{% block title %} | {{ title }}{% endblock %}</title> - + <title>{% block title %}{% endblock %}</title> <meta content="text/html; charset=utf-8" http-equiv="Content-Type"> - <meta name="robots" content="index, follow"> - <meta name="author" content="{{ githubAuthor }}"> - <meta name="description" content="{{ description }}"> - <meta name="keywords" content="gitbook,github" > - <meta name="generator" content="www.gitbook.io"> - - {% if progress.current.next and progress.current.next.path %} - <link rel="next" href="{{ basePath }}/{{ progress.current.next.path|mdLink }}" /> - {% endif %} - {% if progress.current.prev and progress.current.prev.path %} - <link rel="prev" href="{{ basePath }}/{{ progress.current.prev.path|mdLink }}" /> - {% endif %} - - <meta property="og:title" content="{% block title %} | {{ title }}{% endblock %}"> - <meta property="og:site_name" content="{{ title }}"> - <meta property="og:type" content="book"> - <meta property="og:locale" content="en_US"> - - <meta property="book:author" content="{{ githubHost }}{{ githubAuthor }}"> - <meta property="book:tag" content="GitBook"> - + <meta name="description" content="{% block description %}{% endblock %}"> + <meta name="generator" content="GitBook {{ gitbook.version }}"> + <meta name="HandheldFriendly" content="true"/> <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no"> <meta name="apple-mobile-web-app-capable" content="yes"> <meta name="apple-mobile-web-app-status-bar-style" content="black"> - <link rel="shortcut icon" href="{{ staticBase }}/images/favicon.ico" type="image/x-icon"> {% endblock %} {{ htmlSnippet("head:end")|default("") }} diff --git a/theme/templates/site.html b/theme/templates/site.html index b0a2ba4..607ffbf 100644 --- a/theme/templates/site.html +++ b/theme/templates/site.html @@ -1,7 +1,23 @@ {% extends "layout.html" %} {% block htmlTag %}{% if options.cache !== false %}manifest="{{ basePath }}/manifest.appcache"{% endif %}{% endblock %} -{% block title %}{{ progress.current.title }}{% parent %}{% endblock %} + +{% block title %}{{ progress.current.title }} | {{ title }}{% endblock %} +{% block description %}{% if progress.current.level == "0" %}{{ description }}{% endif %}{% endblock %} + +{% block head %} + {% parent %} + {% if githubAuthor %} + <meta name="author" content="{{ githubAuthor }}"> + {% endif %} + {% if progress.current.next and progress.current.next.path %} + <link rel="next" href="{{ basePath }}/{{ progress.current.next.path|mdLink }}" /> + {% endif %} + {% if progress.current.prev and progress.current.prev.path %} + <link rel="prev" href="{{ basePath }}/{{ progress.current.prev.path|mdLink }}" /> + {% endif %} +{% endblock %} + {% block content %} <div class="book" {% if githubId %}data-github="{{ githubId }}"{% endif %} data-level="{{ progress.current.level }}" data-basepath="{{ basePath }}" data-revision="{{ revision }}"> {% include "includes/book/header.html" %} |