Skip to content

Commit 462422f

Browse files
committed
fix: formatting issues
1 parent 65ef490 commit 462422f

File tree

15 files changed

+176
-179
lines changed

15 files changed

+176
-179
lines changed

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
# Our Website
22

3-
43
Our Home for our Website.

astro.config.ts

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import react from "@astrojs/react";
22
import starlight from "@astrojs/starlight";
33
import tailwind from "@astrojs/tailwind";
44
import { defineConfig } from "astro/config";
5-
import starlightBlog from 'starlight-blog'
5+
import starlightBlog from "starlight-blog";
66

77
// https://astro.build/config
88
export default defineConfig({
@@ -20,17 +20,19 @@ export default defineConfig({
2020
}),
2121
starlight({
2222
title: "Minecraft-Essentials",
23-
plugins: [starlightBlog({
24-
title: "Minecraft-Essentials Blog",
25-
authors: {
26-
eveeifyeve: {
27-
name: "Eveeifyeve",
28-
title: "Creator of Minecraft-Essentials",
29-
picture: "https://github.com/eveeifyeve.png",
30-
url: "https://eveeifyeve.pages.dev",
31-
}
32-
}
33-
})],
23+
plugins: [
24+
starlightBlog({
25+
title: "Minecraft-Essentials Blog",
26+
authors: {
27+
eveeifyeve: {
28+
name: "Eveeifyeve",
29+
title: "Creator of Minecraft-Essentials",
30+
picture: "https://github.com/eveeifyeve.png",
31+
url: "https://eveeifyeve.pages.dev",
32+
},
33+
},
34+
}),
35+
],
3436
customCss: ["./src/styles/tailwind.css"],
3537
social: {
3638
github: "https://github.com/minecraft-essentials/minecraft-essentials",
@@ -40,7 +42,7 @@ export default defineConfig({
4042
root: {
4143
label: "English",
4244
lang: "en",
43-
}
45+
},
4446
},
4547
sidebar: [
4648
{
@@ -51,7 +53,7 @@ export default defineConfig({
5153
label: "JS Documentation",
5254
badge: {
5355
text: "WIP",
54-
variant: "caution"
56+
variant: "caution",
5557
},
5658
items: [
5759
{
@@ -64,7 +66,7 @@ export default defineConfig({
6466
label: "WASM",
6567
badge: {
6668
text: "WIP",
67-
variant: "danger"
69+
variant: "danger",
6870
},
6971
items: [
7072
{

src/components/PostList.astro

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,10 @@
11
---
22
import { getCollection } from "astro:content";
33
4-
5-
64
const posts = (await getCollection("blog")).sort(
7-
(a, b) =>
8-
new Date(b.data.pubDate).valueOf() - new Date(a.data.pubDate).valueOf()
5+
(a, b) =>
6+
new Date(b.data.pubDate).valueOf() - new Date(a.data.pubDate).valueOf(),
97
);
108
---
119

12-
13-
<div class="blog">
14-
15-
</div>
10+
<div class="blog"></div>
Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
---
2-
import Tabs from './Tabs.astro';
3-
import { TabItem } from '@astrojs/starlight/components';
2+
import Tabs from "./Tabs.astro";
3+
import { TabItem } from "@astrojs/starlight/components";
44
---
55

66
<Tabs group="languages">
7-
<TabItem label='Rust'>
8-
For extended documentation check <a href="/docsrs">docs.rs</a>
9-
<slot name="rs" />
10-
</TabItem>
11-
<TabItem label='TypeScript'>
12-
<slot name="ts" />
13-
</TabItem>
14-
<TabItem label='JavaScript'>
15-
<slot name="js" />
16-
</TabItem>
17-
</Tabs>
7+
<TabItem label="Rust">
8+
For extended documentation check <a href="/docsrs">docs.rs</a>
9+
<slot name="rs" />
10+
</TabItem>
11+
<TabItem label="TypeScript">
12+
<slot name="ts" />
13+
</TabItem>
14+
<TabItem label="JavaScript">
15+
<slot name="js" />
16+
</TabItem>
17+
</Tabs>

src/components/docs/PackageMangerTabs.astro

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -9,34 +9,34 @@ const { js } = Astro.props;
99
---
1010

1111
<Tabs group="package-managers">
12-
{
13-
js ? (
14-
<>
15-
<TabItem label="Bun">
16-
<slot name="bun" />
17-
</TabItem>
18-
<TabItem label="Deno">
19-
<slot name="deno" />
20-
</TabItem>
21-
<TabItem label="Yarn">
22-
<slot name="yarn" />
23-
</TabItem>
24-
<TabItem label="Pnpm">
25-
<slot name="pnpm" />
26-
</TabItem>
27-
<TabItem label="Npm">
28-
<slot name="npm" />
29-
</TabItem>
30-
</>
31-
) : (
32-
<>
33-
<TabItem label="Pip">
34-
<slot name="pip" />
35-
</TabItem>
36-
<TabItem label="Poetry">
37-
<slot name="poetry" />
38-
</TabItem>
39-
</>
40-
)
41-
}
12+
{
13+
js ? (
14+
<>
15+
<TabItem label="Bun">
16+
<slot name="bun" />
17+
</TabItem>
18+
<TabItem label="Deno">
19+
<slot name="deno" />
20+
</TabItem>
21+
<TabItem label="Yarn">
22+
<slot name="yarn" />
23+
</TabItem>
24+
<TabItem label="Pnpm">
25+
<slot name="pnpm" />
26+
</TabItem>
27+
<TabItem label="Npm">
28+
<slot name="npm" />
29+
</TabItem>
30+
</>
31+
) : (
32+
<>
33+
<TabItem label="Pip">
34+
<slot name="pip" />
35+
</TabItem>
36+
<TabItem label="Poetry">
37+
<slot name="poetry" />
38+
</TabItem>
39+
</>
40+
)
41+
}
4242
</Tabs>

src/components/docs/Tabs.astro

Lines changed: 61 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -1,79 +1,86 @@
11
---
2-
import { Tabs as StarlightTabs } from '@astrojs/starlight/components';
2+
import { Tabs as StarlightTabs } from "@astrojs/starlight/components";
33
44
export interface Props {
55
group?: string;
66
}
77
---
88

99
<astro-docs-tabs data-group={Astro.props.group}>
10-
<StarlightTabs>
11-
<slot />
12-
</StarlightTabs>
10+
<StarlightTabs>
11+
<slot />
12+
</StarlightTabs>
1313
</astro-docs-tabs>
1414

1515
<style>
16-
astro-docs-tabs {
17-
display: block;
18-
}
16+
astro-docs-tabs {
17+
display: block;
18+
}
1919
</style>
2020

2121
<script>
22-
class AstroDocsTabs extends HTMLElement {
23-
tabs: HTMLAnchorElement[];
24-
panels: HTMLElement[];
22+
class AstroDocsTabs extends HTMLElement {
23+
tabs: HTMLAnchorElement[];
24+
panels: HTMLElement[];
2525

26-
constructor() {
27-
super();
26+
constructor() {
27+
super();
2828

29-
const tablist = this.querySelector('[role="tablist"]')!;
30-
const starlightTab = this.querySelector('starlight-tabs')!;
31-
this.tabs = [...tablist.querySelectorAll<HTMLAnchorElement>('[role="tab"]')];
32-
this.panels = [...this.querySelectorAll<HTMLElement>('starlight-tabs > [role="tabpanel"]')];
29+
const tablist = this.querySelector('[role="tablist"]')!;
30+
const starlightTab = this.querySelector("starlight-tabs")!;
31+
this.tabs = [
32+
...tablist.querySelectorAll<HTMLAnchorElement>('[role="tab"]'),
33+
];
34+
this.panels = [
35+
...this.querySelectorAll<HTMLElement>(
36+
'starlight-tabs > [role="tabpanel"]',
37+
),
38+
];
3339

34-
if (!this.dataset.group) return;
40+
if (!this.dataset.group) return;
3541

36-
const newSwitchTab = (a: HTMLAnchorElement, index: number) => {
37-
// @ts-expect-error __proto__ isn't typed
38-
starlightTab.__proto__.switchTab.bind(starlightTab)(a, index);
42+
const newSwitchTab = (a: HTMLAnchorElement, index: number) => {
43+
// @ts-expect-error __proto__ isn't typed
44+
starlightTab.__proto__.switchTab.bind(starlightTab)(a, index);
3945

40-
const starlightTabs = document.querySelectorAll(
41-
`[data-group="${this.dataset.group}"] starlight-tabs`
42-
)!;
43-
starlightTabs.forEach((tab) => {
44-
// @ts-ignore
45-
tab.parentElement.switchTab(
46-
tab.firstElementChild?.firstElementChild?.children.item(index)?.firstElementChild,
47-
index
48-
);
49-
});
46+
const starlightTabs = document.querySelectorAll(
47+
`[data-group="${this.dataset.group}"] starlight-tabs`,
48+
)!;
49+
starlightTabs.forEach((tab) => {
50+
// @ts-ignore
51+
tab.parentElement.switchTab(
52+
tab.firstElementChild?.firstElementChild?.children.item(index)
53+
?.firstElementChild,
54+
index,
55+
);
56+
});
5057

51-
starlightTab.scrollIntoView();
52-
};
53-
// @ts-expect-error starlightTab isn't typed as a custom element
54-
starlightTab.switchTab = newSwitchTab;
55-
}
58+
starlightTab.scrollIntoView();
59+
};
60+
// @ts-expect-error starlightTab isn't typed as a custom element
61+
starlightTab.switchTab = newSwitchTab;
62+
}
5663

57-
// modified version to not scroll on switch (https://github.com/withastro/starlight/blob/201eb88f42069e5e575cba578b9cd6a3dfbbc5a9/packages/starlight/user-components/Tabs.astro#L116)
58-
switchTab(newTab: HTMLAnchorElement | null | undefined, index: number) {
59-
if (!newTab) return;
64+
// modified version to not scroll on switch (https://github.com/withastro/starlight/blob/201eb88f42069e5e575cba578b9cd6a3dfbbc5a9/packages/starlight/user-components/Tabs.astro#L116)
65+
switchTab(newTab: HTMLAnchorElement | null | undefined, index: number) {
66+
if (!newTab) return;
6067

61-
// Mark all tabs as unselected and hide all tab panels.
62-
this.tabs.forEach((tab) => {
63-
tab.removeAttribute('aria-selected');
64-
});
65-
this.panels.forEach((oldPanel) => {
66-
oldPanel.hidden = true;
67-
});
68+
// Mark all tabs as unselected and hide all tab panels.
69+
this.tabs.forEach((tab) => {
70+
tab.removeAttribute("aria-selected");
71+
});
72+
this.panels.forEach((oldPanel) => {
73+
oldPanel.hidden = true;
74+
});
6875

69-
// Show new panel and mark new tab as selected.
70-
const newPanel = this.panels[index];
71-
if (newPanel) newPanel.hidden = false;
72-
// Restore active tab to the default tab order.
73-
newTab.removeAttribute('tabindex');
74-
newTab.setAttribute('aria-selected', 'true');
75-
}
76+
// Show new panel and mark new tab as selected.
77+
const newPanel = this.panels[index];
78+
if (newPanel) newPanel.hidden = false;
79+
// Restore active tab to the default tab order.
80+
newTab.removeAttribute("tabindex");
81+
newTab.setAttribute("aria-selected", "true");
7682
}
83+
}
7784

78-
customElements.define('astro-docs-tabs', AstroDocsTabs);
79-
</script>
85+
customElements.define("astro-docs-tabs", AstroDocsTabs);
86+
</script>

src/components/starlight/SiteTitle.astro

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@ import type { Props } from "@astrojs/starlight/props";
33
import AstrolightSiteTitle from "@astrojs/starlight/components/SiteTitle.astro";
44
55
const items = [
6-
{ name: "Docs", href: "/infomation/intro" },
7-
{ name: "Blog", href: "/blog" },
6+
{ name: "Docs", href: "/infomation/intro" },
7+
{ name: "Blog", href: "/blog" },
88
];
99
1010
function pathsMatch(pathA: string, pathB: string): boolean {
11-
return pathB.includes(pathA);
11+
return pathB.includes(pathA);
1212
}
1313
---
1414

@@ -22,9 +22,7 @@ function pathsMatch(pathA: string, pathB: string): boolean {
2222
items.map((items) => (
2323
<a
2424
href={items.href}
25-
aria-current={
26-
pathsMatch(encodeURI(items.href), Astro.url.pathname) && "page"
27-
}
25+
aria-current={pathsMatch(encodeURI(items.href), Astro.url.pathname) && "page"}
2826
class="no-underline links dark:text-accent-200 text-accent-600"
2927
>
3028
<span class="gap-6">{items.name}</span>
@@ -35,9 +33,9 @@ function pathsMatch(pathA: string, pathB: string): boolean {
3533
</div>
3634

3735
<style>
38-
.separator {
39-
content: "";
40-
border-inline-end: 1px solid var(--sl-color-gray-5);
41-
align-items: center;
42-
}
36+
.separator {
37+
content: "";
38+
border-inline-end: 1px solid var(--sl-color-gray-5);
39+
align-items: center;
40+
}
4341
</style>

0 commit comments

Comments
 (0)