Skip to content

Commit

Permalink
Remove cookie-consent and analytics. (#494)
Browse files Browse the repository at this point in the history
  • Loading branch information
floitsch authored Jul 26, 2024
1 parent dfa5b4f commit 0c566ab
Show file tree
Hide file tree
Showing 5 changed files with 0 additions and 51 deletions.
13 changes: 0 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,6 @@ Note! You don't need to setup your `PATH` env.var. as described in the guide.

If you haven't installed `node` yet, install `node` from [nodejs.org](https://nodejs.org/en/). Add the node bin directory to your `PATH` in `$HOME/.profile`

**⚠️ In order to be able to install packages from this repository on your machine,
you need to [authenticate with the GitHub
registry](https://docs.github.com/en/packages/guides/configuring-npm-for-use-with-github-packages#authenticating-to-github-packages).**

Here's a short summary of what you need to do:

1. [Create a personal access token](https://github.com/settings/tokens/new)
1. Name it appropriately (I suggest something like: `<your machine name> GitHub npm registry`)
2. Check `write:packages` and `read:packages`
2. Copy the token
3. Add the token to your `~/.npmrc`:
`echo "//npm.pkg.github.com/:_authToken=YOUR_TOKEN" >> ~/.npmrc`

## Linting and imports in VS Code

- Add the ESLint extension to VS Code to get linting directly in the code. https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint.
Expand Down
10 changes: 0 additions & 10 deletions gatsby-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,16 +84,6 @@ export const plugins = [
],
},
},
{
resolve: "gatsby-plugin-segment-js",
options: {
// The keys must be defined otherwise the plugin will no load analytics.js
prodKey: "XXXXXXXXXXXXXXXXX",
devKey: "XXXXXXXXXXXXXXXXX",
manualLoad: true,
trackPage: true,
},
},
{
resolve: `gatsby-transformer-remark`,
options: {
Expand Down
2 changes: 0 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
"@raae/gatsby-remark-oembed": "^0.1.1",
"@svgr/webpack": "^5.5.0",
"@toitware/code-block": "^0.4.2",
"@toitware/cookie-consent": "^0.2.0",
"@types/color": "^3.0.1",
"@types/flexsearch": "^0.7.2",
"@types/mdx-js__react": "^1.5.3",
Expand All @@ -47,7 +46,6 @@
"@types/react": "^17.0.3",
"@types/react-dom": "^17.0.2",
"@types/react-helmet": "^6.1.0",
"@types/segment-analytics": "^0.0.33",
"clsx": "^1.1.1",
"color": "^3.1.3",
"flexsearch": "^0.7.21",
Expand Down
11 changes: 0 additions & 11 deletions src/layouts/index.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { styled, useTheme } from "@mui/material/styles";
import { GlobalStyles } from "@mui/material";
import { ThemeProvider } from "@mui/material/styles";
import CookieConsent from "@toitware/cookie-consent";
import Color from "color";
import * as React from "react";
import { ReactNode } from "react";
Expand Down Expand Up @@ -41,19 +40,9 @@ export function Layout(props: LayoutProps): JSX.Element {
const title = "Toit documentation";

const dark = useDarkMode();
let segmentAPIKey = process.env.GATSBY_SEGMENT_WRITE_KEY;

if (typeof document !== `undefined`) {
// Check if the meta segment-key is set.
const segmentKeyDOM = document.querySelector('meta[name="segment-key"]');
if (segmentKeyDOM) {
segmentAPIKey = segmentKeyDOM.getAttribute("content") || segmentAPIKey;
}
}

return (
<ThemeProvider theme={dark ? darkTheme : lightTheme}>
<CookieConsent show={true} segmentKey={segmentAPIKey || "no-key"} changeConsent={false} />
<Helmet title={title}></Helmet>
<Root>{children}</Root>
</ThemeProvider>
Expand Down
15 changes: 0 additions & 15 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2018,13 +2018,6 @@
codemirror-theme-vars "^0.1.1"
use-codemirror "^0.2.0"

"@toitware/cookie-consent@^0.2.0":
version "0.2.0"
resolved "https://npm.pkg.github.com/download/@toitware/cookie-consent/0.2.0/f342610047d87b7bec50f18e7d24c6610e3daf23fb37737d993f60c27f24c60c"
dependencies:
js-cookie "^2.2.1"
react-icons "^4.2.0"

"@tokenizer/token@^0.3.0":
version "0.3.0"
resolved "https://registry.npmjs.org/@tokenizer/token/-/token-0.3.0.tgz"
Expand Down Expand Up @@ -2416,10 +2409,6 @@
version "0.16.2"
resolved "https://registry.npmjs.org/@types/scheduler/-/scheduler-0.16.2.tgz"

"@types/segment-analytics@^0.0.33":
version "0.0.33"
resolved "https://registry.npmjs.org/@types/segment-analytics/-/segment-analytics-0.0.33.tgz"

"@types/stack-utils@^2.0.0":
version "2.0.1"
resolved "https://registry.npmjs.org/@types/stack-utils/-/stack-utils-2.0.1.tgz"
Expand Down Expand Up @@ -7878,10 +7867,6 @@ joi@^17.2.1, joi@^17.4.0, joi@^17.4.2:
"@sideway/formula" "^3.0.0"
"@sideway/pinpoint" "^2.0.0"

js-cookie@^2.2.1:
version "2.2.1"
resolved "https://registry.npmjs.org/js-cookie/-/js-cookie-2.2.1.tgz"

"js-tokens@^3.0.0 || ^4.0.0", js-tokens@^4.0.0:
version "4.0.0"
resolved "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz"
Expand Down

0 comments on commit 0c566ab

Please sign in to comment.