React
-TypeScript
- - +Svelte
- - +NextJS
- - +Remix
- - +GraphQL
- - +Prisma
- - +Gatsby
- - +Docker
- + clazz="center" + icon={Docker} + />- Currently traveling around the world! + Living it up in Mountain View
Traveling around
+Mountain View
Bringing these two cats, Turnip and Taco, along for the ride.
+Hanging out with these two cats, Turnip and Taco.
Turnip
Turnip
{itemText}
+ + + diff --git a/src/routes/about/course.json b/src/routes/about/course.json new file mode 100644 index 0000000..3014bf9 --- /dev/null +++ b/src/routes/about/course.json @@ -0,0 +1,88 @@ +{ + "courses": [ + { + "name": "Wes Bos", + "externalLinks": [ + { + "ariaLabel": "Wes Bos Courses", + "href": "https://wesbos.com/courses", + "showIcon": true, + "text": "Wes Bos" + } + ], + "tags": ["React", "GraphQL", "Gatsby", "JavaScript"] + }, + { + "name": "Scott Tolinski", + "externalLinks": [ + { + "ariaLabel": "Scott Tolinski", + "href": "https://www.scotttolinski.com", + "showIcon": true, + "text": "Scott Tolinski" + }, + { + "ariaLabel": "Levelup Tutorials", + "href": "https://levelup.video", + "showIcon": true, + "text": "Levelup Tutorials" + } + ], + "tags": ["React", "TypeScript", "Svelte Kit", "Remix", "Figma", "Design Systems"] + }, + { + "name": "Josh Comeau", + "externalLinks": [ + { + "ariaLabel": "Josh Comeau", + "href": "https://www.joshwcomeau.com", + "showIcon": true, + "text": "Josh Comeau" + }, + { + "ariaLabel": "The Joy of React", + "href": "https://www.joyofreact.com/", + "showIcon": true, + "text": "The Joy of React" + } + ], + "tags": ["Full Stack React", "NextJS"] + }, + { + "name": "Amy Kapernick", + "externalLinks": [ + { + "ariaLabel": "Amy Kapernick", + "href": "https://www.amyskapers.dev/", + "showIcon": true, + "text": "Amy Kapernick" + } + ], + "tags": ["Accessibility for Everyone"] + }, + { + "name": "Andrew Mead", + "externalLinks": [ + { + "ariaLabel": "Andrew Mead on Udemy", + "href": "https://www.udemy.com/user/andrewmead/", + "showIcon": true, + "text": "Andrew Mead" + } + ], + "tags": ["GraphQL", "Apollo", "Prisma"] + }, + { + "name": "Steven Grider", + "externalLinks": [ + { + "ariaLabel": "Steven Grider on Udemy", + "href": "https://www.udemy.com/user/sgslo/", + "showIcon": true, + "text": "Steven Grider" + } + ], + "tags": ["React", "Redux", "Docker", "GraphQL", "CSS", "HTML", "JavaScript"] + } + ] +} diff --git a/src/routes/api.ts b/src/routes/api.ts index b6aeac2..5d9ecc2 100644 --- a/src/routes/api.ts +++ b/src/routes/api.ts @@ -10,7 +10,7 @@ import { USE_REDIS_CACHE } from '$env/static/private'; import intersect from 'just-intersect'; -import type { Article, WallabagArticle } from '$lib/types/article'; +import type { Article, ArticlePageLoad, WallabagArticle } from '$lib/types/article'; import { ArticleTag } from '$lib/types/articleTag'; import type { PageQuery } from '$lib/types/pageQuery'; import { URLSearchParams } from 'url'; @@ -77,7 +77,7 @@ export async function fetchArticlesApi( throw new Error(pageResponse.statusText); } - const cacheControl = pageResponse.headers.get('cache-control'); + const cacheControl = pageResponse.headers.get('cache-control') || 'no-cache'; const { _embedded, page, pages, total, limit } = await pageResponse.json(); const articles: Article[] = []; @@ -101,7 +101,7 @@ export async function fetchArticlesApi( } }); - const responseData = { + const responseData: ArticlePageLoad = { articles, currentPage: page, totalPages: pages > +WALLABAG_MAX_PAGES ? +WALLABAG_MAX_PAGES : pages, diff --git a/src/routes/api/articles/+server.ts b/src/routes/api/articles/+server.ts index a0d42a9..ad6de07 100644 --- a/src/routes/api/articles/+server.ts +++ b/src/routes/api/articles/+server.ts @@ -1,9 +1,8 @@ import { json, error } from '@sveltejs/kit'; import { WALLABAG_MAX_PAGES } from '$env/static/private'; -import type { RequestHandler, RequestEvent } from './$types'; import { fetchArticlesApi } from '$root/routes/api'; -export const GET: RequestHandler = async ({ setHeaders, url }: RequestEvent) => { +export async function GET({ setHeaders, url }) { const page = url?.searchParams?.get('page') || '1'; if (+page > +WALLABAG_MAX_PAGES) { error(404, 'Page does not exist'); diff --git a/src/routes/articles/[page]/+page.server.ts b/src/routes/articles/[page]/+page.server.ts index 8245397..ccd8a50 100644 --- a/src/routes/articles/[page]/+page.server.ts +++ b/src/routes/articles/[page]/+page.server.ts @@ -2,18 +2,9 @@ import { error } from '@sveltejs/kit'; import type { PageServerLoad } from './$types'; import { WALLABAG_MAX_PAGES } from '$env/static/private'; import { PUBLIC_SITE_URL } from '$env/static/public'; -import type { Article } from '$lib/types/article'; +import type { ArticlePageLoad } from '$lib/types/article'; import type { MetaTagsProps } from 'svelte-meta-tags'; -export type ArticlePageLoad = { - articles: Article[]; - currentPage: number; - totalPages: number; - limit: number; - totalArticles: number; - cacheControl: string; -}; - export const load: PageServerLoad = async ({ fetch, params, setHeaders, url }) => { const { page } = params; if (+page > +WALLABAG_MAX_PAGES) {