Skip to content

Commit 11b7c3f

Browse files
committed
Added View Code buttons to Tutorials
Fixed Issue #654. Added View Code button and adjusted proper SASS. Added GitHub url to config.yml to generate View Code link.
1 parent e6d59d3 commit 11b7c3f

File tree

3 files changed

+8
-7
lines changed

3 files changed

+8
-7
lines changed

_config.yml

+3-1
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,11 @@
77
#
88

99

10-
1110
# --- Site Settings ---
1211

12+
# Github url
13+
github_url: https://github.com/CodingTrain/website
14+
1315
# The site's title.
1416
title: The Coding Train // Code Repository
1517

_jekyll/layouts/video.html

+2-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,8 @@
5555
{% capture live_example_url %}/{{ page.collection }}{{ page.live_example | default: page.repository }}{% endcapture %}
5656

5757
<div class="code-actions">
58-
<a href="{% if page.repository == false %}#{% else %}{{ site.github_download_prefix | append: site.github.repository_url | append: '/tree/' | append: site.github.source.branch | append: '/' | append: page.collection | append: page.repository }}{% endif %}" target="blank" class="{% if page.repository == false %}disabled{% endif %}">Get the Code</a>
58+
<a href="{% if page.repository == false %}#{% else %}{{ site.github_url | append: '/tree/master/' | append: page.collection | append: page.repository }}{% endif %}" target="blank" class="{% if page.repository == false %}disabled{% endif %}">View Code</a>
59+
<a href="{% if page.repository == false %}#{% else %}{{ site.github_download_prefix | append: site.github.repository_url | append: '/tree/' | append: site.github.source.branch | append: '/' | append: page.collection | append: page.repository }}{% endif %}" target="blank" class="{% if page.repository == false %}disabled{% endif %}">Download Code</a>
5960
<a href="{% if page.live_example == false %}#{% else %}{{ live_example_url | relative_url }}{% endif %}" target="blank" class="{% if page.live_example == false %}disabled{% endif %}">Live Example</a>
6061
</div>
6162

assets/css/3-layouts/_video.sass

+3-5
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
> div
1717
flex-basis: calc(50% - 2em)
1818
margin: 2em 0
19-
19+
2020
@media (max-width: $tablet-big)
2121
flex-basis: auto
2222
margin: 1em 0
@@ -45,7 +45,7 @@
4545
@extend .cta-button
4646
background: $ct-purple
4747
color: #FFF
48-
48+
4949
&.watch-all-videos
5050
flex-grow: 2
5151
margin: auto 0.5em
@@ -72,9 +72,7 @@
7272
flex: 1
7373
background: $ct-purple
7474
color: #FFF
75-
76-
&:first-child
77-
margin-right: 0.5em
75+
margin-right: 0.5em
7876

7977
&.disabled
8078
background: lighten($ct-purple, 15%)

0 commit comments

Comments
 (0)