Update something

This commit is contained in:
tiff 2025-05-17 21:18:28 -04:00
parent 31c18af170
commit 2877f96fee
8 changed files with 1316 additions and 6561 deletions

View File

@ -10,14 +10,17 @@ import expressiveCode from "astro-expressive-code";
// https://astro.build/config
export default defineConfig({
site: SITE.website,
integrations: [sitemap({
filter: page => SITE.showArchives || !page.endsWith("/archives"),
}), expressiveCode()],
integrations: [
sitemap({
filter: (page) => SITE.showArchives || !page.endsWith("/archives"),
}),
expressiveCode(),
],
markdown: {
remarkPlugins: [remarkToc, [remarkCollapse, { test: "Table of contents" }]],
shikiConfig: {
// For more themes, visit https://shiki.style/themes
themes: { light: "min-light", dark: "night-owl" },
themes: { light: "catppuccin-latte", dark: "catppuccin-frappe" },
wrap: true,
},
},
@ -30,10 +33,10 @@ export default defineConfig({
image: {
// Used for all Markdown images; not configurable per-image
// Used for all `<Image />` and `<Picture />` components unless overridden with a prop
experimentalLayout: "responsive",
experimentalLayout: "full-width",
},
experimental: {
svg: true,
responsiveImages: true,
},
});

View File

@ -21,12 +21,13 @@
"@resvg/resvg-js": "^2.6.2",
"@tailwindcss/vite": "^4.0.12",
"@types/sanitize-html": "^2.13.0",
"astro": "^5.4.2",
"astro": "^5.7.13",
"astro-expressive-code": "^0.40.2",
"lodash.kebabcase": "^4.1.1",
"markdown-it": "^14.1.0",
"remark-collapse": "^0.1.2",
"remark-toc": "^9.0.0",
"sanitize-html": "^2.17.0",
"satori": "^0.12.1",
"sharp": "^0.33.5",
"tailwindcss": "^4.0.12"

5794
pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff

View File

@ -1,7 +1,7 @@
export const SITE = {
website: "https://tiff.engineer/", // replace this with your deployed domain
website: "https://tiff.run/", // replace this with your deployed domain
author: "tiff w",
profile: "https://about.tiff.engineer/",
profile: "https://about.tiff.run/",
desc: "A software blog by someone named tiff.",
title: "tiff on software",
ogImage: "astropaper-og.jpg",

View File

@ -14,7 +14,7 @@ const blog = defineCollection({
draft: z.boolean().optional(),
tags: z.array(z.string()).default(["others"]),
ogImage: image()
.refine(img => img.width >= 1200 && img.height >= 630, {
.refine((img) => img.width >= 1200 && img.height >= 630, {
message: "OpenGraph image must be at least 1200 X 630 pixels!",
})
.or(z.string())

17
src/pages/rss.xml Normal file
View File

@ -0,0 +1,17 @@
import rss from '@astrojs/rss';
import sanitizeHtml from 'sanitize-html';
export async function GET(context) {
const postImportResult = import.meta.glob('../posts/**/*.md', { eager: true });
const posts = Object.values(postImportResult);
return rss({
title: 'tiff on software',
description: 'A humble Astronauts guide to the stars',
site: context.site,
items: await Promise.all(posts.map(async (post) => ({
link: post.url,
content: sanitizeHtml((await post.compiledContent())),
...post.frontmatter,
}))),
});
}

View File

@ -1,8 +1,12 @@
import rss from "@astrojs/rss";
import { getCollection } from "astro:content";
import getSortedPosts from "@/utils/getSortedPosts";
import sanitizeHtml from "sanitize-html";
import MarkdownIt from "markdown-it";
import { SITE } from "@/config";
const parser = new MarkdownIt();
export async function GET() {
const posts = await getCollection("blog");
const sortedPosts = getSortedPosts(posts);
@ -12,9 +16,13 @@ export async function GET() {
site: SITE.website,
items: sortedPosts.map(({ data, id }) => ({
link: `posts/${id}/`,
content: sanitizeHtml(parser.render(posts.body), {
allowedTags: sanitizeHtml.defaults.allowedTags.concat(["img"]),
}),
title: data.title,
description: data.description,
pubDate: new Date(data.modDatetime ?? data.pubDatetime),
customData: `<summary>${posts.frontmatter.description}</summary>`,
})),
});
}

2032
yarn.lock

File diff suppressed because it is too large Load Diff