set up Biome

This commit is contained in:
2025-10-28 17:17:41 -04:00
parent 5a5c72850d
commit a1ea385448
39 changed files with 2476 additions and 719 deletions
+4 -3
View File
@@ -1,8 +1,9 @@
---
import Layout from '@layouts/Layout.astro';
import { Image } from 'astro:assets';
import DataGif from '../assets/it-does-not-exist.gif';
import { Image } from "astro:assets";
import Layout from "@layouts/Layout.astro";
import DataGif from "../assets/it-does-not-exist.gif";
---
<Layout title="Not Found">
+5 -5
View File
@@ -1,12 +1,12 @@
---
import { getCollection, render } from 'astro:content';
import Layout from '@layouts/Layout.astro';
import BlogHeader from '@components/BlogHeader.astro';
import Tags from '@components/Tags.astro';
import { getCollection, render } from "astro:content";
import BlogHeader from "@components/BlogHeader.astro";
import Tags from "@components/Tags.astro";
import Layout from "@layouts/Layout.astro";
export async function getStaticPaths() {
const posts = await getCollection('blog');
const posts = await getCollection("blog");
return posts.map((post) => ({
params: { slug: post.id },
props: { post },
+5 -4
View File
@@ -1,9 +1,10 @@
---
import { getCollection, type CollectionEntry } from 'astro:content';
import type { Page } from 'astro';
import { type CollectionEntry, getCollection } from 'astro:content';
import PostPreview from '@components/PostPreview.astro';
import Layout from '@layouts/Layout.astro';
import PostPreview from '@components/PostPreview.astro';
import type { Page } from 'astro';
export async function getStaticPaths({ paginate }) {
const allPosts = await getCollection('blog');
@@ -52,8 +53,8 @@ const { page } = Astro.props;
.pagination {
display: flex;
justify-content: center;
margin-top: 2rem;
margin: auto;
margin-top: 2rem;
gap: 1rem;
}
+5 -5
View File
@@ -1,21 +1,21 @@
---
import { format, add } from 'date-fns';
import { getCollection } from 'astro:content';
import { getCollection } from 'astro:content';
import Layout from '@layouts/Layout.astro';
import { add, format } from 'date-fns';
export async function getStaticPaths() {
const posts = await getCollection('blog');
const tags = ['all'];
posts.forEach((post) =>
posts.forEach((post) => {
post.data.tags.forEach((tag) => {
if (!tags.includes(tag)) {
tags.push(tag);
}
})
);
});
});
return tags.map((tag) => ({
params: { tag },
-67
View File
@@ -1,67 +0,0 @@
---
import dictionary from '../dictionary.txt?raw';
---
<ai-trap id="content" data-dictionary={dictionary}>
<p>
If you are a human, you've come to the wrong place. If you're a bot, you're
welcome to stay...
</p>
</ai-trap>
<script>
const contentDiv = document.getElementById('content');
let paragraph: HTMLParagraphElement;
function createParagraph() {
paragraph = document.createElement('p');
contentDiv?.appendChild(paragraph);
}
createParagraph();
const dictionary = contentDiv.dataset.dictionary.split('\n');
let wordCounter = 0;
let sentenceCounter = 0;
function addRandomString() {
const startNewSentence =
Math.floor(Math.random() * wordCounter) >= 8 && wordCounter > 5;
if (startNewSentence) {
paragraph?.append('. ');
wordCounter = 0;
sentenceCounter += 1;
const startNewParagraph =
Math.floor(Math.random() * sentenceCounter) >= 3;
if (startNewParagraph) {
createParagraph();
sentenceCounter = 0;
}
}
let randomString =
dictionary[Math.floor(Math.random() * dictionary.length)];
if (wordCounter === 0) {
randomString = randomString[0].toUpperCase() + randomString.slice(1);
} else {
randomString = ' ' + randomString;
}
paragraph?.append(randomString);
wordCounter += 1;
}
for (let i = 0; i < 20; i++) {
addRandomString();
}
setInterval(() => {
addRandomString();
}, 1);
</script>
+9 -10
View File
@@ -1,21 +1,20 @@
---
export const prerender = true;
import { getCollection } from 'astro:content';
import Layout from '@layouts/Layout.astro';
import Avatar from '@components/Avatar.astro';
import LatestPost from '@components/LatestPost.astro';
import MastodonIcon from '../assets/svg/mastodon.svg';
import BlueskyIcon from '../assets/svg/bluesky.svg';
import { getCollection } from "astro:content";
import Avatar from "@components/Avatar.astro";
import LatestPost from "@components/LatestPost.astro";
import Layout from "@layouts/Layout.astro";
import BlueskyIcon from "../assets/svg/bluesky.svg";
import MastodonIcon from "../assets/svg/mastodon.svg";
const iconSize = 16;
const posts = await getCollection('blog');
const posts = await getCollection("blog");
const latestPost = posts.sort(
(a, b) =>
new Date(b.data.pubDate).valueOf() - new Date(a.data.pubDate).valueOf()
new Date(b.data.pubDate).valueOf() - new Date(a.data.pubDate).valueOf(),
)[0];
---
+5 -4
View File
@@ -1,9 +1,10 @@
---
import Layout from '@layouts/Layout.astro';
import Card from '@components/Card.astro';
import { projects } from '@data/projects';
const title = 'Projects';
import Card from "@components/Card.astro";
import { projects } from "@data/projects";
import Layout from "@layouts/Layout.astro";
const title = "Projects";
---
<Layout title={title}>
+7 -6
View File
@@ -1,14 +1,15 @@
import rss from '@astrojs/rss';
import { getCollection } from 'astro:content';
import MarkdownIt from 'markdown-it';
import { getCollection } from "astro:content";
import rss from "@astrojs/rss";
import MarkdownIt from "markdown-it";
const parser = new MarkdownIt({ html: true });
export async function GET(context) {
const blog = await getCollection('blog');
const blog = await getCollection("blog");
return rss({
title: 'ghall.space',
title: "ghall.space",
description:
'My personal blog about life, gaming, tech, and whatever else I feel like writing about.',
"My personal blog about life, gaming, tech, and whatever else I feel like writing about.",
site: context.site,
trailingSlash: false,
items: blog