Skip to content

Commit 0dc61ed

Browse files
committed
fix: align docs page with homepage design
1 parent ed61aee commit 0dc61ed

3 files changed

Lines changed: 377 additions & 256 deletions

File tree

docs/src/pages/docs/[...slug].astro

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
import BaseLayout from '../../layouts/BaseLayout.astro';
33
import '../../styles/docs.css';
4-
import { SECTION_CATEGORIES, SECTION_ORDER } from './sidebar.config';
4+
import { SECTION_CATEGORIES, SECTION_ORDER } from '../../lib/docs-sidebar.config';
55
66
const SLUG_LABEL: Record<string, string> = {
77
home: 'Home',
@@ -58,6 +58,7 @@ const title = isRoot
5858
: `rinha2-back-end-rust | ${SLUG_LABEL[requestedSlug ?? ''] ?? 'Documentation'}`;
5959
const description = 'Documentation for the Rust/Actix-web 4 implementation of the Rinha de Backend 2024/Q1 challenge.';
6060
61+
const homeHref = import.meta.env.BASE_URL || '/';
6162
const docsBase = Astro.site
6263
? new URL(Astro.url.pathname.replace(/\/docs\/.*/, '/docs/'), Astro.site).href.replace(/\/$/, '')
6364
: Astro.url.pathname.replace(/\/docs\/.*/, '/docs/').replace(/\/$/, '');
@@ -81,8 +82,13 @@ const docsBase = Astro.site
8182

8283
<aside class="sidebar" id="sidebar">
8384
<div class="sidebar-header">
84-
<div class="repo-title">rinha2-back-end-rust</div>
85-
<p class="repo-description">Rust/Actix-web 4 banking API under strict resource constraints.</p>
85+
<a class="repo-mark" href={homeHref} aria-label="Back to homepage">
86+
<span class="repo-sigil">R2</span>
87+
<span>
88+
<span class="repo-title">rinha2-back-end-rust</span>
89+
<span class="repo-description">Rust/Actix-web 4 banking API under strict resource constraints.</span>
90+
</span>
91+
</a>
8692
<input
8793
type="text"
8894
class="search-box"
@@ -118,7 +124,7 @@ const docsBase = Astro.site
118124
</div>
119125

120126
<div class="sidebar-footer">
121-
<a href="/">← Back to Home</a>
127+
<a class="back-home" href={homeHref}>← Main homepage</a>
122128
<a href="https://github.com/jonathanperis/rinha2-back-end-rust" target="_blank" rel="noopener noreferrer">GitHub</a>
123129
</div>
124130
</aside>

0 commit comments

Comments
 (0)