Skip to content

Commit 0b294df

Browse files
committed
feat: override Footer with PokeFooter component
https://starlight.astro.build/guides/overriding-components/
1 parent 228bafa commit 0b294df

File tree

2 files changed

+58
-0
lines changed

2 files changed

+58
-0
lines changed

astro.config.mjs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ export default defineConfig({
99
integrations: [
1010
starlight({
1111
title: 'PokéAPI',
12+
components: {
13+
Footer: './src/components/PokeFooter.astro',
14+
},
1215
customCss: [
1316
'./src/styles/global.css',
1417
],

src/components/PokeFooter.astro

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
---
2+
import type { Props } from '@astrojs/starlight/props'
3+
import Pagination from '@astrojs/starlight/components/Pagination.astro'
4+
---
5+
6+
<nav class="pb-12">
7+
<Pagination {...Astro.props}></Pagination>
8+
</nav>
9+
<footer
10+
class="
11+
fixed bottom-0 left-0
12+
w-full px-12 py-4 mt-12
13+
flex items-center gap-8 place-content-between
14+
bg-(--sl-color-black) border-t border-t-(--sl-color-accent)
15+
"
16+
>
17+
<small>
18+
Created by <a href="https://github.com/phalt"><strong>Paul Hallett</strong></a> and other <a
19+
href="https://github.com/PokeAPI/pokeapi/graphs/contributors"
20+
>PokéAPI contributors</a> around the world. Pokémon and Pokémon character names are trademarks of Nintendo.
21+
</small>
22+
<a href="https://pokeapi.statuspage.io/"><img
23+
alt="Status"
24+
src="https://img.shields.io/badge/dynamic/json?color=blue&label=status&query=%24.status.description&url=https%3A%2F%2Fzlfyqp3hlvly.statuspage.io%2Fapi%2Fv2%2Fsummary.json"
25+
/></a>
26+
</footer>
27+
28+
<style>
29+
.meta {
30+
gap: 0.75rem 3rem;
31+
justify-content: space-between;
32+
flex-wrap: wrap;
33+
margin-top: 3rem;
34+
font-size: var(--sl-text-sm);
35+
color: var(--sl-color-gray-3);
36+
}
37+
.meta > :global(p:only-child) {
38+
margin-inline-start: auto;
39+
}
40+
41+
.kudos {
42+
align-items: center;
43+
gap: 0.5em;
44+
margin: 1.5rem auto;
45+
font-size: var(--sl-text-xs);
46+
text-decoration: none;
47+
color: var(--sl-color-gray-3);
48+
}
49+
.kudos :global(svg) {
50+
color: var(--sl-color-orange);
51+
}
52+
.kudos:hover {
53+
color: var(--sl-color-white);
54+
}
55+
</style>

0 commit comments

Comments
 (0)