move to astro lol

This commit is contained in:
Lio 2024-10-05 23:53:02 +02:00
parent 3ef69501c7
commit 55b77078c1
26 changed files with 4706 additions and 1257 deletions

26
.gitignore vendored
View file

@ -1,2 +1,24 @@
_site # build output
_cache dist/
# generated types
.astro/
# dependencies
node_modules/
# logs
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
# environment variables
.env
.env.production
# macOS-specific files
.DS_Store
# jetbrains setting folder
.idea/

4
.vscode/extensions.json vendored Normal file
View file

@ -0,0 +1,4 @@
{
"recommendations": ["astro-build.astro-vscode"],
"unwantedRecommendations": []
}

11
.vscode/launch.json vendored Normal file
View file

@ -0,0 +1,11 @@
{
"version": "0.2.0",
"configurations": [
{
"command": "./node_modules/.bin/astro dev",
"name": "Development server",
"request": "launch",
"type": "node-terminal"
}
]
}

View file

@ -1,3 +0,0 @@
{
"deno.enable": true
}

View file

@ -1,5 +0,0 @@
import lumeCMS from "lume/cms/mod.ts";
const cms = lumeCMS();
export default cms;

View file

@ -1,15 +0,0 @@
import lume from "lume/mod.ts";
import tailwindcss from "lume/plugins/tailwindcss.ts";
import sass from "lume/plugins/sass.ts";
import postcss from "lume/plugins/postcss.ts";
const site = lume({
src: "./src",
});
site.use(tailwindcss());
site.use(sass());
site.use(postcss());
export default site;

11
astro.config.mjs Normal file
View file

@ -0,0 +1,11 @@
import { defineConfig } from 'astro/config';
import mdx from '@astrojs/mdx';
import tailwind from '@astrojs/tailwind';
import react from '@astrojs/react';
// https://astro.build/config
export default defineConfig({
integrations: [mdx(), tailwind(), react()]
});

View file

@ -1,17 +0,0 @@
{
"imports": {
"lume/": "https://deno.land/x/lume@v2.3.2/",
"lume/cms/": "https://cdn.jsdelivr.net/gh/lumeland/cms@v0.6.5/"
},
"tasks": {
"lume": "echo \"import 'lume/cli.ts'\" | deno run -A -",
"build": "deno task lume",
"serve": "deno task lume -s",
"cms": "deno task lume cms"
},
"compilerOptions": {
"types": [
"lume/types.ts"
]
}
}

1214
deno.lock generated

File diff suppressed because it is too large Load diff

1
inspiration.md Normal file
View file

