Skip to content

Commit 1c5a4ea

Browse files
authored
Add a "Learn" page (#2053)
We talked about making a "Learn" page in #2046 and folks seemed enthusiastic, so I took a stab at making a basic page. You can see it here: https://jvns.github.io/git-scm.com/learn. The idea is now that "Reference" links directly to the reference documentation, and that the old `/doc/` page will redirect to the reference documentation. I used Font Awesome icons (GPL compatible) because there was no "Learn" or "Videos" icon, and I wanted the icons to match. I also moved a couple of things to use flexbox/grid honestly because I have never learned how `float: left` works and so it was much easier for me to make the changes I needed to make by using flexbox or grid. Happy to come up with a different approach if folks are concerned about grid availability in browsers: https://caniuse.com/css-grid. I removed links to a couple of cheat sheets on the "Docs" page. Potentially worth adding those back later if/when "External Links" gets revisited. This closes #2055
2 parents c29194b + cbf1be2 commit 1c5a4ea

File tree

2,931 files changed

+3090
-3032
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

2,931 files changed

+3090
-3032
lines changed

assets/sass/dark-mode.css

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -112,10 +112,6 @@
112112
@include box-shadow(none);
113113
}
114114

115-
#front-nav img {
116-
filter: none;
117-
}
118-
119115
div.monitor {
120116
filter: brightness(.85);
121117
}

assets/sass/front-page.scss

Lines changed: 29 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -19,59 +19,62 @@
1919
ul {
2020
@extend .unstyled !optional;
2121
padding-top: 24px;
22+
display: flex;
23+
flex-direction: row;
24+
flex-wrap: wrap;
25+
gap: 20px 40px;
26+
margin-bottom: 40px;
2227

2328
li {
24-
display: block;
25-
float: left;
2629
width: 280px;
27-
margin-bottom: 20px;
28-
29-
&#nav-about,
30-
&#nav-downloads {
31-
margin-right: 30px;
32-
}
33-
34-
&#nav-about,
35-
&#nav-documentation {
36-
margin-bottom: 40px;
37-
}
3830
}
3931
}
4032

4133
a {
42-
display: block;
43-
height: 86px;
44-
padding-left: 90px;
45-
color: var(--font-color);
46-
background-repeat: no-repeat;
47-
background-position: 0 0;
48-
transition-duration: 0.3s;
49-
transition-property: color;
34+
display: grid;
35+
grid-template-columns: 74px 1fr;
36+
grid-template-rows: auto auto;
37+
column-gap: 1rem;
38+
align-items: start;
5039

5140
img {
52-
float: left;
53-
margin-right: -90px;
54-
margin-left: -90px;
55-
opacity: 0.9;
41+
grid-row: 1 / -1;
42+
grid-column: 1;
5643
transition-duration: 0.3s;
5744
transition-property: opacity;
45+
opacity: 0.4;
46+
width: 38px;
47+
height: 38px;
48+
background-color: #cdcdc5;
49+
border-radius: 40%;
50+
padding: 18px;
51+
52+
:root[data-theme="dark"] & {
53+
filter: invert(1);
54+
background-color: #9d9c9a;
55+
}
5856
}
5957

6058
h3 {
6159
font-size: 18px;
6260
font-weight: bold;
6361
color: var(--orange);
62+
grid-row: 1;
63+
grid-column: 2;
6464
}
6565

6666
p {
67+
grid-row: 2;
68+
grid-column: 2;
6769
font-size: 13px;
6870
line-height: $base-line-height * 0.8;
71+
color: var(--font-color);
6972
}
7073
}
7174

