Set up Astro and Tailwind

This commit is contained in:
Maciej Pędzich 2023-01-01 22:20:44 +01:00
commit 53982cc4b4
13 changed files with 10809 additions and 0 deletions

1
.env Normal file
View File

@ -0,0 +1 @@
NUXT_TELEMETRY_DISABLED=1

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
node_modules

9
.prettierrc Normal file
View File

@ -0,0 +1,9 @@
{
"tabWidth": 2,
"printWidth": 80,
"useTabs": false,
"singleQuote": true,
"arrowParens": "always",
"trailingComma": "none",
"endOfLine": "lf"
}

14
astro.config.mjs Normal file
View File

@ -0,0 +1,14 @@
import { defineConfig } from 'astro/config';
// https://astro.build/config
import netlify from "@astrojs/netlify/functions";
// https://astro.build/config
import tailwind from "@astrojs/tailwind";
// https://astro.build/config
export default defineConfig({
output: 'server',
adapter: netlify(),
integrations: [tailwind()]
});

10612
package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

30
package.json Normal file
View File

@ -0,0 +1,30 @@
{
"name": "spotify-playlist-archive-website",
"version": "2.0.0",
"description": "Frontend for mackorone's spotify-playlist-archive Git repository",
"scripts": {
"dev": "astro dev",
"start": "astro dev",
"build": "astro build",
"preview": "astro preview"
},
"repository": {
"type": "git",
"url": "git+https://github.com/maciejpedzich/spotify-playlist-archive-website.git"
},
"author": "Maciej Pędzich",
"license": "MIT",
"bugs": {
"url": "https://github.com/maciejpedzich/spotify-playlist-archive-website/issues"
},
"homepage": "https://github.com/maciejpedzich/spotify-playlist-archive-website#readme",
"dependencies": {
"@astrojs/netlify": "^1.3.0",
"@astrojs/tailwind": "^2.1.3",
"@fortawesome/fontawesome-free": "^6.2.1",
"astro": "^1.8.0",
"astro-icon": "^0.8.0",
"daisyui": "^2.46.0",
"tailwindcss": "^3.2.4"
}
}

4
public/robots.txt Normal file
View File

@ -0,0 +1,4 @@
# Example: Allow all bots to scan and index your site.
# Full syntax: https://developers.google.com/search/docs/advanced/robots/create-robots-txt
User-agent: *
Allow: /

View File

@ -0,0 +1,32 @@
---
export interface Props {
class: string;
}
const { class: _class } = Astro.props as Props;
---
<ul class={_class}>
<li>
<a
href="https://github.com/mackorone/spotify-playlist-archive/blob/main/CONTRIBUTING.md#adding-playlists"
target="_blank"
rel="noreferrer noopener"
>
<i class="fa-solid fa-calendar-plus"></i>
Add a playlist
</a>
</li>
<li>
<a href="/get-playlists-id">
<i class="fa-solid fa-link"></i>
Get playlist's ID from URL
</a>
</li>
<li>
<a href="/about">
<i class="fa-solid fa-info-circle"></i>
About
</a>
</li>
</ul>

1
src/env.d.ts vendored Normal file
View File

@ -0,0 +1 @@
/// <reference types="astro/client" />

75
src/layouts/Layout.astro Normal file
View File

@ -0,0 +1,75 @@
---
import '@fortawesome/fontawesome-free/css/all.min.css';
import NavItems from '../components/NavItems.astro';
interface Props {
title: string;
}
const { title } = Astro.props;
---
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="generator" content={Astro.generator} />
<meta name="theme-color" content="#1EB854" />
<link rel="canonical" href="https://spotifyplaylistarchive.com" />
<title>{title} - Spotify Playlist Archive</title>
<meta
name="description"
content="Browse past versions of thousands of Spotify playlists saved over time"
/>
<meta name="theme-color" content="#1EB854" />
<meta property="og:type" content="website" />
<meta property="og:url" content="https://spotifyplaylistarchive.com" />
<meta property="og:title" content="Spotify Playlist Archive" />
<meta
property="og:description"
content="Browse past versions of thousands of Spotify playlists saved over time"
/>
<meta property="twitter:card" content="summary" />
<meta property="twitter:url" content="https://spotifyplaylistarchive.com" />
<meta name="twitter:creator" content="@MaciejPedzich" />
<meta property="twitter:title" content="Spotify Playlist Archive" />
<meta
property="twitter:description"
content="Browse past versions of thousands of Spotify playlists saved over time"
/>
</head>
<body class="w-screen h-screen">
<header
class="navbar bg-base-300 fixed top-0 w-full z-50 border-b-[1px] border-gray-600"
>
<div class="navbar-start">
<div class="lg:flex-none flex-1">
<a
href="/"
class="lg:mx-4 mx-0 btn btn-ghost normal-case text-lg whitespace-nowrap overflow-hidden"
>
Spotify Playlist Archive
</a>
</div>
<div class="lg:flex hidden">
<NavItems class="menu menu-horizontal p-0" />
</div>
</div>
<div class="navbar-end lg:hidden">
<div class="dropdown dropdown-end">
<label tabindex="0" class="btn btn-square btn-ghost">
<i class="fa-solid fa-bars text-xl"></i>
</label>
<NavItems
class="menu menu-compact dropdown-content mt-3 p-2 shadow bg-base-100 rounded-box w-52"
/>
</div>
</div>
</header>
<main class="w-full h-full">
<slot />
</main>
</body>
</html>

9
src/pages/index.astro Normal file
View File

@ -0,0 +1,9 @@
---
import Layout from '../layouts/Layout.astro';
---
<Layout title="Home">
<div class="w-full h-full flex justify-center items-center">
<h1 class="p-4 font-bold text-5xl text-center">Spotify Playlist Archive</h1>
</div>
</Layout>

18
tailwind.config.cjs Normal file
View File

@ -0,0 +1,18 @@
/** @type {import('tailwindcss').Config} */
module.exports = {
content: ['./src/**/*.{astro,html,js,jsx,md,mdx,svelte,ts,tsx,vue}'],
plugins: [require('daisyui')],
daisyui: {
themes: [
{
light: {
...require('daisyui/src/colors/themes')['[data-theme=garden]']
},
dark: {
...require('daisyui/src/colors/themes')['[data-theme=forest]'],
'primary-content': '#000000'
}
}
]
}
};

3
tsconfig.json Normal file
View File

@ -0,0 +1,3 @@
{
"extends": "astro/tsconfigs/strict",
}