diff --git a/site/app.js b/site/app.js
index 4092ae744b..93be992c14 100644
--- a/site/app.js
+++ b/site/app.js
@@ -240,16 +240,20 @@
html += '
';
html += '
';
if (l.url) {
- html += '
' + escapeHtml(l.name) + '';
+ if (lessonPath) {
+ html += '
' + escapeHtml(l.name) + '';
+ } else {
+ html += '
' + escapeHtml(l.name) + '';
+ }
} else {
- html += '
' + escapeHtml(l.name) + '';
+ html += '
' + escapeHtml(l.name) + '';
}
html += '
' + escapeHtml(l.type) + '';
html += '
' + escapeHtml(l.lang) + '';
var actionHtml = '';
- if ((l.status === 'complete' || userComplete) && lessonPath) {
- actionHtml = '
' + (userComplete ? 'Review' : 'Read') + '';
+ if (l.url && lessonPath) {
+ actionHtml = '
GitHub';
}
var toggleHtml = '';
if (hasProgress && lessonPath) {
diff --git a/site/catalog.html b/site/catalog.html
index 7369cc649b..e9e2c7c02e 100644
--- a/site/catalog.html
+++ b/site/catalog.html
@@ -192,6 +192,17 @@
font-size: 1.1rem;
}
+ .catalog-github-link {
+ font-size: 0.75rem;
+ text-decoration: none;
+ opacity: 0.5;
+ transition: opacity 0.15s;
+ }
+
+ .catalog-github-link:hover {
+ opacity: 1;
+ }
+
@media (max-width: 768px) {
.catalog-page {
padding: 80px 0 48px;
@@ -348,6 +359,7 @@
Lesson Catalog
for (var j = 0; j < p.lessons.length; j++) {
var l = p.lessons[j];
+ var pathMatch = l.url ? l.url.match(/(phases\/[^/]+\/[^/]+)\/?$/) : null;
allRows.push({
phase: p.id,
phaseName: p.name,
@@ -355,7 +367,8 @@
Lesson Catalog
type: l.type,
lang: l.lang,
status: l.status,
- url: l.url || ''
+ url: l.url || '',
+ lessonPath: pathMatch ? pathMatch[1] : ''
});
}
}
@@ -425,7 +438,13 @@
Lesson Catalog
var r = rows[i];
html += '
';
html += '| ' + String(r.phase).padStart(2, '0') + ' | ';
- if (r.url) {
+ if (r.lessonPath) {
+ html += '' + escapeHtml(r.name) + '';
+ if (r.url) {
+ html += ' ↗';
+ }
+ html += ' | ';
+ } else if (r.url) {
html += '' + escapeHtml(r.name) + ' | ';
} else {
html += '' + escapeHtml(r.name) + ' | ';
diff --git a/site/style.css b/site/style.css
index 1f82682249..e4259762c2 100644
--- a/site/style.css
+++ b/site/style.css
@@ -709,6 +709,19 @@ p.dropcap::first-letter {
border-bottom: 1px solid var(--blueprint);
}
+.modal-lesson .modal-lesson-github {
+ font-size: 0.68rem;
+ color: var(--ink-mute);
+ opacity: 0.6;
+ transition: opacity 0.15s, color 0.15s;
+}
+
+.modal-lesson .modal-lesson-github:hover {
+ opacity: 1;
+ color: var(--blueprint);
+ border-color: var(--rule-soft);
+}
+
.modal-lesson-read-placeholder {
display: inline-block;
width: 64px;