Skip to content

Commit b16c651

Browse files
committed
website: add status badges and category pills
Add a content-before partial that renders a colored status badge (wishlist=blue, in-progress=yellow, completed=green) and clickable category pills at the top of each feature page. Completed items also show their commit SHA. Update _custom.scss with the badge, pill, and typography styles. Slightly widen the sidebar and TOC in _variables.scss. Signed-off-by: Christian Brauner <brauner@kernel.org>
1 parent df6d25e commit b16c651

3 files changed

Lines changed: 92 additions & 6 deletions

File tree

website/assets/_custom.scss

Lines changed: 71 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,73 @@
1-
nav>ul:last-of-type>li:last-child::before {
2-
content: "";
1+
// Status badges
2+
.status-badge {
33
display: inline-block;
4-
margin: 0.5em 0;
4+
padding: 0.15em 0.6em;
5+
font-size: 0.8em;
6+
font-weight: 600;
7+
border-radius: 4px;
8+
margin-bottom: 0.5em;
9+
text-transform: uppercase;
10+
letter-spacing: 0.03em;
11+
}
12+
13+
.status-in-progress {
14+
background-color: #fff3cd;
15+
color: #856404;
16+
}
17+
18+
.status-wishlist {
19+
background-color: #d1ecf1;
20+
color: #0c5460;
21+
}
22+
23+
.status-completed {
24+
background-color: #d4edda;
25+
color: #155724;
26+
}
27+
28+
// Category pills
29+
.category-pills {
30+
margin-bottom: 1em;
31+
}
32+
33+
.category-pill {
34+
display: inline-block;
35+
padding: 0.1em 0.5em;
36+
font-size: 0.75em;
37+
border-radius: 3px;
38+
margin-right: 0.3em;
39+
margin-bottom: 0.3em;
40+
background-color: var(--gray-100);
41+
color: var(--gray-500);
42+
text-decoration: none;
43+
44+
&:hover {
45+
background-color: var(--gray-200);
46+
text-decoration: none;
47+
}
48+
}
49+
50+
// Separator before the last menu item
51+
.book-menu nav > ul > li:last-child {
52+
border-top: 1px solid var(--gray-200);
53+
padding-top: 0.5em;
54+
margin-top: 0.5em;
55+
}
56+
57+
// Typography refinements
58+
.book-page {
59+
line-height: 1.7;
60+
}
61+
62+
.markdown h1 {
63+
margin-top: 0;
64+
}
65+
66+
// Commit reference styling
67+
.commit-ref {
68+
font-family: monospace;
69+
font-size: 0.85em;
70+
background-color: var(--gray-100);
71+
padding: 0.15em 0.4em;
72+
border-radius: 3px;
573
}

website/assets/_variables.scss

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
$body-min-width: 20rem;
22
$container-max-width: 110rem;
3-
4-
$menu-width: 15rem;
5-
$toc-width: 15rem;
3+
$menu-width: 16rem;
4+
$toc-width: 16rem;
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{{ with .Params.status }}
2+
{{ $label := . }}
3+
{{ if eq . "in-progress" }}{{ $label = "In Progress" }}{{ end }}
4+
{{ if eq . "wishlist" }}{{ $label = "Wishlist" }}{{ end }}
5+
{{ if eq . "completed" }}{{ $label = "Completed" }}{{ end }}
6+
<span class="status-badge status-{{ . }}">{{ $label }}</span>
7+
{{ end }}
8+
9+
{{ with .Params.categories }}
10+
<div class="category-pills">
11+
{{ range . }}
12+
<a class="category-pill" href='{{ "/categories/" | relURL }}{{ . | urlize }}/'>{{ . }}</a>
13+
{{ end }}
14+
</div>
15+
{{ end }}
16+
17+
{{ with .Params.commit }}
18+
<p><span class="commit-ref">{{ . }}</span></p>
19+
{{ end }}

0 commit comments

Comments
 (0)