Skip to content

Commit 8902ecf

Browse files
committed
chore: nav based on menu
Signed-off-by: Lorenzo Fontana <[email protected]>
1 parent 3af92cf commit 8902ecf

File tree

10 files changed

+58
-15
lines changed

10 files changed

+58
-15
lines changed

config.yaml

+12-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
baseURL: "http://example.org/"
1+
baseURL: "https://workshop.bpf.sh/"
22
languageCode: "en-us"
33
title: "BPF Workshop"
44
theme: "workshop"
@@ -8,23 +8,34 @@ menu:
88
main:
99
- identifier: introduction
1010
weight: 100
11+
title: "Introduction"
1112
- identifier: program-types
1213
weight: 200
14+
title: "eBPF Program types"
1315
- identifier: bpf-vm
1416
weight: 300
17+
title: "The BPF in Kernel Virtual Machine"
1518
- identifier: bcc
1619
weight: 400
20+
title: "BCC"
1721
- identifier: bpftrace
1822
weight: 500
23+
title: "bpftrace"
1924
- identifier: gobpf
2025
weight: 600
26+
title: "gobpf"
2127
- identifier: kubernetes
2228
weight: 700
29+
title: "eBPF and Kubernetes"
2330
- identifier: clang
2431
weight: 800
32+
title: "Clang BPF backend"
2533
- identifier: tools
2634
weight: 900
35+
title: "Any other tools?"
2736
- identifier: networking
2837
weight: 1000
38+
title: "eBPF and Linux Networking"
2939
- identifier: security
3040
weight: 1100
41+
title: "Linux Kernel security and eBPF"

content/33-environment-tmux-cheat.md

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
---
2+
title: "environment-tmux-cheat"
3+
weight: 33
4+
---
5+
6+
# Tmux cheatsheet
7+
8+
[Tmux](https://en.wikipedia.org/wiki/Tmux) is a terminal multiplexer like `screen`.
9+
10+
*You don't have to use it or even know about it to follow along.
11+
<br/>
12+
But some of us like to use it to switch between terminals.
13+
<br/>
14+
It comes preinstalled in the Vagrant machine we provided*
15+
16+
- Ctrl-b c → creates a new window
17+
- Ctrl-b n → go to next window
18+
- Ctrl-b p → go to previous window
19+
- Ctrl-b " → split window top/bottom
20+
- Ctrl-b % → split window left/right
21+
- Ctrl-b Alt-1 → rearrange windows in columns
22+
- Ctrl-b Alt-2 → rearrange windows in rows
23+
- Ctrl-b arrows → navigate to other windows
24+
- Ctrl-b d → detach session
25+
- tmux attach → reattach to session
26+

content/43-toc.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@ title: "toc"
33
weight: 43
44
---
55

6-
## TOC
6+
# Table of content
77

8-
TODO
8+
{{< toc >}}

content/999999-thanks.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ class: extra-details
88

99
- Thanks to all the eBPF authors and tools makers for their awesome work on it;
1010
- Many thanks to [Jérôme Petazzoni](https://github.com/jpetazzo), we adapted Jérôme's template
11-
from [container.training](https://container.training) to Hugo;
11+
from [container.training](https://container.training) to Hugo, we also used the terminals setup instructions and the tmux cheatsheet from that deck!
1212
- Thanks to the [remark](https://github.com/gnab/remark) authors for their work on it, it's the tool
1313
we use to generate the slides;
1414
- Thanks to the [hugo](https://gohugo.io/) authors, for the awesome static site generator;

content/introduction/101-introduction.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: "introduction"
2+
title: "introduction-content"
33
weight: 101
44
---
55
# Introduction

content/introduction/intro.md

-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
title: "introduction"
33
weight: 100
44
class: title
5-
navTitle: "Introduction"
65
---
76
{{< nav >}}
87

content/program-types/intro.md

-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
title: "program-types"
33
weight: 200
44
class: title
5-
navTitle: "eBPF Program types"
65
---
76
{{< nav >}}
87

content/security/intro.md

-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
title: "security"
33
weight: 1100
44
class: title
5-
navTitle: "Linux Kernel security and eBPF"
65
---
76
{{< nav >}}
87

themes/workshop/layouts/shortcodes/nav.html

+12-7
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,26 @@
1-
{{ if .Page.Params.navTitle }}
2-
{{ .Page.Params.navTitle }}
3-
{{ else }}
4-
.red[No title provided, use `navTitle` in your page]
5-
{{ end }}
61
{{ if not .Page.Title }}
72
.red[error rendering the nav menu], add
83

94
```
105
title: "your-id"
116
```
127
To the page.
13-
It should match what you did put in the menu in the config file!
8+
It should match what the identifier you did put in the menu in the config file!
149

1510
{{ end }}
1611

17-
1812
{{ $currentPage := .Page.Title }}
13+
14+
{{ $navTitle := "Title not provided" }}
15+
{{ range .Site.Menus.main.ByWeight }}
16+
{{ if eq .Identifier $currentPage}}
17+
{{ if .Title }}
18+
{{ $navTitle = .Title }}
19+
{{ end }}
20+
{{ end }}
21+
{{ end }}
22+
23+
{{ $navTitle }}
1924
{{ $previous := "" }}
2025
{{ $next := "" }}
2126

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{{ range .Site.Menus.main.ByWeight }}- [{{ .Identifier }}](#{{.Identifier}})
2+
{{ end }}
3+
4+

0 commit comments

Comments
 (0)