Skip to content

Commit

Permalink
website: Add vercel analytics (#793)
Browse files Browse the repository at this point in the history
Using the steps here for the static output worked out

https://docs.astro.build/en/guides/integrations-guide/vercel/#choosing-a-target

---

~I think this should work, but I can't run the site locally because of
an error I don't understand.~


![image](https://github.com/muxinc/media-chrome/assets/166/e637d221-0e9e-4e65-bed8-9ab273b35eda)

---------

Co-authored-by: Wesley Luyten <me@wesleyluyten.com>
  • Loading branch information
heff and luwes committed Feb 1, 2024
1 parent 3d04512 commit 3e7b0e1
Show file tree
Hide file tree
Showing 4 changed files with 481 additions and 25 deletions.
16 changes: 12 additions & 4 deletions docs/astro.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ import remarkGfm from 'remark-gfm';
import remarkSmartypants from 'remark-smartypants';
import rehypeAutolinkHeadings from 'rehype-autolink-headings';
import rehypeSlug from 'rehype-slug';
import markdownIntegration from '@astropub/md'
import markdownIntegration from '@astropub/md';
import vercel from '@astrojs/vercel/static';

const AnchorLinkIcon = h(
'svg',
Expand All @@ -37,9 +38,11 @@ const createSROnlyLabel = (text) => {

// https://astro.build/config
export default defineConfig({
output: 'static',
site: `https://www.media-chrome.org/`,
redirects: {
'/showcase/submit': 'https://github.com/muxinc/media-chrome/discussions/760'
'/showcase/submit':
'https://github.com/muxinc/media-chrome/discussions/760',
},
integrations: [
// Enable Preact to support Preact JSX components.
Expand All @@ -48,7 +51,7 @@ export default defineConfig({
'./src/components/Header/SidebarToggle.tsx',
'./src/components/Header/ThemeToggleButton.tsx',
'./src/components/RightSidebar/TableOfContents.tsx',
]
],
}),
// Enable React for the Algolia search component.
react({
Expand All @@ -57,7 +60,7 @@ export default defineConfig({
'./src/components/Header/SidebarToggle.tsx',
'./src/components/Header/ThemeToggleButton.tsx',
'./src/components/RightSidebar/TableOfContents.tsx',
]
],
}),
tailwind({
// Example: Disable injecting a basic `base.css` import on every page.
Expand Down Expand Up @@ -105,4 +108,9 @@ export default defineConfig({
],
],
},
adapter: vercel({
webAnalytics: {
enabled: true,
},
}),
});
1 change: 1 addition & 0 deletions docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
"@astrojs/preact": "^3.0.1",
"@astrojs/react": "^3.0.4",
"@astrojs/tailwind": "^5.0.2",
"@astrojs/vercel": "^7.0.2",
"@astropub/md": "^0.3.0",
"@codesandbox/sandpack-react": "^2.9.0",
"@codesandbox/sandpack-themes": "^2.0.21",
Expand Down
6 changes: 1 addition & 5 deletions docs/src/layouts/LandingLayout.astro
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,7 @@ import type { MarkdownHeading } from 'astro';
const canonicalURL = `${new URL(Astro.url.pathname, Astro.site)}`.replace(/\/$/, '');
---

<html
dir={'ltr'}
lang={'en-us'}
class="initial"
>
<html dir={'ltr'} lang={'en-us'} class="initial">
<head>
<HeadCommon />
<HeadSEO frontmatter={{}} canonicalUrl={canonicalURL} />
Expand Down
Loading

0 comments on commit 3e7b0e1

Please sign in to comment.