before push commit
This commit is contained in:
parent
bd920f1731
commit
5217bba8f9
15 changed files with 125 additions and 59 deletions
|
@ -13,6 +13,7 @@
|
||||||
"@tailwindcss/vite": "^4.0.13",
|
"@tailwindcss/vite": "^4.0.13",
|
||||||
"astro": "^5.4.3",
|
"astro": "^5.4.3",
|
||||||
"ava": "^6.2.0",
|
"ava": "^6.2.0",
|
||||||
|
"clsx": "^2.1.1",
|
||||||
"luxon": "^3.5.0",
|
"luxon": "^3.5.0",
|
||||||
"tailwindcss": "^4.0.13"
|
"tailwindcss": "^4.0.13"
|
||||||
},
|
},
|
||||||
|
|
3
pnpm-lock.yaml
generated
3
pnpm-lock.yaml
generated
|
@ -17,6 +17,9 @@ importers:
|
||||||
ava:
|
ava:
|
||||||
specifier: ^6.2.0
|
specifier: ^6.2.0
|
||||||
version: 6.2.0(rollup@4.35.0)
|
version: 6.2.0(rollup@4.35.0)
|
||||||
|
clsx:
|
||||||
|
specifier: ^2.1.1
|
||||||
|
version: 2.1.1
|
||||||
luxon:
|
luxon:
|
||||||
specifier: ^3.5.0
|
specifier: ^3.5.0
|
||||||
version: 3.5.0
|
version: 3.5.0
|
||||||
|
|
|
@ -1,34 +1,31 @@
|
||||||
---
|
---
|
||||||
import Navigation from "./Navigation.astro";
|
import Navigation from "./Navigation.astro";
|
||||||
import conf from "~/site.config";
|
import conf from "~/site.config";
|
||||||
|
import { isBlog } from "~/lib/metadata";
|
||||||
|
|
||||||
let headertext = conf.siteName;
|
let headertext = conf.siteName;
|
||||||
let headerurl = "/";
|
let headerurl = "/";
|
||||||
let headerarrow = false;
|
let headerarrow = false;
|
||||||
|
|
||||||
function isBlog() {
|
if (isBlog(Astro.url.pathname)) {
|
||||||
return Astro.url.pathname.startsWith("/blog");
|
headertext = "Everything And The Girl";
|
||||||
}
|
headerurl = "/blog";
|
||||||
|
headerarrow = true;
|
||||||
if (isBlog()) {
|
|
||||||
headertext = "Everything And The Girl";
|
|
||||||
headerurl = "/blog";
|
|
||||||
headerarrow = true;
|
|
||||||
}
|
}
|
||||||
---
|
---
|
||||||
|
|
||||||
<header class="md:flex md:justify-between md:items-center mb-4">
|
<header class="md:flex md:justify-between md:items-center mb-4">
|
||||||
<h1 class="text-2xl font-bold">
|
<h1 class="text-2xl font-bold">
|
||||||
{
|
{
|
||||||
headerarrow && (
|
headerarrow && (
|
||||||
<span class="mr-2">
|
<span class="mr-2">
|
||||||
<a href="/">
|
<a href="/">
|
||||||
<i class="fa-solid fa-arrow-left text-light-pu dark:text-dark-pu" />
|
<i class="fa-solid fa-arrow-left text-light-pu dark:text-dark-pu" />
|
||||||
</a>
|
</a>
|
||||||
</span>
|
</span>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
<a href={headerurl}>{headertext}</a>
|
<a href={headerurl}>{headertext}</a>
|
||||||
</h1>
|
</h1>
|
||||||
<Navigation />
|
<Navigation />
|
||||||
</header>
|
</header>
|
||||||
|
|
24
src/components/ui/Notif.astro
Normal file
24
src/components/ui/Notif.astro
Normal file
|
@ -0,0 +1,24 @@
|
||||||
|
---
|
||||||
|
import { clsx } from "clsx";
|
||||||
|
|
||||||
|
interface Props {
|
||||||
|
level: number;
|
||||||
|
icon?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
// level 0: info/note
|
||||||
|
// level 1: warning
|
||||||
|
// level 2: attn needed: oh fuck
|
||||||
|
|
||||||
|
const { level } = Astro.props;
|
||||||
|
---
|
||||||
|
|
||||||
|
<div
|
||||||
|
class={clsx("sm:block md:hidden text-black", {
|
||||||
|
"bg-light-ye dark:bg-dark-ye": level === 0,
|
||||||
|
"bg-light-or dark:bg-dark-or": level === 1,
|
||||||
|
"bg-light-re dark:bg-dark-re": level === 2,
|
||||||
|
})}
|
||||||
|
>
|
||||||
|
<slot />
|
||||||
|
</div>
|
|
@ -1,3 +0,0 @@
|
||||||
<div class="bg-light-ye dark:bg-dark-ye sm:block md:hidden text-black">
|
|
||||||
<p>This view port may be too small.</p> <p>Try ivyneeds.rest on a bigger screen.</p>
|
|
||||||
</div>
|
|
|
@ -9,12 +9,15 @@ const { title, description } = Astro.props;
|
||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8" />
|
<meta charset="UTF-8" />
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||||
<title>{titleConstructor(title)}</title>
|
<title>{titleConstructor(title, Astro.url.pathname)}</title>
|
||||||
<meta name="description" content={descriptionConstructor(description)} />
|
<meta name="description" content={descriptionConstructor(description)} />
|
||||||
<meta name="author" content="Ivy Turner" />
|
<meta name="author" content="Ivy Turner" />
|
||||||
|
|
||||||
{/* og */}
|
{/* og */}
|
||||||
<meta property="og:title" content={titleConstructor(title)} />
|
<meta
|
||||||
|
property="og:title"
|
||||||
|
content={titleConstructor(title, Astro.url.pathname)}
|
||||||
|
/>
|
||||||
<meta property="og:type" content="website" />
|
<meta property="og:type" content="website" />
|
||||||
<meta property="og:url" content="https://ivyneeds.rest" />
|
<meta property="og:url" content="https://ivyneeds.rest" />
|
||||||
<meta property="og:image" content="https://ivyneeds.rest/image.jpg" />
|
<meta property="og:image" content="https://ivyneeds.rest/image.jpg" />
|
||||||
|
@ -37,5 +40,5 @@ const { title, description } = Astro.props;
|
||||||
<meta name="generator" content={Astro.generator} />
|
<meta name="generator" content={Astro.generator} />
|
||||||
|
|
||||||
{/* clacks */}
|
{/* clacks */}
|
||||||
<meta http-equiv="X-Clacks-Overhead" content={`GNU ${getClacks()}`}>
|
<meta http-equiv="X-Clacks-Overhead" content={`GNU ${getClacks()}`} />
|
||||||
</head>
|
</head>
|
||||||
|
|
8
src/components/util/SizeWarning.astro
Normal file
8
src/components/util/SizeWarning.astro
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
---
|
||||||
|
import Notif from "../ui/Notif.astro";
|
||||||
|
---
|
||||||
|
|
||||||
|
<Notif level={1}>
|
||||||
|
<p>This view port may be too small.</p>
|
||||||
|
<p>Try ivyneeds.rest on a bigger screen.</p>
|
||||||
|
</Notif>
|
6
src/content/blog/now1.md
Normal file
6
src/content/blog/now1.md
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
---
|
||||||
|
title: "/now: 2025-W13"
|
||||||
|
description: "its now"
|
||||||
|
date: 2025-03-24
|
||||||
|
tags: now
|
||||||
|
---
|
|
@ -2,7 +2,7 @@
|
||||||
import "~/styles/global.css";
|
import "~/styles/global.css";
|
||||||
import Head from "~/components/util/Head.astro";
|
import Head from "~/components/util/Head.astro";
|
||||||
import { ClientRouter } from "astro:transitions";
|
import { ClientRouter } from "astro:transitions";
|
||||||
import SizeWarning from "~/components/ui/SizeWarning.astro";
|
import SizeWarning from "~/components/util/SizeWarning.astro";
|
||||||
|
|
||||||
const { title, date, description } = Astro.props;
|
const { title, date, description } = Astro.props;
|
||||||
---
|
---
|
||||||
|
|
|
@ -3,21 +3,17 @@ import Base from "~/layouts/Base.astro";
|
||||||
import Header from "~/components/ui/Header.astro";
|
import Header from "~/components/ui/Header.astro";
|
||||||
import Date from "~/components/util/Date.astro";
|
import Date from "~/components/util/Date.astro";
|
||||||
import { noteTitleConstructor } from "~/lib/metadata";
|
import { noteTitleConstructor } from "~/lib/metadata";
|
||||||
|
import StyledLink from "~/components/util/StyledLink.astro";
|
||||||
const { title, exturl, icon, date } = Astro.props;
|
const { title, exturl, icon, date } = Astro.props;
|
||||||
---
|
---
|
||||||
|
|
||||||
<Base title={noteTitleConstructor(title, date)}>
|
<Base title={noteTitleConstructor(title, date)}>
|
||||||
<Header />
|
<Header />
|
||||||
<ul class="fa-ul marker:text-accent">
|
|
||||||
<li>
|
|
||||||
<a href="/notes" class="link">
|
|
||||||
<i class="fa-li fa-solid fa-arrow-left marker:text-accent" />
|
|
||||||
Back to notes
|
|
||||||
</a>
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
<h2 class="text-2xl font-bold mt-2">A note from <Date date={date} /></h2>
|
<h2 class="text-2xl font-bold mt-2">A note from <Date date={date} /></h2>
|
||||||
<div class="bg-light-bg-2 dark:bg-dark-bg-2 p-4 rounded-lg w-fit min-w-[500px] mt-4">
|
<div
|
||||||
|
class="bg-light-bg-2 dark:bg-dark-bg-2 p-4 rounded-lg w-fit min-w-[500px] mt-4"
|
||||||
|
>
|
||||||
<ul class="fa-ul">
|
<ul class="fa-ul">
|
||||||
{
|
{
|
||||||
title && (
|
title && (
|
||||||
|
@ -42,4 +38,8 @@ const { title, exturl, icon, date } = Astro.props;
|
||||||
<slot />
|
<slot />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<hr class="w-[500px]" />
|
||||||
|
<StyledLink href="/notes" icon="fa-solid fa-arrow-left">
|
||||||
|
See more notes
|
||||||
|
</StyledLink>
|
||||||
</Base>
|
</Base>
|
||||||
|
|
|
@ -1,18 +1,25 @@
|
||||||
import conf from "~/site.config";
|
import conf from "~/site.config";
|
||||||
// todo: add blog detection
|
|
||||||
|
|
||||||
export const titleConstructor = (title: string) => {
|
export const isBlog = (pathname: string) => {
|
||||||
console.log(title)
|
return pathname.startsWith("/blog");
|
||||||
if (!title) return conf.siteName;
|
};
|
||||||
return `${title} | ${conf.siteName}`;
|
|
||||||
|
export const titleConstructor = (title: string, pathname: string) => {
|
||||||
|
if (isBlog(pathname)) {
|
||||||
|
return title
|
||||||
|
? `${title} | Everything And The Girl`
|
||||||
|
: "Everything And The Girl";
|
||||||
|
}
|
||||||
|
if (!title) return conf.siteName;
|
||||||
|
return `${title} | ${conf.siteName}`;
|
||||||
};
|
};
|
||||||
|
|
||||||
export const descriptionConstructor = (description: string) => {
|
export const descriptionConstructor = (description: string) => {
|
||||||
if (!description) return conf.description;
|
if (!description) return conf.description;
|
||||||
return `${description}`;
|
return `${description}`;
|
||||||
};
|
};
|
||||||
|
|
||||||
export const noteTitleConstructor = (title: string, date: Date) => {
|
export const noteTitleConstructor = (title: string, date: Date) => {
|
||||||
if (title) return title;
|
if (title) return title;
|
||||||
return `A note from ${date.toLocaleDateString()}`;
|
return `A note from ${date.toLocaleDateString()}`;
|
||||||
};
|
};
|
||||||
|
|
|
@ -8,5 +8,6 @@ import BlogPostList from "~/components/lists/BlogPostList.astro";
|
||||||
description="A list of all my blog posts."
|
description="A list of all my blog posts."
|
||||||
icon="fa-solid fa-blog"
|
icon="fa-solid fa-blog"
|
||||||
>
|
>
|
||||||
|
|
||||||
<BlogPostList collection="blog" />
|
<BlogPostList collection="blog" />
|
||||||
</Page>
|
</Page>
|
||||||
|
|
|
@ -8,7 +8,6 @@ import NoteList from "~/components/lists/NoteList.astro";
|
||||||
import StyledLink from "~/components/util/StyledLink.astro";
|
import StyledLink from "~/components/util/StyledLink.astro";
|
||||||
import { Content as Bio } from "~/content/bio.md";
|
import { Content as Bio } from "~/content/bio.md";
|
||||||
import Prose from "~/components/ui/Prose.astro";
|
import Prose from "~/components/ui/Prose.astro";
|
||||||
import { getClacks } from "~/lib/fun";
|
|
||||||
---
|
---
|
||||||
|
|
||||||
<Layout>
|
<Layout>
|
||||||
|
@ -21,13 +20,11 @@ import { getClacks } from "~/lib/fun";
|
||||||
Hi! I'm Ivy, welcome to my website!
|
Hi! I'm Ivy, welcome to my website!
|
||||||
</h1>
|
</h1>
|
||||||
|
|
||||||
{getClacks()}
|
|
||||||
|
|
||||||
<Prose>
|
<Prose>
|
||||||
<Bio />
|
<Bio />
|
||||||
</Prose>
|
</Prose>
|
||||||
|
|
||||||
<div class="md:flex md:flex-column gap-2">
|
<div class="md:flex md:flex-column gap-6">
|
||||||
<Box title="latest blog posts" icon="fa-solid fa-blog">
|
<Box title="latest blog posts" icon="fa-solid fa-blog">
|
||||||
<CollectionList collection="blog" limit={5} />
|
<CollectionList collection="blog" limit={5} />
|
||||||
<hr class="h-px my-8 bg-light-pu dark:bg-dark-pu" />
|
<hr class="h-px my-8 bg-light-pu dark:bg-dark-pu" />
|
||||||
|
@ -40,5 +37,6 @@ import { getClacks } from "~/lib/fun";
|
||||||
</Box>
|
</Box>
|
||||||
</div>
|
</div>
|
||||||
</main>
|
</main>
|
||||||
|
<Footer />
|
||||||
</Layout>
|
</Layout>
|
||||||
<Footer />
|
|
||||||
|
|
|
@ -1,15 +1,36 @@
|
||||||
---
|
---
|
||||||
|
import { getCollection } from "astro:content";
|
||||||
import Page from "~/layouts/Page.astro";
|
import Page from "~/layouts/Page.astro";
|
||||||
import { Content } from "~/content/now.md";
|
// import { Content } from "~/content/now.md";
|
||||||
import Prose from "~/components/ui/Prose.astro"
|
import Prose from "~/components/ui/Prose.astro";
|
||||||
|
|
||||||
|
async function getLatestNowPost() {
|
||||||
|
const allPosts = await getCollection("blog");
|
||||||
|
const nowPosts = allPosts.filter(
|
||||||
|
(post: { data: { tags?: string[] } }) =>
|
||||||
|
post.data.tags && post.data.tags.includes("now")
|
||||||
|
);
|
||||||
|
return nowPosts[0]; // Return only the first post
|
||||||
|
}
|
||||||
|
|
||||||
|
const latestPost = await getLatestNowPost(); // Fetch the first post at build time
|
||||||
---
|
---
|
||||||
|
|
||||||
<Page title="/now" icon="fa-solid fa-calendar-days" date="2025-03-17">
|
<Page title="/now" icon="fa-solid fa-calendar-days" date="2025-03-17">
|
||||||
<Prose>
|
|
||||||
<Content />
|
|
||||||
</Prose>
|
|
||||||
<p class="text-light-tx-2 dark:text-dark-tx-2 mt-2">
|
<p class="text-light-tx-2 dark:text-dark-tx-2 mt-2">
|
||||||
This is a <a href="https://sive.rs/nowff">/now page</a> and
|
This is a <a href="https://sive.rs/nowff">/now page</a> and
|
||||||
<a href="https://nownownow.com/about">you should make one</a>, too.
|
<a href="https://nownownow.com/about">you should make one</a>, too.
|
||||||
</p>
|
</p>
|
||||||
|
<Prose>
|
||||||
|
{
|
||||||
|
latestPost ? (
|
||||||
|
<div>
|
||||||
|
<h2>{latestPost.data.title}</h2>
|
||||||
|
<p>{latestPost.data.description}</p>
|
||||||
|
</div>
|
||||||
|
) : (
|
||||||
|
<p>nae now</p>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
</Prose>
|
||||||
</Page>
|
</Page>
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
"extends": "astro/tsconfigs/strict",
|
"extends": "astro/tsconfigs/strict",
|
||||||
"include": [".astro/types.d.ts", "**/*"],
|
"include": [".astro/types.d.ts", "**/*"],
|
||||||
"exclude": ["dist", "node_modules"],
|
"exclude": ["dist", "node_modules", "cli"],
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"baseUrl": ".",
|
"baseUrl": ".",
|
||||||
"paths": {
|
"paths": {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue