Skip to content

Commit fab4f22

Browse files
committed
content: fixed slides up to git remotes
1 parent 2626807 commit fab4f22

File tree

8 files changed

+111
-67
lines changed

8 files changed

+111
-67
lines changed

src/client/styles/menu.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
align-items: flex-start;
55
justify-content: space-between;
66
margin: 20px 1px;
7+
font-size: 0.9rem;
78
}
89

910
.navigation-menu__inner {

src/components/LessonOverview.astro

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
---
2-
import { baseUrl, lessonMarker, type AstroLesson } from '../helpers.astro';
2+
import { baseUrl, fullLinkText, lessonMarker, pagePath, pageTitle, type AstroLesson } from '../helpers.astro';
33
44
export interface Props {
5-
category?: 'lesson' | 'bonus',
5+
category?: 'lesson' | 'bonus' | 'homework',
66
lesson: AstroLesson,
77
}
88
99
const { category, lesson } = Astro.props;
1010
11-
const subPath = category == 'bonus' ? 'bonus/' : 'lessons/';
11+
const subPath = pagePath(category);
1212
1313
const lessonUrl = `${baseUrl}${subPath}${lesson.slug}`;
1414
const slidesUrl = `${baseUrl}slides/${lesson.slug}`
1515
16-
const title = category == 'bonus'
17-
? lesson.data.title
18-
: `${lessonMarker(lesson.data.state)} ${lesson.data.order}. ${lesson.data.title}`
16+
const title = pageTitle(lesson, category);
17+
18+
const fullLinkLabel = fullLinkText(category);
1919
---
2020

2121
<article class="post on-list">
@@ -39,7 +39,7 @@ const title = category == 'bonus'
3939
</div>
4040
)}
4141
<div class="spaced">
42-
<a href={lessonUrl} class="read-more button inline">view full lesson</a>
42+
<a href={lessonUrl} class="read-more button inline">{fullLinkLabel}</a>
4343
{lesson.data.hasSlides && <a href={slidesUrl} class="read-more button inline">view as slides</a>}
4444
</div>
4545
</article>

src/content/lessons/git-branches.md

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,52 @@ git log --oneline --graph master...experimental
200200

201201
---
202202

203+
## Tracking Remote Branches
204+
205+
```bash
206+
# See all branches (local and remote)
207+
git branch -a
208+
209+
# Create local branch that tracks remote
210+
git checkout -b feature-branch origin/feature-branch
211+
212+
# Simplified version (Git 2.23+)
213+
# Auto-tracks if remote exists
214+
git switch feature-branch
215+
```
216+
217+
---
218+
219+
## Working with Remote Branches
220+
221+
```bash
222+
# Create local branch
223+
git checkout -b new-feature
224+
225+
# make changes, commit and push to remote
226+
git push -u origin new-feature
227+
228+
# Delete remote branch
229+
git push origin --delete old-feature
230+
231+
# Update remote tracking branches
232+
git fetch --prune
233+
```
234+
235+
---
236+
237+
## Branch Lifecycle
238+
239+
1. **Create** branch from up-to-date main
240+
2. **Work** on feature with regular commits
241+
3. **Test** thoroughly before merging
242+
4. **Request** code review
243+
5. **Merge** to main after approval
244+
6. **Delete** feature branch after merge
245+
7. **Update** local main branch
246+
247+
---
248+
203249
## Detached HEAD
204250

205251
If HEAD points directly at a commit, git will inform you that