@ -0,0 +1 @@
- [Cactus Astro Theme](https://astro-theme-cactus.netlify.app)

25
package.json Normal file
View file

@ -0,0 +1,25 @@
{
"name": "",
"type": "module",
"version": "0.0.1",
"scripts": {
"dev": "astro dev",
"start": "astro dev",
"build": "astro check && astro build",
"preview": "astro preview",
"astro": "astro"
},
"dependencies": {
"@astrojs/check": "^0.9.4",
"@astrojs/mdx": "^3.1.7",
"@astrojs/react": "^3.6.2",
"@astrojs/tailwind": "^5.1.1",
"@types/react": "^18.3.11",
"@types/react-dom": "^18.3.0",
"astro": "^4.15.11",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"tailwindcss": "^3.4.13",
"typescript": "^5.6.2"
}
}

9
public/favicon.svg Normal file
View file

@ -0,0 +1,9 @@
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 128 128">
<path d="M50.4 78.5a75.1 75.1 0 0 0-28.5 6.9l24.2-65.7c.7-2 1.9-3.2 3.4-3.2h29c1.5 0 2.7 1.2 3.4 3.2l24.2 65.7s-11.6-7-28.5-7L67 45.5c-.4-1.7-1.6-2.8-2.9-2.8-1.3 0-2.5 1.1-2.9 2.7L50.4 78.5Zm-1.1 28.2Zm-4.2-20.2c-2 6.6-.6 15.8 4.2 20.2a17.5 17.5 0 0 1 .2-.7 5.5 5.5 0 0 1 5.7-4.5c2.8.1 4.3 1.5 4.7 4.7.2 1.1.2 2.3.2 3.5v.4c0 2.7.7 5.2 2.2 7.4a13 13 0 0 0 5.7 4.9v-.3l-.2-.3c-1.8-5.6-.5-9.5 4.4-12.8l1.5-1a73 73 0 0 0 3.2-2.2 16 16 0 0 0 6.8-11.4c.3-2 .1-4-.6-6l-.8.6-1.6 1a37 37 0 0 1-22.4 2.7c-5-.7-9.7-2-13.2-6.2Z" />
<style>
path { fill: #000; }
@media (prefers-color-scheme: dark) {
path { fill: #FFF; }
}
</style>
</svg>

After

Width:  |  Height:  |  Size: 749 B

61
src/components/Card.astro Normal file
View file

@ -0,0 +1,61 @@
---
interface Props {
title: string;
body: string;
href: string;
}
const { href, title, body } = Astro.props;
---
<li class="link-card">
<a href={href}>
<h2>
{title}
<span>&rarr;</span>
</h2>
<p>
{body}
</p>
</a>
</li>
<style>
.link-card {
list-style: none;
display: flex;
padding: 1px;
background-color: #23262d;
background-image: none;
background-size: 400%;
border-radius: 7px;
background-position: 100%;
transition: background-position 0.6s cubic-bezier(0.22, 1, 0.36, 1);
box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1);
}
.link-card > a {
width: 100%;
text-decoration: none;
line-height: 1.4;
padding: calc(1.5rem - 1px);
border-radius: 8px;
color: white;
background-color: #23262d;
opacity: 0.8;
}
h2 {
margin: 0;
font-size: 1.25rem;
transition: color 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}
p {
margin-top: 0.5rem;
margin-bottom: 0;
}
.link-card:is(:hover, :focus-within) {
background-position: 0;
background-image: var(--accent-gradient);
}
.link-card:is(:hover, :focus-within) h2 {
color: rgb(var(--accent-light));
}
</style>

View file

@ -0,0 +1,54 @@
---
import { getImage } from 'astro:assets'
export type Props = {
href: string
iconUrl: string
}
const { href, iconUrl } = Astro.props
const icon = await getImage({
src: iconUrl,
inferSize: true,
});
---
<a
href={href}
class="markdown-magic-link markdown-magic-link-link"
target="_blank"
rel="noopener"
>
<span
class="markdown-magic-link-image"
style={`background-image: url("${icon.src}");`}
>
</span>
<slot />
</a>
<style>.markdown-magic-link {
display: inline-flex;
align-items: center;
background: #8882;
transform: translateY(3px);
line-height: 100%;
color: var(--fg-light) !important;
--uno: gap-1 transition rounded px1.5 py1 important-border-0 font-condensed;
}
.markdown-magic-link:hover {
background: #8883;
color: var(--fg) !important;
}
.markdown-magic-link-image {
display: inline-block;
height: 1.1em;
width: 1.1em;
background-size: cover;
background-repeat: no-repeat;
background-position: center;
border-radius: 2px;
}
</style>

View file

@ -0,0 +1,5 @@
import LinkWithIcon from "./LinkWithIcon.astro";
export const components = {
LinkWithIcon,
};

18
src/content/config.ts Normal file
View file

@ -0,0 +1,18 @@
import { defineCollection, z } from "astro:content";
const pages = defineCollection({
schema: z.object({
title: z.string(),
description: z.string().optional(),
image: z
.object({
src: z.string(),
alt: z.string(),
})
.optional(),
}),
});
export const collections = {
'pages': pages,
};

View file

@ -0,0 +1,8 @@
---
slug: /
title: lio's home
description: lio's home on the web
---
# this is some text
this is some more text

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

@ -0,0 +1 @@
/// <reference path="../.astro/types.d.ts" />

View file

@ -1 +0,0 @@
# uwu

47
src/layouts/Layout.astro Normal file
View file

@ -0,0 +1,47 @@
---
interface Props {
title: string;
description?: string;
}
const { title } = Astro.props;
---
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="description" content="Astro description" />
<meta name="viewport" content="width=device-width" />
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
<meta name="generator" content={Astro.generator} />
<title>{title}</title>
</head>
<body>
<slot />
</body>
</html>
<style is:global>
:root {
--accent: 136, 58, 234;
--accent-light: 224, 204, 250;
--accent-dark: 49, 10, 101;
--accent-gradient: linear-gradient(
45deg,
rgb(var(--accent)),
rgb(var(--accent-light)) 30%,
white 60%
);
}
code {
font-family:
Menlo,
Monaco,
Lucida Console,
Liberation Mono,
DejaVu Sans Mono,
Bitstream Vera Sans Mono,
Courier New,
monospace;
}
</style>

35
src/pages/[...slug].astro Normal file
View file

@ -0,0 +1,35 @@
---
import type { CollectionEntry } from 'astro:content'
import { components } from '@/components/markdown'
import BaseLayout from '@/layouts/Layout.astro'
import { getCollection } from 'astro:content'
export async function getStaticPaths() {
const pages = await getCollection('pages')
console.log("pages", pages)
return pages.map((page) => {
return {
params: { slug: page.slug },
props: { page },
}
})
}
type Props = { page: CollectionEntry<'pages'> }
const { page } = Astro.props
const { title, description } = page.data
const { Content } = await page.render();
---
<BaseLayout title={title} description={description}>
<div class="prose m-auto mb-8">
<h1 class="mb-0 slide-enter-50">{title}</h1>
</div>
<article>
<div class="prose slide-enter-content m-auto">
<Content {components} />
</div>
</article>
</BaseLayout>

8
tailwind.config.mjs Normal file
View file

@ -0,0 +1,8 @@
/** @type {import('tailwindcss').Config} */
export default {
content: ['./src/**/*.{astro,html,js,jsx,md,mdx,svelte,ts,tsx,vue}'],
theme: {
extend: {},
},
plugins: [],
}

14
tsconfig.json Normal file
View file

@ -0,0 +1,14 @@
{
"extends": "astro/tsconfigs/base",
"compilerOptions": {
"baseUrl": ".",
"paths": {
"@/*": [
"src/*"
]
},
"strictNullChecks": true,
"jsx": "react-jsx",
"jsxImportSource": "react"
}
}

4370
yarn.lock Normal file

File diff suppressed because it is too large Load diff