Skip to content

Commit

Permalink
docs update
Browse files Browse the repository at this point in the history
  • Loading branch information
sjc5 committed Sep 20, 2023
1 parent dfa26ae commit 4d9e19e
Showing 1 changed file with 7 additions and 19 deletions.
26 changes: 7 additions & 19 deletions docs/src/pages/docs.page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,7 @@ root
), the path would be <InlineCode>example.com/foo/bar</InlineCode>.
If you want the directory to be ignored, prefix it with two
underscores (e.g., <InlineCode>__foo</InlineCode>). In that case,
the route will just be
<InlineCode>example.com/bar</InlineCode>.
the route will just be <InlineCode>example.com/bar</InlineCode>.
</ListItem>

<ListItem>
Expand Down Expand Up @@ -574,35 +573,24 @@ export async function loader({ c }: AppDataFunctionArgs) {
code={`
import {
CssImports,
getMatchingPathData,
rootOutlet,
hwyDev,
ClientEntryScript,
getDefaultBodyProps,
renderRoot,
} from 'hwy'
app.all('*', async (c, next) => {
const activePathData = await getMatchingPathData({ c })
if (activePathData.fetchResponse) {
return activePathData.fetchResponse
}
if (!activePathData.matchingPaths?.length) {
return await next()
}
return c.html(
\`<!DOCTYPE html>\` +
(
return await renderRoot(c, next, async ({ activePathData }) => {
return (
<html lang="en">
<head>
<meta charSet="UTF-8" />
<meta name="viewport" content="width=device-width,initial-scale=1" />
<HeadElements
activePathData={activePathData}
c={c}
activePathData={activePathData}
defaults={defaultHeadBlocks}
/>
Expand All @@ -614,16 +602,16 @@ app.all('*', async (c, next) => {
<body {...getDefaultBodyProps()}>
{await rootOutlet({
activePathData,
c,
activePathData,
fallbackErrorBoundary: () => {
return <div>Something went wrong!</div>
},
})}
</body>
</html>
)
)
}
})
`}
/>
Expand Down

0 comments on commit 4d9e19e

Please sign in to comment.