src/content/lessons/git-commands.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: 'Basic git commands'
33
description: 'An overview of basic git commands - everything you need to run a local repository'
44
order: 4
5-
state: 'upcoming'
5+
state: 'covered'
66
tags: ['git']
77
links: {
88
'Meaningful commit messages': 'https://www.conventionalcommits.org/en/v1.0.0/',

src/content/lessons/git-remotes.md

Lines changed: 2 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: 'Working with remote repositories'
33
description: "Remote repositories are copies of the same repository in different locations"
44
order: 5
5-
state: 'upcoming'
5+
state: 'covered'
66
tags: ['git']
77
links: {
88
'Working with remotes': 'https://git-scm.com/book/en/v2/Git-Basics-Working-with-Remotes',
@@ -81,6 +81,7 @@ By default git will clone into the current directory,
8181
creating a directory with the repository's name.
8282

8383
You can provide a different local path:
84+
8485
```bash
8586
git clone https://path/to/repo /path/to/local/clone
8687
```
@@ -162,52 +163,6 @@ git push origin --all
162163

163164
---
164165

165-
## Tracking Remote Branches
166-
167-
```bash
168-
# See all branches (local and remote)
169-
git branch -a
170-
171-
# Create local branch that tracks remote
172-
git checkout -b feature-branch origin/feature-branch
173-
174-
# Simplified version (Git 2.23+)
175-
# Auto-tracks if remote exists
176-
git switch feature-branch
177-
```
178-
179-
---
180-
181-
## Working with Remote Branches
182-
183-
```bash
184-
# Create local branch
185-
git checkout -b new-feature
186-
187-
# make changes, commit and push to remote
188-
git push -u origin new-feature
189-
190-
# Delete remote branch
191-
git push origin --delete old-feature
192-
193-
# Update remote tracking branches
194-
git fetch --prune
195-
```
196-
197-
---
198-
199-
## Branch Lifecycle
200-
201-
1. **Create** branch from up-to-date main
202-
2. **Work** on feature with regular commits
203-
3. **Test** thoroughly before merging
204-
4. **Request** code review
205-
5. **Merge** to main after approval
206-
6. **Delete** feature branch after merge
207-
7. **Update** local main branch
208-
209-
---
210-
211166
<class-work>
212167

213168
### Create your personal github.io page

src/content/lessons/intro-to-git.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: 'Intro to git'
33
description: 'An overview of what git is, how it works and why we want to learn to use it'
44
order: 3
5-
state: 'upcoming'
5+
state: 'covered'
66
tags: ['intro', 'git']
77
links: {
88
'Git docs': 'https://git-scm.com/docs',

src/content/syllabus.md

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,10 @@
3333

3434
## Grading breakdown & schedule
3535

36-
3736
| Assignment | Weight | Due Date |
3837
| --------------- | --------------- | --- |
3938
| In class attendance & participation | 10% | ♾️|
40-
| Homework 1 | 15% | 26.09.25 |
39+
| Homework 1 | 15% | **01.10.25** |
4140
| Midterm test | 25% | 03.10.25 |
42-
| Homework 2 | 20% | 10.10.25 |
41+
| Homework 2 | 20% | **12.10.25** |
4342
| Final test | 30% | 17.10.25 |
44-
45-
46-

src/helpers.astro

Lines changed: 51 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,60 @@ export async function getBonusMaterials() {
1313
return (await getCollection('bonus'));
1414
}
1515
16+
export async function getHomeworks() {
17+
return (await getCollection('homeworks'))
18+
.sort((a, b) => a.data.order - b.data.order);
19+
}
20+
21+
type categories = 'lesson' | 'bonus' | 'homework';
22+
23+
export function pagePath(category?: categories) {
24+
switch (category) {
25+
case 'lesson':
26+
return "lessons/";
27+
case 'bonus':
28+
return "bonus/";
29+
case 'homework':
30+
return "homeworks/";
31+
}
32+
33+
return "lessons/";
34+
}
35+
36+
export function pageTitle(lesson: AstroLesson, category?: categories) {
37+
switch (category) {
38+
case 'lesson':
39+
return `${lessonMarker(lesson.data.state)} ${lesson.data.order}. ${lesson.data.title}`;
40+
case 'bonus':
41+
return lesson.data.title;
42+
case 'homework':
43+
return lesson.data.title;
44+
}
45+
46+
return `${lessonMarker(lesson.data.state)} ${lesson.data.order}. ${lesson.data.title}`;
47+
}
48+
49+
export function fullLinkText(category?: categories) {
50+
switch (category) {
51+
case 'lesson':
52+
return "view full lesson";
53+
case 'bonus':
54+
return "view full lesson";
55+
case 'homework':
56+
return "view full content";
57+
}
58+
59+
return "view full content";
60+
}
61+
1662
export const baseUrl = import.meta.env.BASE_URL.endsWith('/') ? import.meta.env.BASE_URL : import.meta.env.BASE_URL + '/';
1763
1864
export function lessonMarker(state: keyof LessonState) {
19-
switch (state) {
20-
case 'covered':
21-
return '☑️'
22-
case 'upcoming':
23-
return ''
65+
switch (state) {
66+
case 'covered':
67+
return '☑️'
68+
case 'upcoming':
69+
return ''
2470
case 'draft':
2571
return '🚧 '
2672
}

0 commit comments

Comments
 (0)