Compare commits

..

No commits in common. "full-content-rss-fix" and "main" have entirely different histories.

8 changed files with 6560 additions and 1315 deletions

View File

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

View File

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

5794
pnpm-lock.yaml generated Normal file

File diff suppressed because it is too large Load Diff

View File

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

View File

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

View File

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

2030
yarn.lock

File diff suppressed because it is too large Load Diff