Skip to content

Commit fe52184

Browse files
committed
fix: don't show footer components in 404
1 parent 4f1db82 commit fe52184

3 files changed

Lines changed: 24 additions & 14 deletions

File tree

astro.config.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ export default defineConfig({
3232
"./src/styles/tools.css",
3333
],
3434
components: {
35-
Footer: "./src/components/Footer.astro",
35+
Footer: "./src/components/footer.astro",
3636
},
3737
title: "Tinyauth",
3838
credits: true,
Lines changed: 23 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,23 +4,33 @@ import LastUpdated from "@astrojs/starlight/components/LastUpdated.astro";
44
import Pagination from "starlight-theme-rapide/overrides/Pagination.astro";
55
import { Icon } from "@astrojs/starlight/components";
66
import config from "virtual:starlight/user-config";
7-
import AskDosu from "./AskDosu.astro";
7+
import AskDosu from "./ask-dosu.astro";
8+
9+
const status = Astro.response.status;
10+
const showFooterComponents = status === 200;
811
---
912

1013
<footer class="sl-flex">
11-
<div class="meta sl-flex">
12-
<AskDosu />
13-
<EditLink />
14-
<LastUpdated />
15-
</div>
16-
<Pagination />
17-
1814
{
19-
config.credits && (
20-
<a class="kudos sl-flex" href="https://starlight.astro.build">
21-
<Icon name={"starlight"} />{" "}
22-
{Astro.locals.t("builtWithStarlight.label")}
23-
</a>
15+
showFooterComponents && (
16+
<>
17+
<div class="meta sl-flex">
18+
<AskDosu />
19+
<EditLink />
20+
<LastUpdated />
21+
</div>
22+
<Pagination />
23+
24+
{config.credits && (
25+
<a
26+
class="kudos sl-flex"
27+
href="https://starlight.astro.build"
28+
>
29+
<Icon name={"starlight"} />{" "}
30+
{Astro.locals.t("builtWithStarlight.label")}
31+
</a>
32+
)}
33+
</>
2434
)
2535
}
2636
</footer>

0 commit comments

Comments
 (0)