diff options
Diffstat (limited to 'templates')
-rw-r--r-- | templates/includes/book/header.html | 22 | ||||
-rw-r--r-- | templates/includes/book/summary.html | 25 | ||||
-rw-r--r-- | templates/layout.html | 37 | ||||
-rw-r--r-- | templates/page.html | 25 |
4 files changed, 109 insertions, 0 deletions
diff --git a/templates/includes/book/header.html b/templates/includes/book/header.html new file mode 100644 index 0000000..7bf937b --- /dev/null +++ b/templates/includes/book/header.html @@ -0,0 +1,22 @@ +<div class="book-header"> + <!-- Actions Left --> + <a href="https://github.com/{{ githubId }}" target="_blank" class="btn pull-left"><i class="fa fa-github-alt"></i></a> + <a href="#" class="btn pull-left toggle-summary"><i class="fa fa-align-justify"></i> Summary</a> + + <!-- Actions Right --> + <a href="/star/{{ githubId }}" class="btn pull-right"><i class="fa fa-star-o"></i> Star (0)</a> + <a href="/watch/{{ githubId }}" class="btn pull-right"><i class="fa fa-eye"></i> Watch (0)</a> + + + <!-- Title --> + <h1><a href="/book/{{ book.attributes.full_name }}" >{{ title }}</a></h1> +</div> +<script> +$(document).ready(function() { + var $book = $(".book"); + $book.find(".book-header .toggle-summary").click(function(e) { + e.preventDefault(); + $book.toggleClass("with-summary"); + }); +}); +</script>
\ No newline at end of file diff --git a/templates/includes/book/summary.html b/templates/includes/book/summary.html new file mode 100644 index 0000000..8b2473e --- /dev/null +++ b/templates/includes/book/summary.html @@ -0,0 +1,25 @@ +<div class="book-summary"> + <ul class="summary"> + <li> + <a href="/book/{{ book.attributes.full_name }}/README.md">Introduction</a> + </li> + <li> + <a href="https://github.com/{{ book.attributes.owner.login }}" target="blank">About the author</a> + </li> + <li class="divider"></li> + {% for item in summary.chapters %} + <li> + <a href="/book/{{ book.attributes.full_name }}/{{ item.chapter.path }}">{{ item.chapter.title }}</a> + {% if item.articles.length > 0 %} + <ul class="articles"> + {% for article in item.articles %} + <li> + <a href="/book/{{ book.attributes.full_name }}/{{ article.path }}">{{ article.title }}</a> + </li> + {% endfor %} + </ul> + {% endif %} + </li> + {% endfor %} + </ul> +</div>
\ No newline at end of file diff --git a/templates/layout.html b/templates/layout.html new file mode 100644 index 0000000..17ca809 --- /dev/null +++ b/templates/layout.html @@ -0,0 +1,37 @@ +<!DOCTYPE HTML> +<html lang="en-US"> + <head> + {% block head %} + <meta charset="UTF-8"> + <title>{% block title %} | GitBook{% endblock %}</title> + {% if config.debug %} + <meta name="robots" content="noindex, nofollow"> + {% else %} + <meta name="robots" content="{% block robots %}noindex, nofollow{% endblock %}"> + {% endif %} + <link rel="icon" href="/static/images/icons/32.png"> + <link rel="stylesheet" href="/static/style.css"> + <meta content="text/html; charset=utf-8" http-equiv="Content-Type"> + <meta name="description" content="{% block description %}{% endblock %}"> + <meta name="keywords" content="{% block keywords %}{% endblock %}" > + <meta name="og:title" content="{% block title %} | GitBook{% endblock %}"> + <meta name="og:locale" content="en_US"> + <meta name="og:site_name" content="GitBook"> + <meta name="og:url" content="{{ config.web.url }}"> + <meta name="og:description" content="{% block description %}{% endblock %}"> + <meta name="og:image" content="/static/images/icons/ios.png" > + <meta name="application-name" content="Gitbook"> + <meta name="application-url" content="{{ config.web.url }}"> + <meta name="msapplication-tooltip" content="{% block description %}{% endblock %}"> + <meta name="msapplication-TileColor" content="#ffffff"> + <meta name="msapplication-starturl" content="{{ config.web.url }}"> + <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"> + <script src="//ajax.googleapis.com/ajax/libs/jquery/2.1.0/jquery.min.js"></script> + {% endblock %} + </head> + <body> + {% block content %}{% endblock %} + </body> +</html>
\ No newline at end of file diff --git a/templates/page.html b/templates/page.html new file mode 100644 index 0000000..a0f1e89 --- /dev/null +++ b/templates/page.html @@ -0,0 +1,25 @@ +{% extends "layout.html" %} + +{% block title %}{{ input }} {{ title }}{% parent %}{% endblock %} +{% block description %}{% endblock %} +{% block robots %}index, follow{% endblock %} +{% block content %} +<div class="book {% if input == "README.md" %}with-summary{% endif %}"> + {% include "includes/book/header.html" %} + {% include "includes/book/summary.html" %} + + <div class="book-body"> + <div class="page-inner"> + {% for section in content %} + <section class="{{ section.type }}"> + {% if section.type == "normal" %} + {% autoescape false %}{{ section.content }}{% endautoescape %} + {% elif section.type == "exercise" %} + + {% endif %} + </section> + {% endfor %} + </div> + </div> +</div> +{% endblock %}
\ No newline at end of file |