summaryrefslogtreecommitdiffstats
path: root/theme
diff options
context:
space:
mode:
Diffstat (limited to 'theme')
-rw-r--r--theme/assets/app.js21
-rw-r--r--theme/templates/page.html4
-rw-r--r--theme/templates/site.html6
3 files changed, 20 insertions, 11 deletions
diff --git a/theme/assets/app.js b/theme/assets/app.js
index f2956de..9417c84 100644
--- a/theme/assets/app.js
+++ b/theme/assets/app.js
@@ -21379,9 +21379,6 @@ require([
$(document).ready(function() {
var $book = state.$book;
- // Initialize storage
- storage.setBaseKey(state.githubId);
-
// Init sidebar
sidebar.init();
@@ -21391,12 +21388,17 @@ require([
// Init keyboard
keyboard.init();
- // Star and watch count
- $.getJSON("https://api.github.com/repos/"+state.githubId)
- .done(function(repo) {
- $book.find(".count-star span").text(repo.stargazers_count);
- $book.find(".count-watch span").text(repo.subscribers_count);
- });
+ if (state.githubId) {
+ // Initialize storage
+ storage.setBaseKey(state.githubId);
+
+ // Star and watch count
+ $.getJSON("https://api.github.com/repos/"+state.githubId)
+ .done(function(repo) {
+ $book.find(".count-star span").text(repo.stargazers_count);
+ $book.find(".count-watch span").text(repo.subscribers_count);
+ });
+ }
// Bind exercise
exercise.init();
@@ -21411,5 +21413,6 @@ require([
$(".book-body").focus();
});
});
+
define("app", function(){});
diff --git a/theme/templates/page.html b/theme/templates/page.html
index b23c81e..6f5115f 100644
--- a/theme/templates/page.html
+++ b/theme/templates/page.html
@@ -12,7 +12,9 @@
{# Cover #}
<section id="cover">
<h1>{{ title }}</h1>
+ {% if githubId %}
<h2>By <a href="{{ githubHost }}{{ githubAuthor }}">@{{ githubAuthor }}</a></h2>
+ {% endif %}
</section>
{# Summary #}
@@ -116,4 +118,4 @@
{% endif %}
{% endblock %}
-{% block javascript %}{% endblock %} \ No newline at end of file
+{% block javascript %}{% endblock %}
diff --git a/theme/templates/site.html b/theme/templates/site.html
index 5771c72..76cbb51 100644
--- a/theme/templates/site.html
+++ b/theme/templates/site.html
@@ -2,7 +2,11 @@
{% block title %}{{ progress.current.title }}{% parent %}{% endblock %}
{% block content %}
+{% if githubId %}
<div class="book" data-github="{{ githubId }}" data-level="{{ progress.current.level }}" data-basepath="{{ basePath }}" data-revision="{{ revision }}">
+{% else %}
+<div class="book" data-level="{{ progress.current.level }}" data-basepath="{{ basePath }}" data-revision="{{ revision }}">
+{% endif %}
{% include "includes/book/header.html" %}
{% include "includes/book/summary.html" %}
<div class="book-body" tabindex="-1">
@@ -25,4 +29,4 @@
</div>
</div>
</div>
-{% endblock %} \ No newline at end of file
+{% endblock %}