From e3e8845721451e399e63e99d92c66f0a0bf0f374 Mon Sep 17 00:00:00 2001 From: prototypa Date: Fri, 25 Aug 2023 13:03:19 -0400 Subject: [PATCH 1/7] Import AstroSeoProps --- src/components/common/Metadata.astro | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/common/Metadata.astro b/src/components/common/Metadata.astro index f8d85f7..0def884 100644 --- a/src/components/common/Metadata.astro +++ b/src/components/common/Metadata.astro @@ -2,7 +2,7 @@ import merge from 'lodash.merge'; import { AstroSeo } from '@astrolib/seo'; -import type { AstroSeoProps } from '@astrolib/seo'; +import type { Props as AstroSeoProps } from '@astrolib/seo'; import { SITE, METADATA, I18N } from '~/utils/config'; import type { MetaData } from '~/types'; From 2f6c697e5fa3e493644a30e89d693cf674f605ee Mon Sep 17 00:00:00 2001 From: prototypa Date: Fri, 25 Aug 2023 13:11:41 -0400 Subject: [PATCH 2/7] Update to a version of Node that Astro supports (>=18.14.1) --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index cf0743c..6579b42 100644 --- a/package.json +++ b/package.json @@ -47,6 +47,6 @@ "unpic": "^3.10.0" }, "engines": { - "node": ">=16.12.0" + "node": ">=18.14.1" } } From 17186789a216b4a866c0d7a333dbd28c300ec1bc Mon Sep 17 00:00:00 2001 From: prototypa Date: Fri, 25 Aug 2023 13:25:38 -0400 Subject: [PATCH 3/7] Update to @astrojs/rss@3.0.0-rc.2 --- package.json | 12 ++++++------ src/pages/rss.xml.ts | 7 +++---- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/package.json b/package.json index 6579b42..d1a9720 100644 --- a/package.json +++ b/package.json @@ -13,11 +13,11 @@ "lint:eslint": "eslint . --ext .js,.ts,.astro" }, "devDependencies": { - "@astrojs/mdx": "^1.0.0-rc.2", - "@astrojs/partytown": "^2.0.0-rc.1", - "@astrojs/rss": "^3.0.0-rc.1", - "@astrojs/sitemap": "^3.0.0-rc.1", - "@astrojs/tailwind": "^5.0.0-rc.1", + "@astrojs/mdx": "1.0.0-rc.2", + "@astrojs/partytown": "2.0.0-rc.1", + "@astrojs/rss": "^3.0.0-rc.2", + "@astrojs/sitemap": "3.0.0-rc.1", + "@astrojs/tailwind": "5.0.0-rc.1", "@astrolib/analytics": "^0.4.2", "@astrolib/seo": "^1.0.0-beta.4", "@fontsource-variable/inter": "^5.0.8", @@ -27,7 +27,7 @@ "@types/lodash.merge": "^4.6.7", "@typescript-eslint/eslint-plugin": "^6.4.1", "@typescript-eslint/parser": "^6.4.1", - "astro": "^3.0.0-rc.5", + "astro": "3.0.0-rc.5", "astro-compress": "^2.0.14", "astro-icon": "^1.0.0-next.2", "eslint": "^8.47.0", diff --git a/src/pages/rss.xml.ts b/src/pages/rss.xml.ts index aad6236..4c5e2c3 100644 --- a/src/pages/rss.xml.ts +++ b/src/pages/rss.xml.ts @@ -1,4 +1,4 @@ -import rss from '@astrojs/rss'; +import { getRssString } from '@astrojs/rss'; import { SITE, METADATA, APP_BLOG } from '~/utils/config'; import { fetchPosts } from '~/utils/blog'; @@ -14,7 +14,7 @@ export const GET = async () => { const posts = await fetchPosts(); - const { body = '' } = await rss({ + const rss = await getRssString({ title: `${SITE.name}’s Blog`, description: METADATA?.description || '', site: import.meta.env.SITE, @@ -29,8 +29,7 @@ export const GET = async () => { trailingSlash: SITE.trailingSlash, }); - return new Response(body, { - status: 200, + return new Response(rss, { headers: { 'Content-Type': 'application/xml', }, From e1b453c450674ea0d482530a269dab12938b3f6e Mon Sep 17 00:00:00 2001 From: prototypa Date: Fri, 25 Aug 2023 13:26:02 -0400 Subject: [PATCH 4/7] Fix: Property 'env' does not exist on type 'ImportMeta' --- src/env.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/env.d.ts b/src/env.d.ts index 9afcd11..e6be1e8 100644 --- a/src/env.d.ts +++ b/src/env.d.ts @@ -1,3 +1,4 @@ // eslint-disable-next-line @typescript-eslint/triple-slash-reference /// /// +/// From cb95fad823966c119e893f215ef41132ccaf00ad Mon Sep 17 00:00:00 2001 From: prototypa Date: Fri, 25 Aug 2023 13:54:00 -0400 Subject: [PATCH 5/7] Move to 'dependencies' the packages that should be there. --- package.json | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/package.json b/package.json index d1a9720..24cb548 100644 --- a/package.json +++ b/package.json @@ -12,30 +12,33 @@ "format": "prettier -w .", "lint:eslint": "eslint . --ext .js,.ts,.astro" }, - "devDependencies": { - "@astrojs/mdx": "1.0.0-rc.2", - "@astrojs/partytown": "2.0.0-rc.1", - "@astrojs/rss": "^3.0.0-rc.2", - "@astrojs/sitemap": "3.0.0-rc.1", - "@astrojs/tailwind": "5.0.0-rc.1", + "dependencies": { + "@astrojs/rss": "3.0.0-rc.2", "@astrolib/analytics": "^0.4.2", "@astrolib/seo": "^1.0.0-beta.4", "@fontsource-variable/inter": "^5.0.8", + "astro": "3.0.0-rc.5", + "astro-icon": "^1.0.0-next.2", + "limax": "2.1.0", + "lodash.merge": "^4.6.2", + "unpic": "^3.10.0" + }, + "devDependencies": { + "@astrojs/mdx": "1.0.0-rc.2", + "@astrojs/partytown": "2.0.0-rc.1", + "@astrojs/sitemap": "3.0.0-rc.1", + "@astrojs/tailwind": "5.0.0-rc.1", "@iconify-json/flat-color-icons": "^1.1.7", "@iconify-json/tabler": "^1.1.89", "@tailwindcss/typography": "^0.5.9", "@types/lodash.merge": "^4.6.7", "@typescript-eslint/eslint-plugin": "^6.4.1", "@typescript-eslint/parser": "^6.4.1", - "astro": "3.0.0-rc.5", "astro-compress": "^2.0.14", - "astro-icon": "^1.0.0-next.2", "eslint": "^8.47.0", "eslint-plugin-astro": "^0.28.0", "eslint-plugin-jsx-a11y": "^6.7.1", "js-yaml": "^4.1.0", - "limax": "2.1.0", - "lodash.merge": "^4.6.2", "mdast-util-to-string": "^4.0.0", "prettier": "^3.0.2", "prettier-plugin-astro": "^0.12.0", @@ -43,8 +46,7 @@ "svgo": "3.0.2", "tailwind-merge": "^1.14.0", "tailwindcss": "^3.3.3", - "typescript": "^5.1.6", - "unpic": "^3.10.0" + "typescript": "^5.1.6" }, "engines": { "node": ">=18.14.1" From 95899486db8d421808abb9a94f69f5801cbb8768 Mon Sep 17 00:00:00 2001 From: prototypa Date: Fri, 25 Aug 2023 15:32:19 -0400 Subject: [PATCH 6/7] Update to astro@3.0.0-rc.7 --- package.json | 2 +- src/env.d.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 24cb548..6c721aa 100644 --- a/package.json +++ b/package.json @@ -17,7 +17,7 @@ "@astrolib/analytics": "^0.4.2", "@astrolib/seo": "^1.0.0-beta.4", "@fontsource-variable/inter": "^5.0.8", - "astro": "3.0.0-rc.5", + "astro": "^3.0.0-rc.7", "astro-icon": "^1.0.0-next.2", "limax": "2.1.0", "lodash.merge": "^4.6.2", diff --git a/src/env.d.ts b/src/env.d.ts index e6be1e8..c47f586 100644 --- a/src/env.d.ts +++ b/src/env.d.ts @@ -1,4 +1,4 @@ // eslint-disable-next-line @typescript-eslint/triple-slash-reference /// -/// +/// /// From cbfb76b845ee4e53da2702006fc373a75052f36c Mon Sep 17 00:00:00 2001 From: prototypa Date: Fri, 25 Aug 2023 15:33:33 -0400 Subject: [PATCH 7/7] Allow output 'hybrid' in blog pages --- src/pages/[...blog]/[...page].astro | 2 ++ src/pages/[...blog]/[category]/[...page].astro | 2 ++ src/pages/[...blog]/[tag]/[...page].astro | 2 ++ src/pages/[...blog]/index.astro | 2 ++ 4 files changed, 8 insertions(+) diff --git a/src/pages/[...blog]/[...page].astro b/src/pages/[...blog]/[...page].astro index 8260889..417e927 100644 --- a/src/pages/[...blog]/[...page].astro +++ b/src/pages/[...blog]/[...page].astro @@ -7,6 +7,8 @@ import Pagination from '~/components/blog/Pagination.astro'; import { blogListRobots, getStaticPathsBlogList } from '~/utils/blog'; +export const prerender = true; + export async function getStaticPaths ({ paginate }) { return await getStaticPathsBlogList({ paginate }); } diff --git a/src/pages/[...blog]/[category]/[...page].astro b/src/pages/[...blog]/[category]/[...page].astro index 1ff5cd6..8396488 100644 --- a/src/pages/[...blog]/[category]/[...page].astro +++ b/src/pages/[...blog]/[category]/[...page].astro @@ -6,6 +6,8 @@ import BlogList from '~/components/blog/List.astro'; import Headline from '~/components/blog/Headline.astro'; import Pagination from '~/components/blog/Pagination.astro'; +export const prerender = true; + export async function getStaticPaths ({ paginate }) { return await getStaticPathsBlogCategory({ paginate }); } diff --git a/src/pages/[...blog]/[tag]/[...page].astro b/src/pages/[...blog]/[tag]/[...page].astro index 20f21db..cf1608d 100644 --- a/src/pages/[...blog]/[tag]/[...page].astro +++ b/src/pages/[...blog]/[tag]/[...page].astro @@ -6,6 +6,8 @@ import BlogList from '~/components/blog/List.astro'; import Headline from '~/components/blog/Headline.astro'; import Pagination from '~/components/blog/Pagination.astro'; +export const prerender = true; + export async function getStaticPaths ({ paginate }) { return await getStaticPathsBlogTag({ paginate }); } diff --git a/src/pages/[...blog]/index.astro b/src/pages/[...blog]/index.astro index 6612897..a1bc203 100644 --- a/src/pages/[...blog]/index.astro +++ b/src/pages/[...blog]/index.astro @@ -9,6 +9,8 @@ import { getCanonical, getPermalink } from '~/utils/permalinks'; import { getStaticPathsBlogPost, blogPostRobots } from '~/utils/blog'; import { findImage } from '~/utils/images'; +export const prerender = true; + export async function getStaticPaths () { return await getStaticPathsBlogPost(); }