jekyll-theme-open-course 1.2.2 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/_layouts/default.html +6 -1
- data/assets/js/site.js +11 -5
- data/lib/jtoc.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: '0695b828b4a9c6cc6f7daf682989a2f9b2d6733dcef9e8f36132772bb4930090'
|
|
4
|
+
data.tar.gz: 3baf24cd2b52376168d0cdca5d05c34ebce51106d2c92268d4c93be5fb0884a4
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 4de957ff6a9db42a0b97b8db8f679034d19f02efbb5219f8136bfca6716a87e19032ce92ed258cb4ab6794926ebb61103119d893d65821fe738f8230ac43a51b
|
|
7
|
+
data.tar.gz: a8db4a7d28aa773fcab866abda10c31647e004c771db152243fdd1a44c4c86a409fe4f74a2395a381b07981f7f12bdd23cccf4280c23fb239b7ddb1a42d775ea
|
data/_layouts/default.html
CHANGED
|
@@ -73,7 +73,12 @@
|
|
|
73
73
|
Course syllabus by <a href="{{ instructor.url }}">{{ instructor.name }}</a>.
|
|
74
74
|
Licensed under
|
|
75
75
|
<a href="{{ course.license.url }}" rel="license">{{ course.license.name }}</a>.
|
|
76
|
-
|
|
76
|
+
{% if course.archive %}
|
|
77
|
+
{% assign github_url = course.archive %}
|
|
78
|
+
{% else %}
|
|
79
|
+
{% capture github_url %}{{ instructor.github }}{{ course.uid }}{% endcapture %}
|
|
80
|
+
{% endif %}
|
|
81
|
+
<a id="github" href="{{ github_url }}">Source hosted on GitHub</a>.
|
|
77
82
|
</p>
|
|
78
83
|
</section>
|
|
79
84
|
</footer>
|
data/assets/js/site.js
CHANGED
|
@@ -235,7 +235,13 @@ if ('fetch' in window) {
|
|
|
235
235
|
var url = document.querySelector('#github').getAttribute('href'); // grab the href value of the repo link
|
|
236
236
|
if (typeof(url) !== 'undefined') {
|
|
237
237
|
var fragment = url.substring(url.indexOf('.com/') + 5); // find the tail end (5 = .com/)
|
|
238
|
-
|
|
238
|
+
var branch_regex = /tree/gi;
|
|
239
|
+
var branch_fragment = fragment.replace(branch_regex,'branches'); // replace 'tree' with 'branches'
|
|
240
|
+
// If not dealing with an archival branch (no replacement), append the `main` branch
|
|
241
|
+
if (fragment === branch_fragment) {
|
|
242
|
+
branch_fragment = fragment + '/branches/main';
|
|
243
|
+
}
|
|
244
|
+
return 'https://api.github.com/repos/' + branch_fragment; // return the branch API url
|
|
239
245
|
}
|
|
240
246
|
})();
|
|
241
247
|
|
|
@@ -251,14 +257,14 @@ if ('fetch' in window) {
|
|
|
251
257
|
return response.json();
|
|
252
258
|
})
|
|
253
259
|
.then(function(data) {
|
|
260
|
+
var c = data.commit; // Work only with the commit property of the branch API response
|
|
254
261
|
var commit = {};
|
|
255
|
-
data = data[0]; // only need most recent commit
|
|
256
262
|
// Lowercase commit message's first word to run in `...to XYZ` copy:
|
|
257
|
-
commit.message =
|
|
263
|
+
commit.message = c.commit.message.charAt(0).toLowerCase() + c.commit.message.slice(1);
|
|
258
264
|
// Grab only the first line of a multiline message
|
|
259
265
|
commit.message = commit.message.split("\n\n")[0];
|
|
260
|
-
commit.url =
|
|
261
|
-
commit.stamp =
|
|
266
|
+
commit.url = c.html_url;
|
|
267
|
+
commit.stamp = c.commit.author.date;
|
|
262
268
|
commit.date = new Date(commit.stamp);
|
|
263
269
|
// Put the date in Day, Month 31 at <Local Time String> format
|
|
264
270
|
commit.time_string = namedDays[commit.date.getDay()] + ', ' +
|
data/lib/jtoc.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: jekyll-theme-open-course
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.
|
|
4
|
+
version: 1.3.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Karl Stolley
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2020-
|
|
11
|
+
date: 2020-11-28 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: jekyll
|