Skip to content

Commit

Permalink
feat: add analytics component
Browse files Browse the repository at this point in the history
  • Loading branch information
trongtai37 committed Jul 12, 2023
1 parent 165eba9 commit 93e1742
Show file tree
Hide file tree
Showing 3 changed files with 80 additions and 21 deletions.
1 change: 1 addition & 0 deletions apps/docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
},
"homepage": "https://github.com/trongtai37/sudogame#readme",
"dependencies": {
"@vercel/analytics": "^1.0.1",
"next": "^13.0.6",
"nextra": "latest",
"nextra-theme-docs": "latest",
Expand Down
27 changes: 26 additions & 1 deletion apps/docs/theme.config.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,37 @@
import React from 'react';
import { DocsThemeConfig } from 'nextra-theme-docs';
import { Analytics } from '@vercel/analytics/react';
import { useRouter } from 'next/router';

const config: DocsThemeConfig = {
logo: <span>SUDOgame</span>,
logo: (
<span
style={{
fontWeight: 500,
}}
>
SUDO | game
</span>
),
project: {
link: 'https://github.com/trongtai37/sudogame',
},
docsRepositoryBase: 'https://github.com/shuding/nextra-docs-template',
useNextSeoProps() {
const { asPath } = useRouter();
if (asPath !== '/') {
return {
titleTemplate: '%s - Sudogame',
};
}
return {
titleTemplate:
'Sudogame - A new fast, light and comprehensive Sudoku library, powered by SAT encoding!',
};
},
footer: {
component: <Analytics />,
},
};

export default config;
73 changes: 53 additions & 20 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 93e1742

Please sign in to comment.