Initial design based off original website, some things still to do
This commit is contained in:
@@ -1,22 +0,0 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width" />
|
||||
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
|
||||
<meta name="generator" content={Astro.generator} />
|
||||
<title>Astro Basics</title>
|
||||
</head>
|
||||
<body>
|
||||
<slot />
|
||||
</body>
|
||||
</html>
|
||||
|
||||
<style>
|
||||
html,
|
||||
body {
|
||||
margin: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
</style>
|
36
src/layouts/MainHead.astro
Normal file
36
src/layouts/MainHead.astro
Normal file
@@ -0,0 +1,36 @@
|
||||
---
|
||||
import site from "../data/site";
|
||||
|
||||
import { ClientRouter } from "astro:transitions";
|
||||
|
||||
import Analytics from "@components/Analytics.astro";
|
||||
import SEO from "@components/SEO.astro";
|
||||
import ThemeManager from "@components/ThemeManager.astro";
|
||||
|
||||
const { title, subtitle, description } = Astro.props;
|
||||
|
||||
// if a title is provided, use it as follows "title | site.title - site.suffix". If no title is provided, instead do "site.title - site.suffix"
|
||||
const headTitle: string =
|
||||
(title ? `${title}${subtitle ? ` - ${subtitle}` : ""} | ` : "") +
|
||||
(site.title != title ? `${site.title}` : "");
|
||||
const headDescription: string = description || site.description;
|
||||
---
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<meta name="generator" content={Astro.generator} />
|
||||
<title>{headTitle}</title>
|
||||
<meta name="description" content={headDescription} />
|
||||
|
||||
<link rel="icon" type="image/png" href="/favicon.png" />
|
||||
<link rel="apple-touch-icon" href="/favicon.png" />
|
||||
|
||||
<SEO title={headTitle} description={headDescription} />
|
||||
|
||||
<ThemeManager defaultTheme="auto" />
|
||||
|
||||
<Analytics />
|
||||
|
||||
<ClientRouter />
|
||||
</head>
|
43
src/layouts/MainLayout.astro
Normal file
43
src/layouts/MainLayout.astro
Normal file
@@ -0,0 +1,43 @@
|
||||
---
|
||||
interface Props {
|
||||
title?: string;
|
||||
subtitle?: string;
|
||||
description?: string;
|
||||
navbarDisplay?: "normal" | "transparent";
|
||||
}
|
||||
|
||||
import "@/styles/global.css";
|
||||
|
||||
import { getCollection } from "astro:content";
|
||||
import Footer from "@components/Footer.astro";
|
||||
import Navbar from "@components/Navbar.astro";
|
||||
import Player from "@components/Player.astro";
|
||||
import MainHead from "@layouts/MainHead.astro";
|
||||
|
||||
const { title, subtitle, description, navbarDisplay = "normal" } = Astro.props;
|
||||
|
||||
const autoQueuedTracks = (
|
||||
await getCollection("tracks", ({ data }) => data.autoQueue)
|
||||
).sort(
|
||||
(a, b) => (a.data.autoQueue?.order || -1) - (b.data.autoQueue?.order || 1)
|
||||
);
|
||||
---
|
||||
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<MainHead {title} {subtitle} {description} />
|
||||
<body>
|
||||
<Navbar {navbarDisplay} />
|
||||
<main>
|
||||
<slot />
|
||||
</main>
|
||||
<Footer />
|
||||
<Player />
|
||||
</body>
|
||||
</html>
|
||||
|
||||
<script define:vars={{ autoQueuedTracks }}>
|
||||
autoQueuedTracks.map((track, index) => {
|
||||
player_addToPlaylist(player_constructTrack(track.data), false);
|
||||
});
|
||||
</script>
|
Reference in New Issue
Block a user