diff options
Diffstat (limited to 'theme/templates/website')
-rw-r--r-- | theme/templates/website/glossary.html | 25 | ||||
-rw-r--r-- | theme/templates/website/includes/exercise.html | 26 | ||||
-rw-r--r-- | theme/templates/website/includes/font-settings.html | 10 | ||||
-rw-r--r-- | theme/templates/website/includes/header.html | 38 | ||||
-rw-r--r-- | theme/templates/website/includes/quiz.html | 40 | ||||
-rw-r--r-- | theme/templates/website/includes/summary.html | 29 | ||||
-rwxr-xr-x | theme/templates/website/langs.html | 4 | ||||
-rw-r--r-- | theme/templates/website/layout.html | 14 | ||||
-rw-r--r-- | theme/templates/website/page.html | 20 |
9 files changed, 67 insertions, 139 deletions
diff --git a/theme/templates/website/glossary.html b/theme/templates/website/glossary.html index 4d9683f..ff656cc 100644 --- a/theme/templates/website/glossary.html +++ b/theme/templates/website/glossary.html @@ -1,18 +1,17 @@ {% extends "page.html" %} -{% block title %}Glossary | {{ title }}{% endblock %} +{% block title %}{% i18n "GLOSSARY" %}Glossary{% endi18n %} | {{ title }}{% endblock %} {% block page_inner %} -{% for item in glossaryIndex %} -<section class="normal glossary" id="{{ item.id }}"> - <h2><a href="#{{ item.id }}">{{ item.name }}</a></h2> - <p>{{ item.description }}</p> - <h4>Index</h4> - <ul class="glossary-index"> - {% for file in item.files %} - <li><a href="{{ basePath }}/{{ file.path|mdLink }}"><span class="level">{{ file.level }}.</span> {{ file.title }}</a></li> - {% endfor %} - </ul> -</section> -{% endfor %} + {% for item in glossary %} + <section class="normal glossary" id="{{ item.id }}"> + <h2><a href="#{{ item.id }}">{{ item.name }}</a></h2> + <p>{{ item.description|safe }}</p> + <ul class="glossary-index"> + {% for file in item.files %} + <li><a href="{{ basePath }}/{{ file.path|contentLink }}"><span class="level">{{ file.level }}.</span> {{ file.title }}</a></li> + {% endfor %} + </ul> + </section> + {% endfor %} {% endblock %} diff --git a/theme/templates/website/includes/exercise.html b/theme/templates/website/includes/exercise.html deleted file mode 100644 index 42b500f..0000000 --- a/theme/templates/website/includes/exercise.html +++ /dev/null @@ -1,26 +0,0 @@ -<div class="header"> - <h2>Exercise</h2> -</div> -<div class="alert alert-success"> - <b>Correct!</b> -</div> - -<div class="alert alert-danger error-message"> - <b>False!</b> -</div> - -<div class="message"> - {% autoescape false %}{{ section.content }}{% endautoescape %} -</div> -<div class="editor" style="height: {{ section.code.solution|lines*20 }}px">{{ section.code.base }}</div> - -<pre class="hidden code-solution">{{ section.code.solution }}</pre> -<pre class="hidden code-validation">{{ section.code.validation }}</pre> -{% if section.code.context %} -<pre class="hidden code-context">{{ section.code.context }}</pre> -{% endif %} - -<div class="buttons"> - <a href="#" class="button size-2 action-submit">Submit</a> - <a href="#" class="button size-2 action-solution">Solution</a> -</div> diff --git a/theme/templates/website/includes/font-settings.html b/theme/templates/website/includes/font-settings.html index 5fa1f3e..6a54334 100644 --- a/theme/templates/website/includes/font-settings.html +++ b/theme/templates/website/includes/font-settings.html @@ -10,13 +10,13 @@ </div> <div class="buttons font-family-list"> - <button type="button" data-font="0" class="button">Serif</button> - <button type="button" data-font="1" class="button">Sans</button> + <button type="button" data-font="0" class="button">{% i18n "FONTSETTINGS_SERIF" %}Serif{% endi18n %}</button> + <button type="button" data-font="1" class="button">{% i18n "FONTSETTINGS_SANS" %}Sans{% endi18n %}</button> </div> <div class="buttons color-theme-list"> - <button type="button" id="color-theme-preview-0" class="button size-3" data-theme="0">White</button> - <button type="button" id="color-theme-preview-1" class="button size-3" data-theme="1">Sepia</button> - <button type="button" id="color-theme-preview-2" class="button size-3" data-theme="2">Night</button> + <button type="button" id="color-theme-preview-0" class="button size-3" data-theme="0">{% i18n "FONTSETTINGS_WHITE" %}White{% endi18n %}</button> + <button type="button" id="color-theme-preview-1" class="button size-3" data-theme="1">{% i18n "FONTSETTINGS_SEPIA" %}Sepia{% endi18n %}</button> + <button type="button" id="color-theme-preview-2" class="button size-3" data-theme="2">{% i18n "FONTSETTINGS_NIGHT" %}Night{% endi18n %}</button> </div> </div> diff --git a/theme/templates/website/includes/header.html b/theme/templates/website/includes/header.html index ef2de60..119dd62 100644 --- a/theme/templates/website/includes/header.html +++ b/theme/templates/website/includes/header.html @@ -1,20 +1,20 @@ <div class="book-header"> <!-- Actions Left --> - <a href="#" class="btn pull-left toggle-summary" aria-label="Toggle summary"><i class="fa fa-align-justify"></i></a> - <a href="#" class="btn pull-left toggle-search" aria-label="Toggle search"><i class="fa fa-search"></i></a> + <a href="#" class="btn pull-left toggle-summary" aria-label="{% i18n "SUMMARY_TOGGLE" %}Table of Contents{% endi18n %}"><i class="fa fa-align-justify"></i></a> + <a href="#" class="btn pull-left toggle-search" aria-label="{% i18n "SEARCH_TOGGLE" %}Search{% endi18n %}"><i class="fa fa-search"></i></a> {% if glossary.length > 0 %} - <a href="{{ basePath }}/GLOSSARY.html" class="btn pull-left" aria-label="Open Glossary"><i class="fa fa-sort-alpha-asc"></i></a> + <a href="{{ basePath }}/GLOSSARY.html" class="btn pull-left" aria-label="{% i18n "GLOSSARY_OPEN" %}Glossary{% endi18n %}"><i class="fa fa-sort-alpha-asc"></i></a> {% endif %} <div id="font-settings-wrapper" class="dropdown pull-left"> - <a href="#" class="btn toggle-dropdown" aria-label="Toggle font settings"><i class="fa fa-font"></i> + <a href="#" class="btn toggle-dropdown" aria-label="{% i18n "FONTSETTINGS_TOGGLE" %}Font Settings{% endi18n %}"><i class="fa fa-font"></i> </a> {% include "./font-settings.html" %} </div> <!-- Actions Right --> - {% if options.links.sharing.all !== false %} + {% if options.links.sharing.all != false %} <div class="dropdown pull-right"> - <a href="#" class="btn toggle-dropdown" aria-label="Toggle share dropdown"><i class="fa fa-share-alt"></i> + <a href="#" class="btn toggle-dropdown" aria-label="{% i18n "SHARE_TOGGLE" %}Share{% endi18n %}"><i class="fa fa-share-alt"></i> </a> <div class="dropdown-menu font-settings dropdown-left"> <div class="dropdown-caret"> @@ -22,27 +22,27 @@ <span class="caret-inner"></span> </div> <div class="buttons"> - <button type="button" data-sharing="twitter" class="button">Twitter</button> - <button type="button" data-sharing="google-plus" class="button">Google</button> - <button type="button" data-sharing="facebook" class="button">Facebook</button> - <button type="button" data-sharing="weibo" class="button">Weibo</button> - <button type="button" data-sharing="instapaper" class="button">Instapaper</button> + <button type="button" data-sharing="twitter" class="button">{% i18n "SHARE_ON", __platform__="Twitter" %}Share on __platform__{% endi18n %}</button> + <button type="button" data-sharing="google-plus" class="button">{% i18n "SHARE_ON", __platform__="Google" %}Share on __platform__{% endi18n %}</button> + <button type="button" data-sharing="facebook" class="button">{% i18n "SHARE_ON", __platform__="Facebook" %}Share on __platform__{% endi18n %}</button> + <button type="button" data-sharing="weibo" class="button">{% i18n "SHARE_ON", __platform__="Weibo" %}Share on __platform__{% endi18n %}</button> + <button type="button" data-sharing="instapaper" class="button">{% i18n "SHARE_ON", __platform__="Instapaper" %}Share on __platform__{% endi18n %}</button> </div> </div> </div> {% endif %} - {% if options.links.sharing.google !== false %} - <a href="#" target="_blank" class="btn pull-right google-plus-sharing-link sharing-link" data-sharing="google-plus" aria-label="Share on Google Plus"><i class="fa fa-google-plus"></i></a> + {% if options.links.sharing.google != false %} + <a href="#" target="_blank" class="btn pull-right google-plus-sharing-link sharing-link" data-sharing="google-plus" aria-label="Google"><i class="fa fa-google-plus"></i></a> {% endif %} - {% if options.links.sharing.facebook !== false %} - <a href="#" target="_blank" class="btn pull-right facebook-sharing-link sharing-link" data-sharing="facebook" aria-label="Share on Facebook"><i class="fa fa-facebook"></i></a> + {% if options.links.sharing.facebook != false %} + <a href="#" target="_blank" class="btn pull-right facebook-sharing-link sharing-link" data-sharing="facebook" aria-label="Facebook"><i class="fa fa-facebook"></i></a> {% endif %} - {% if options.links.sharing.twitter !== false %} - <a href="#" target="_blank" class="btn pull-right twitter-sharing-link sharing-link" data-sharing="twitter" aria-label="Share on Twitter"><i class="fa fa-twitter"></i></a> + {% if options.links.sharing.twitter != false %} + <a href="#" target="_blank" class="btn pull-right twitter-sharing-link sharing-link" data-sharing="twitter" aria-label="Twitter"><i class="fa fa-twitter"></i></a> {% endif %} - {% if options.links.sharing.weibo === true %} - <a href="#" target="_blank" class="btn pull-right twitter-sharing-link sharing-link" data-sharing="weibo" aria-label="Share on Weibo"><i class="fa fa-weibo"></i></a> + {% if options.links.sharing.weibo == true %} + <a href="#" target="_blank" class="btn pull-right weibo-sharing-link sharing-link" data-sharing="weibo" aria-label="Weibo"><i class="fa fa-weibo"></i></a> {% endif %} <!-- Title --> diff --git a/theme/templates/website/includes/quiz.html b/theme/templates/website/includes/quiz.html deleted file mode 100644 index 425fa39..0000000 --- a/theme/templates/website/includes/quiz.html +++ /dev/null @@ -1,40 +0,0 @@ -<div class="header"> - <h2>Quiz</h2> -</div> - -<div class="message"> - {% autoescape false %}{{ section.content }}{% endautoescape %} -</div> - - -{% for quiz in section.quiz %} -<div class="question"> - <div class="question-header">Question {{ loop.index }} of {{ section.quiz.length }}</div> - - <div class="question-content"> - <div class="alert alert-success hidden"> - <b>Correct!</b> - </div> - - <div class="alert alert-danger error-message hidden"> - <p><b>Not quite!</b></p> - {% autoescape false %}{{ quiz.feedback }}{% endautoescape %} - </div> - - <div class="question-inner"> - {% autoescape false %}{{ quiz.base }}{% endautoescape %} - </div> - </div> - - <div class="hidden question-answers"> - <div class="question-inner"> - {% autoescape false %}{{ quiz.solution }}{% endautoescape %} - </div> - </div> -</div> -{% endfor %} - -<div class="buttons"> - <a href="#" class="button size-2 action-submit">Submit</a> - <a href="#" class="button size-2 action-solution">Solution</a> -</div> diff --git a/theme/templates/website/includes/summary.html b/theme/templates/website/includes/summary.html index 3fff7fe..6aa523b 100644 --- a/theme/templates/website/includes/summary.html +++ b/theme/templates/website/includes/summary.html @@ -1,23 +1,22 @@ {% macro articles(_articles) %} {% for item in _articles %} - {% set externalLink = item.path|isExternalLink %} - <li class="chapter {% if item.path == _input %}active{% endif %}" data-level="{{ item.level }}" {% if item.path && !externalLink %}data-path="{{ item.path|mdLink }}"{% endif %}> - {% if item.path %} - {% if !externalLink %} - <a href="{{ basePath }}/{{ item.path|mdLink }}"> + <li class="chapter {% if item.path == _input %}active{% endif %}" data-level="{{ item.level }}" {% if item.path and not item.external %}data-path="{{ item.path|contentLink }}"{% endif %}> + {% if item.path and item.exists %} + {% if not item.external %} + <a href="{{ basePath }}/{{ item.path|contentLink }}"> <i class="fa fa-check"></i> - {% if item.level !== "0" %} + {% if item.level != "0" %} <b>{{ item.level }}.</b> {% endif %} - {{ item.title }} + {% if item.introduction %}{% i18n "SUMMARY_INTRODUCTION" %}Introduction{% endi18n %}{% else %}{{ item.title }}{% endif %} </a> {% else %} <a target="_blank" href="{{ item.path }}"> <i class="fa fa-check"></i> - {% if item.level !== "0" %} + {% if item.level != "0" %} <b>{{ item.level }}.</b> {% endif %} - {{ item.title }} + {{ item.title }} </a> {% endif %} {% else %} @@ -25,7 +24,7 @@ {% endif %} {% if item.articles.length > 0 %} <ul class="articles"> - {{ articles(item.articles) }} + {{ articles(item.articles) }} </ul> {% endif %} </li> @@ -34,15 +33,15 @@ <div class="book-summary"> <div class="book-search"> - <input type="text" placeholder="Type to search" class="form-control" /> + <input type="text" placeholder="{% i18n "SEARCH_PLACEHOLDER" %}Type to search{% endi18n %}" class="form-control" /> </div> <ul class="summary"> {% set _divider = false %} {% if options.links.sidebar %} - {% for link in options.links.sidebar %} + {% for linkTitle, link in options.links.sidebar %} {% set _divider = true %} <li> - <a href="{{ options.links.sidebar[loop.key] }}" target="blank" class="custom-link">{{ loop.key }}</a> + <a href="{{ link }}" target="blank" class="custom-link">{{ linkTitle }}</a> </li> {% endfor %} {% endif %} @@ -53,10 +52,10 @@ {{ articles(summary.chapters) }} - {% if options.links.gitbook !== false %} + {% if options.links.gitbook != false %} <li class="divider"></li> <li> - <a href="https://www.gitbook.com" target="blank" class="gitbook-link">Published using GitBook</a> + <a href="https://www.gitbook.com" target="blank" class="gitbook-link">{% i18n "GITBOOK_LINK" %}Published using GitBook{% endi18n %}</a> </li> {% endif %} </ul> diff --git a/theme/templates/website/langs.html b/theme/templates/website/langs.html index 7b47fc5..89a075e 100755 --- a/theme/templates/website/langs.html +++ b/theme/templates/website/langs.html @@ -9,12 +9,12 @@ {% block content %} <div class="book-langs-index"> <div class="inner"> - <h3>Choose a language</h3> + <h3>{% i18n "LANGS_CHOOSE" %}Choose a language{% endi18n %}</h3> <ul class="languages"> {% for lang in langs %} <li> - <a href="{{ basePath}}/{{ lang.path|pathJoin("/index.html") }}">{{ lang.title }}</a> + <a href="{{ basePath}}/{{ lang.lang }}/index.html">{{ lang.title }}</a> </li> {% endfor %} </ul> diff --git a/theme/templates/website/layout.html b/theme/templates/website/layout.html index 5dc7c5e..9107de7 100644 --- a/theme/templates/website/layout.html +++ b/theme/templates/website/layout.html @@ -1,8 +1,8 @@ <!DOCTYPE HTML> -<html lang="en-US" {% block htmlTag %}{% endblock %}> - {{ htmlSnippet("html:start")|default("") }} +<html lang="{{ language }}" {% if options.direction == "rtl" %}dir="rtl"{% endif %}> + {{ htmlSnippet("html:start")|default("")|safe }} <head> - {{ htmlSnippet("head:start")|default("") }} + {{ htmlSnippet("head:start")|default("")|safe }} <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=11; IE=10; IE=9; IE=8; IE=7; IE=EDGE" /> <title>{% block title %}{% endblock %}</title> @@ -19,14 +19,14 @@ <meta name="identifier" content="{{ options.isbn }}" scheme="ISBN"> {% endif %} {% block head %}{% endblock %} - {{ htmlSnippet("head:end")|default("") }} + {{ htmlSnippet("head:end")|default("")|safe }} </head> <body> - {{ htmlSnippet("body:start")|default("") }} + {{ htmlSnippet("body:start")|default("")|safe }} {% block style %}{% endblock %} {% block content %}{% endblock %} {% block javascript %}{% endblock %} - {{ htmlSnippet("body:end")|default("") }} + {{ htmlSnippet("body:end")|default("")|safe }} </body> - {{ htmlSnippet("html:end")|default("") }} + {{ htmlSnippet("html:end")|default("")|safe }} </html> diff --git a/theme/templates/website/page.html b/theme/templates/website/page.html index 91f2162..37fc9dd 100644 --- a/theme/templates/website/page.html +++ b/theme/templates/website/page.html @@ -1,20 +1,20 @@ {% extends "./layout.html" %} {% block head %} - {% parent %} + {{ super() }} {% if progress.current.next and progress.current.next.path %} - <link rel="next" href="{{ basePath }}/{{ progress.current.next.path|mdLink }}" /> + <link rel="next" href="{{ basePath }}/{{ progress.current.next.path|contentLink }}" /> {% endif %} {% if progress.current.prev and progress.current.prev.path %} - <link rel="prev" href="{{ basePath }}/{{ progress.current.prev.path|mdLink }}" /> + <link rel="prev" href="{{ basePath }}/{{ progress.current.prev.path|contentLink }}" /> {% endif %} {% endblock %} {% block title %}{{ progress.current.title }} | {{ title }}{% endblock %} -{% block description %}{% if progress.current.level == "0" %}{{ description }}{% endif %}{% endblock %} +{% block description %}{% if progress.current.level == "0" %}{{ description }}{% endif %}{% endblock %} {% block content %} - <div class="book" data-level="{{ progress.current.level }}" data-basepath="{{ basePath }}" data-revision="{{ revision }}"> + <div class="book" data-level="{{ progress.current.level }}" data-basepath="{{ basePath }}" data-revision="{{ revision }}"> {% include "includes/summary.html" %} <div class="book-body"> <div class="body-inner"> @@ -23,13 +23,9 @@ <div class="page-inner"> {% block page_inner %} {% for section in content %} - <section class="{{ section.type }}" id="section-{{ section.id }}"> + <section class="{{ section.type }}" id="section-{{ section.id }}"> {% if section.type == "normal" %} {% autoescape false %}{{ section.content }}{% endautoescape %} - {% elif section.type == "exercise" %} - {% include "./includes/exercise.html" with {section: section} %} - {% elif section.type == "quiz" %} - {% include "./includes/quiz.html" with {section: section} %} {% endif %} </section> {% endfor %} @@ -39,10 +35,10 @@ </div> {% if progress.current.prev and progress.current.prev.path %} - <a href="{{ basePath }}/{{ progress.current.prev.path|mdLink }}" class="navigation navigation-prev {% if !progress.current.next or !progress.current.next.path %}navigation-unique{% endif %}" aria-label="Previous page: {{ progress.current.prev.title }}"><i class="fa fa-angle-left"></i></a> + <a href="{{ basePath }}/{{ progress.current.prev.path|contentLink }}" class="navigation navigation-prev {% if not (progress.current.next and progress.current.next.path) %}navigation-unique{% endif %}" aria-label="Previous page: {{ progress.current.prev.title }}"><i class="fa fa-angle-left"></i></a> {% endif %} {% if progress.current.next and progress.current.next.path %} - <a href="{{ basePath }}/{{ progress.current.next.path|mdLink }}" class="navigation navigation-next {% if !progress.current.prev or !progress.current.prev.path %}navigation-unique{% endif %}" aria-label="Next page: {{ progress.current.next.title }}"><i class="fa fa-angle-right"></i></a> + <a href="{{ basePath }}/{{ progress.current.next.path|contentLink }}" class="navigation navigation-next {% if not (progress.current.prev or progress.current.prev.path) %}navigation-unique{% endif %}" aria-label="Next page: {{ progress.current.next.title }}"><i class="fa fa-angle-right"></i></a> {% endif %} </div> </div> |