diff --git a/package-lock.json b/package-lock.json index 92e22eb03..fb8f23c7c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -25,6 +25,7 @@ "mdast-util-find-and-replace": "^2.2.2", "mdast-util-to-string": "^3.2.0", "micromorph": "^0.4.5", + "plausible-tracker": "^0.3.8", "preact": "^10.14.1", "preact-render-to-string": "^6.0.3", "pretty-time": "^1.1.0", @@ -3619,6 +3620,14 @@ "url": "https://github.com/sponsors/jonschlinkert" } }, + "node_modules/plausible-tracker": { + "version": "0.3.8", + "resolved": "https://registry.npmjs.org/plausible-tracker/-/plausible-tracker-0.3.8.tgz", + "integrity": "sha512-lmOWYQ7s9KOUJ1R+YTOR3HrjdbxIS2Z4de0P/Jx2dQPteznJl2eX3tXxKClpvbfyGP59B5bbhW8ftN59HbbFSg==", + "engines": { + "node": ">=10" + } + }, "node_modules/preact": { "version": "10.15.1", "resolved": "https://registry.npmjs.org/preact/-/preact-10.15.1.tgz", diff --git a/package.json b/package.json index 614bb7617..689548d81 100644 --- a/package.json +++ b/package.json @@ -41,6 +41,7 @@ "mdast-util-find-and-replace": "^2.2.2", "mdast-util-to-string": "^3.2.0", "micromorph": "^0.4.5", + "plausible-tracker": "^0.3.8", "preact": "^10.14.1", "preact-render-to-string": "^6.0.3", "pretty-time": "^1.1.0", diff --git a/quartz.config.ts b/quartz.config.ts index 58c1d9cd9..18f2533e8 100644 --- a/quartz.config.ts +++ b/quartz.config.ts @@ -23,8 +23,8 @@ const contentPageLayout: PageLayout = { left: [ Component.PageTitle(), Component.Search(), - Component.TableOfContents(), - Component.Darkmode() + Component.Darkmode(), + Component.DesktopOnly(Component.TableOfContents()), ], right: [ Component.Graph(), diff --git a/quartz/components/DesktopOnly.tsx b/quartz/components/DesktopOnly.tsx new file mode 100644 index 000000000..a1c5dae96 --- /dev/null +++ b/quartz/components/DesktopOnly.tsx @@ -0,0 +1,20 @@ +import { QuartzComponent, QuartzComponentConstructor, QuartzComponentProps } from "./types" + +export default ((component?: QuartzComponent) => { + if (component) { + const Component = component + function DesktopOnly(props: QuartzComponentProps) { + return
{words} words, {timeTaken}
} else { diff --git a/quartz/components/TableOfContents.tsx b/quartz/components/TableOfContents.tsx index f3d90bb1b..a9d7b783f 100644 --- a/quartz/components/TableOfContents.tsx +++ b/quartz/components/TableOfContents.tsx @@ -18,7 +18,7 @@ function TableOfContents({ fileData }: QuartzComponentProps) { return null } - return