7275
a:hover {
7376
img {
74-
opacity: 1;
77+
opacity: 0.7;
7578
}
7679

7780
h3 {

assets/sass/layout.scss

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,55 @@ aside {
8282
}
8383
}
8484

85+
.callout.icon {
86+
position: relative;
87+
padding: 20px 20px 20px 90px !important;
88+
border: 2px solid var(--callout-color);
89+
background: transparent;
90+
91+
&.book {
92+
background: var(--callout-color);
93+
}
94+
95+
a h3 {
96+
font-size: 18px;
97+
color: var(--link-color);
98+
}
99+
100+
p {
101+
font-size: 15px;
102+
line-height: 1.3em;
103+
}
104+
105+
img {
106+
position: absolute;
107+
top: 20px;
108+
left: 17px;
109+
width: 54px;
110+
height: 54px;
111+
opacity: 0.4;
112+
113+
:root[data-theme="dark"] & {
114+
filter: invert(1);
115+
}
116+
}
117+
118+
119+
&.video ul {
120+
list-style-type: none;
121+
margin-left: 1rem;
122+
123+
::marker {
124+
content: "";
125+
margin-right: .5rem;
126+
}
127+
128+
li {
129+
margin: .25rem 0;
130+
}
131+
}
132+
}
133+
85134
.callout {
86135
background-color: var(--callout-color);
87136
@include border-radius(3px);

assets/sass/reference.scss

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -354,24 +354,6 @@ ol.reference-previous-versions {
354354
}
355355
}
356356

357-
.callout.ref-manual {
358-
@include background-image-2x($baseurl + "images/icons/book", 54px, 72px, 24px 20px);
359-
padding: 20px 30px 20px 100px !important;
360-
background-color: var(--callout-color);
361-
iframe {
362-
max-width: 100%;
363-
}
364-
365-
h3 {
366-
font-size: 18px;
367-
}
368-
369-
p {
370-
font-size: 15px;
371-
line-height: 1.3em;
372-
}
373-
}
374-
375357
p.quickref {
376358
@include background-image-2x($baseurl + "images/icons/document", 15px, 21px, 0 0);
377359
padding-left: 22px ! important;

content/cheat-sheet/_index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
section: "documentation"
2+
section: "learn"
33
subsection: "cheat-sheet"
44
title: "Git Cheat Sheet"
55
url: /cheat-sheet.html

content/doc/_index.html

Lines changed: 0 additions & 58 deletions
This file was deleted.

content/doc/ext/_index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
section: "documentation"
2+
section: "learn"
33
subsection: "external-links"
44
title: "Git - External Links"
55
url: /doc/ext.html

content/learn/_index.html

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
---
2+
section: "learn"
3+
title: "Git - Learn"
4+
url: /learn.html
5+
---
6+
7+
<div id="main">
8+
9+
<h1> Learn </h1>
10+
11+
<div class="callout icon book">
12+
13+
<a href="{{< relurl "book">}}">
14+
<img alt="" aria-hidden="true" src="{{< relurl "images/icons/fa-book.svg">}}" >
15+
<h3> Pro Git Book </h3>
16+
</a>
17+
18+
<p>The entire Pro Git book written
19+
by Scott Chacon and Ben Straub is available to read online for free.
20+
Print copies are available on <a
21+
href="https://www.amazon.com/Pro-Git-Scott-Chacon/dp/1484200772?ie=UTF8&camp=1789&creative=9325&creativeASIN=1430218339&linkCode=as2&tag=git-sfconservancy-20">Amazon.com</a>.
22+
</p>
23+
</div>
24+
25+
<div class="callout icon video">
26+
<a href="{{< relurl "videos">}}">
27+
<img alt="" aria-hidden="true" src="{{< relurl "images/icons/fa-video.svg">}}" >
28+
<h3> Videos </h3>
29+
</a>
30+
31+
<p>
32+
Short videos introducing Git for total beginners.
33+
</p>
34+
{{< videos-summary >}}
35+
</div>
36+
37+
<div class="callout icon cheat-sheet">
38+
<a href="{{< relurl "cheat-sheet">}}">
39+
<img alt="" aria-hidden="true" src="{{< relurl "images/icons/fa-note-sticky.svg">}}" >
40+
<h3>Cheat Sheet</h3>
41+
</a>
42+
<p>
43+
The most common Git commands, with diagrams illustrating the difference
44+
between merge and rebase.
45+
</p>
46+
</div>
47+
48+
<div class="callout icon external-links">
49+
<a href="{{< relurl "doc/ext">}}">
50+
<img alt="" aria-hidden="true" src="{{< relurl "images/icons/fa-arrow-up-right-from-square.svg">}}" >
51+
<h3>External Links</h3>
52+
</a>
53+
<p>
54+
Ever-evolving collection of tutorials, books, videos, and other Git resources from the community.
55+
</p>
56+
</div>
57+
</div>

content/videos/_index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
section: "documentation"
2+
section: "learn"
33
subsection: "videos"
44
title: "Git - Videos"
55
url: /videos.html

external/book/content/book/az/v2/Appendix-A-Digər-Mühitlərdə-Git-Bash’da-Git.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
### DO NOT EDIT! Generated by script/update-book2.rb
33
category: book
4-
section: documentation
4+
section: learn
55
subsection: book
66
sidebar: book
77
book:

0 commit comments

Comments
 (0)