Skip to content

Commit

Permalink
chore: deprecating old path aliases and now @/ is src
Browse files Browse the repository at this point in the history
  • Loading branch information
Eveeifyeve committed Sep 5, 2024
1 parent b74c94e commit c37c42d
Show file tree
Hide file tree
Showing 21 changed files with 120 additions and 130 deletions.
94 changes: 45 additions & 49 deletions astro.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,61 +7,57 @@ import { defineConfig } from "astro/config";

// import pageInsight from "astro-page-insight";
import astroExpressiveCode, {
ExpressiveCodeTheme,
ExpressiveCodeTheme,
} from "astro-expressive-code";

const customStyle = fs.readFileSync(
new URL("./src/styles/codeTheme.jsonc", import.meta.url),
"utf8",
new URL("./src/styles/codeTheme.jsonc", import.meta.url),
"utf8"
);
const customTheme = ExpressiveCodeTheme.fromJSONString(customStyle);

// https://astro.build/config
export default defineConfig({
site: "https://teaclient.net",
server: {
port: 7053,
},
integrations: [
astroExpressiveCode({
themes: [customTheme],
}),
mdx(),
metaTags(),
sitemap({
filter: (page) =>
page !== `${import.meta.env.SITE}/staffhandbook-13-4-24`,
customPages: ["docs.teaclient.net"],
}),
tailwind({
nesting: true,
applyBaseStyles: true,
}),
// pageInsight(),
],
redirects: {
// Resources
"/discord": "https://discord.gg/ejFTe4Hfnc",
"/github": "https://github.com/TeaClientMC",
"/roadmap": "https://github.com/orgs/TeaClientMC/projects/3",
// Partner Networks
"/dropps": "https://discord.gg/qFarXHT32J",
// Easter-Eggs
"/klaas": "https://klaas.tiiny.site/",
},
vite: {
resolve: {
alias: {
"@layout": "src/layouts",
"@component": "src/components",
"@scripts": "src/scripts",
"@styles": "src/styles",
"@assets": "src/assets",
},
},
build: {
minify: true,
sourcemap: false,
},
},
site: "https://teaclient.net",
server: {
port: 7053,
},
integrations: [
astroExpressiveCode({
themes: [customTheme],
}),
mdx(),
metaTags(),
sitemap({
filter: (page) =>
page !== `${import.meta.env.SITE}/staffhandbook-13-4-24`,
customPages: ["docs.teaclient.net"],
}),
tailwind({
nesting: true,
applyBaseStyles: true,
}),
// pageInsight(),
],
redirects: {
// Resources
"/discord": "https://discord.gg/ejFTe4Hfnc",
"/github": "https://github.com/TeaClientMC",
"/roadmap": "https://github.com/orgs/TeaClientMC/projects/3",
// Partner Networks
"/dropps": "https://discord.gg/qFarXHT32J",
// Easter-Eggs
"/klaas": "https://klaas.tiiny.site/",
},
vite: {
resolve: {
alias: {
"@": "src/",
},
},
build: {
minify: true,
sourcemap: false,
},
},
});
2 changes: 0 additions & 2 deletions src/components/footer.astro
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
---
import { Image } from "astro:assets";
import DiscordSVG from "@assets/svgs/Discord.svg";
import GithubSVG from "@assets/svgs/Github-white.svg";
import { twMerge } from "tailwind-merge";
interface Props {
Expand Down
2 changes: 1 addition & 1 deletion src/content/wiki/developers/api/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ title: "API Notices & Info"
desc: "Notices and Information about the API"
---

import TabComponent from "../../../../components/TabComponent.astro";
import TabComponent from "@/";

export const tabData = [
{
Expand Down
8 changes: 4 additions & 4 deletions src/layouts/documents.astro
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
import Footer from "@component/footer.astro";
import Head from "@component/head.astro";
import Header from "@component/header.astro";
import Footer from "@/components/footer.astro";
import Head from "@/components/head.astro";
import Header from "@/components/header.astro";
import { twMerge } from "tailwind-merge";
import "../styles/style.css";
Expand All @@ -24,7 +24,7 @@ const { title, className, desc, banner } = Astro.props;
<Header />
<div
class={twMerge(
`flex h-full text-white mt-4 mx-[1%] bg-[var(--nav-color)] backdrop-blur-[100px] rounded-lg ${className}`,
`flex h-full text-white mt-4 mx-[1%] bg-[var(--nav-color)] backdrop-blur-[100px] rounded-lg ${className}`
)}
>
<slot />
Expand Down
6 changes: 3 additions & 3 deletions src/layouts/error.astro
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
const { errorNumber: errorNumberProp, Message } =
Astro.props.frontmatter || Astro.props;
import Footer from "@component/footer.astro";
import Footer from "@/componentss/footer.astro";
// Components
import Head from "@component/head.astro";
import Header from "@component/header.astro";
import Head from "@/componentss/head.astro";
import Header from "@/componentss/header.astro";
// Styles
import "../styles/style.css";
Expand Down
6 changes: 3 additions & 3 deletions src/layouts/layout.astro
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
import Footer from "@component/footer.astro";
import Head from "@component/head.astro";
import Header from "@component/header.astro";
import Footer from "@/componentss/footer.astro";
import Head from "@/componentss/head.astro";
import Header from "@/componentss/header.astro";
import { twMerge } from "tailwind-merge";
import "../styles/style.css";
Expand Down
12 changes: 6 additions & 6 deletions src/layouts/newspost.astro
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
---
import type { CollectionEntry } from "astro:content";
import DiscordSVG from "@assets/svgs/Discord.svg";
import GithubSVG from "@assets/svgs/Github-white.svg";
import Footer from "@component/footer.astro";
import Header from "@component/header.astro";
import Head from "@component/head.astro";
import DiscordSVG from "@/assets/svgs/Discord.svg";
import GithubSVG from "@/assets/svgs/Github-white.svg";
import Footer from "@/components/footer.astro";
import Header from "@/components/header.astro";
import Head from "@/components/head.astro";
import { twMerge } from "tailwind-merge";
import { getEntry } from "astro:content";
import { Image } from "astro:assets";
Expand All @@ -29,7 +29,7 @@ const Sociallogosizes = 24;
<Header />
<div
class={twMerge(
`h-full text-[var(--text)] my-[5%] mx-[5%] bg-[var(--nav-color)] rounded-lg ${className}`,
`h-full text-[var(--text)] my-[5%] mx-[5%] bg-[var(--nav-color)] rounded-lg ${className}`
)}
>
<div
Expand Down
6 changes: 3 additions & 3 deletions src/layouts/wikiContent.astro
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
import Footer from "@component/footer.astro";
import Head from "@component/head.astro";
import Header from "@component/header.astro";
import Footer from "@/componentss/footer.astro";
import Head from "@/componentss/head.astro";
import Header from "@/componentss/header.astro";
import { twMerge } from "tailwind-merge";
import "../styles/style.css";
Expand Down
4 changes: 2 additions & 2 deletions src/pages/_privacy.astro
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
import Layout from "@layout/documents.astro";
import Layout from "@/layouts/documents.astro";
---

<Layout> </Layout>
<Layout />
38 changes: 21 additions & 17 deletions src/pages/apply/[apply].astro
Original file line number Diff line number Diff line change
@@ -1,52 +1,56 @@
---
import Layout from "@layout/layout.astro";
import Layout from "@/layouts/layout.astro";
const { apply } = Astro.params;
export async function getStaticPaths() {
return [{ params: { apply: "staff" } }, { params: { apply: "team" } }];
return [{ params: { apply: "staff" } }, { params: { apply: "team" } }];
}
let title = "";
if (apply === "staff") {
title = "Staff Application";
title = "Staff Application";
} else if (apply === "teams") {
title = "Teams Application";
title = "Teams Application";
} else {
title = "Invalid application";
title = "Invalid application";
}
---

<Layout title={title}>
{
apply === "staff"
? (
apply === "staff" ? (
<div class="box" style="position: relative;">
<iframe
src="https://docs.google.com/forms/d/e/1FAIpQLScOuyHA9sX_fW3bijeuDOoUWVIPLptbuyavkZ4XC__8DTHLSg/viewform?embedded=true"
width="640"
height="1445"
class="bg-transparent border-none"
>Loading…</iframe>
>
Loading…
</iframe>
<br />
<a href="/apply" style="position: absolute; bottom: 20px; right: 20px;"
>Go Back</a>
<a href="/apply" style="position: absolute; bottom: 20px; right: 20px;">
Go Back
</a>
</div>
)
: apply === "team"
? (
) : apply === "team" ? (
<div class="box" style="position: relative;">
<iframe
src="https://docs.google.com/forms/d/e/1FAIpQLSfy0okWtCh1xMZ5YOrQYD-PYKLog3SzAUEYIfvsIE418pdiDA/viewform?embedded=true"
width="640"
height="1445"
class="bg-transparent border-none"
>Loading…</iframe>
>
Loading…
</iframe>
<br />
<a href="/apply" style="position: absolute; bottom: 20px; right: 20px;"
>Go Back</a>
<a href="/apply" style="position: absolute; bottom: 20px; right: 20px;">
Go Back
</a>
</div>
) : (
<div>Error: Invalid application type</div>
)
: <div>Error: Invalid application type</div>
}
</Layout>
8 changes: 5 additions & 3 deletions src/pages/apply/index.astro
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
import Layout from "@layout/layout.astro";
import Layout from "@/layouts/layout.astro";
---

<Layout
Expand All @@ -20,12 +20,14 @@ import Layout from "@layout/layout.astro";
<a
href="/apply/staff"
class="flex text-white w-40 gap-6 bg-clip-text rounded-sm hover:text-transparent active:text-transparent transition duration-200 bg-gradient-to-r from-[#6cff85] to-pink-300"
>Staff Applications</a>
>Staff Applications</a
>
<div class="border-l-2 border-gray-300 h-6 mx-3"></div>
<a
href="/apply/team"
class="text-white w-40 bg-clip-text rounded-sm hover:text-transparent active:text-transparent transition duration-200 bg-gradient-to-r from-[#6e2bec] to-pink-500"
>Team Applications</a>
>Team Applications</a
>
</div>
<br />
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/pages/community.astro
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
import Layout from "@layout/layout.astro";
import Layout from "@/layouts/layout.astro";
const socials = [
{
Expand Down
6 changes: 3 additions & 3 deletions src/pages/index.astro
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
import CustomImage from "@component/CustomImage.astro";
import HeroImage from "@component/HeroImage.astro";
import Layout from "@layout/layout.astro";
import CustomImage from "@/componentss/CustomImage.astro";
import HeroImage from "@/componentss/HeroImage.astro";
import Layout from "@/layouts/layout.astro";
---

<Layout
Expand Down
16 changes: 9 additions & 7 deletions src/pages/join.astro
Original file line number Diff line number Diff line change
@@ -1,21 +1,23 @@
---
import Layout from "@layout/layout.astro";
import Layout from "@/layouts/layout.astro";
---

<Layout>
<div class="box">
<div class="text-container">
<h1 class="Title">Wellcome To Joining TeaClient</h1>
<br />
<a>We offer many positions Like Joining the team behind making the Client
or moderating server to keep the socials a safe friendly enviroment.</a>
<a
>We offer many positions Like Joining the team behind making the Client
or moderating server to keep the socials a safe friendly enviroment.</a
>
</div>
</div>
</Layout>

<style>
.Title {
color: white;
justify-self: center;
}
.Title {
color: white;
justify-self: center;
}
</style>
12 changes: 6 additions & 6 deletions src/pages/news/[...slug].astro
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
---
import Layout from "@layout/newspost.astro";
import Layout from "@/layouts/newspost.astro";
import { getCollection } from "astro:content";
import type { CollectionEntry } from "astro:content";
export async function getStaticPaths() {
const posts = await getCollection("news");
return posts.map((post) => ({
params: { slug: post.slug },
props: { ...post },
}));
const posts = await getCollection("news");
return posts.map((post) => ({
params: { slug: post.slug },
props: { ...post },
}));
}
type Props = CollectionEntry<"news">;
const post = Astro.props;
Expand Down
2 changes: 1 addition & 1 deletion src/pages/news/index.astro
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
import { Image } from "astro:assets";
import Layout from "@layout/layout.astro";
import Layout from "@/layouts/layout.astro";
import { getCollection } from "astro:content";
const newsitems = await getCollection("news");
---
Expand Down
2 changes: 1 addition & 1 deletion src/pages/readme.mdx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import Layout from "@layout/layout.astro";
import Layout from "@/layouts/layout.astro";


<Layout>
Expand Down
Loading

0 comments on commit c37c42d

Please sign in to comment.