mirror of
https://github.com/AmruthPillai/Reactive-Resume.git
synced 2026-07-25 01:15:26 +10:00
remove dead code, update screenshots, add PWA support
This commit is contained in:
@@ -16,11 +16,18 @@ import { cn } from "@/utils/style";
|
||||
export const Route = createFileRoute("/$username/$slug")({
|
||||
component: RouteComponent,
|
||||
loader: async ({ context, params: { username, slug } }) => {
|
||||
const resume = await context.queryClient.ensureQueryData(
|
||||
orpc.resume.getBySlug.queryOptions({ input: { username, slug } }),
|
||||
);
|
||||
try {
|
||||
// Ignore .well-known requests
|
||||
if (username === ".well-known") throw notFound();
|
||||
|
||||
return { resume };
|
||||
const resume = await context.queryClient.ensureQueryData(
|
||||
orpc.resume.getBySlug.queryOptions({ input: { username, slug } }),
|
||||
);
|
||||
|
||||
return { resume };
|
||||
} catch {
|
||||
throw notFound();
|
||||
}
|
||||
},
|
||||
head: ({ loaderData }) => ({
|
||||
meta: [{ title: loaderData ? `${loaderData.resume.name} - Reactive Resume` : "Reactive Resume" }],
|
||||
|
||||
+17
-3
@@ -48,9 +48,11 @@ export const Route = createRootRouteWithContext<RouterContext>()({
|
||||
links: [
|
||||
{ rel: "stylesheet", href: appCss },
|
||||
// Icons
|
||||
{ rel: "icon", href: "/favicon.svg", type: "image/svg+xml", sizes: "any" },
|
||||
{ rel: "icon", href: "/favicon.ico", type: "image/x-icon", sizes: "48x48" },
|
||||
{ rel: "apple-touch-icon", href: "/apple-touch-icon-180x180.png", type: "image/png", sizes: "180x180" },
|
||||
{ rel: "icon", href: "/favicon.ico", type: "image/x-icon", sizes: "128x128" },
|
||||
{ rel: "icon", href: "/favicon.svg", type: "image/svg+xml", sizes: "256x256 any" },
|
||||
{ rel: "apple-touch-icon", href: "/apple-touch-icon-180x180.png", type: "image/png", sizes: "180x180 any" },
|
||||
// Manifest
|
||||
{ rel: "manifest", href: "/manifest.webmanifest", crossOrigin: "use-credentials" },
|
||||
],
|
||||
meta: [
|
||||
{ title },
|
||||
@@ -69,6 +71,18 @@ export const Route = createRootRouteWithContext<RouterContext>()({
|
||||
{ property: "og:description", content: description },
|
||||
{ property: "og:url", content: appUrl },
|
||||
],
|
||||
// Register service worker via script tag
|
||||
scripts: [
|
||||
{
|
||||
children: `
|
||||
if('serviceWorker' in navigator) {
|
||||
window.addEventListener('load', () => {
|
||||
navigator.serviceWorker.register('/sw.js', { scope: '/' })
|
||||
})
|
||||
}
|
||||
`,
|
||||
},
|
||||
],
|
||||
};
|
||||
},
|
||||
beforeLoad: async () => {
|
||||
|
||||
Reference in New Issue
Block a user