Skip to content

Commit 0ad805b

Browse files
committed
feat: header styling
1 parent 7b937a9 commit 0ad805b

4 files changed

Lines changed: 41 additions & 3 deletions

File tree

‎config.toml‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,8 @@ theme = "catppuccin-mocha"
1414

1515
[extra]
1616
# Put all your custom variables here
17+
links = [
18+
{ url = "/links", label = "Downloads"},
19+
{ url = "https://docs.getapollo.dev", label = "Docs"},
20+
{ url = "https://docs.getapollo.dev/posts", label = "Blog"}
21+
]

‎sass/_header.scss‎

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
@use 'variables' as *;
2+
3+
header {
4+
nav, div.links {
5+
justify-content: space-between;
6+
display: flex;
7+
vertical-align: middle;
8+
9+
a#header-home-link {
10+
display: flex;
11+
}
12+
13+
a.header-link {
14+
text-decoration: none;
15+
padding: 6px 12px;
16+
font-weight: 700;
17+
}
18+
}
19+
}

‎sass/style.scss‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
@use 'fonts';
22
@use 'variables';
33

4+
@use 'header';
45
@use 'body';
56
@use 'footer';

‎templates/base.html‎

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,24 @@
1313
<header class="header">
1414
<div class="content">
1515
<nav>
16-
<a>Apollo</a>
16+
<a
17+
{% if current_url | default(value="/") | trim_end_matches(pat='/') | safe == get_url(path='/') %}
18+
class="header-link active"
19+
{% else %}
20+
class="header-link"
21+
{% endif %}
22+
id="header-home-link" href="/">Apollo</a>
1723

1824
<div class="links">
19-
<a href="/download/">Download</a>
20-
<a href="https://docs.getapollo.dev/">Documentation</a>
25+
{% for link in config.extra.links %}
26+
<a
27+
{% if current_url | default(value="/") | trim_end_matches(pat='/') | safe == get_url(path=link.url) %}
28+
class="header-link active"
29+
{% else %}
30+
class="header-link"
31+
{% endif %}
32+
href="{{link.url}}">{{ link.label }}</a>
33+
{% endfor %}
2134
</div>
2235
</nav>
2336
</div>

0 commit comments

Comments
 (0)