From 48620b696190abc84f76d68393886ccfa47cd5fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=A0t=C4=9Bp=C3=A1n=20=C5=A0korpil?= Date: Tue, 22 Nov 2022 18:38:37 +0100 Subject: [PATCH] Added optout page --- application/src/components/Footer.tsx | 3 +- application/src/pages/optout.tsx | 58 +++++++++++++++++++++++++++ 2 files changed, 60 insertions(+), 1 deletion(-) create mode 100644 application/src/pages/optout.tsx diff --git a/application/src/components/Footer.tsx b/application/src/components/Footer.tsx index 682e489..af68eca 100644 --- a/application/src/components/Footer.tsx +++ b/application/src/components/Footer.tsx @@ -3,7 +3,8 @@ import React from 'react' const Footer: React.FC = () => { return ( ) } diff --git a/application/src/pages/optout.tsx b/application/src/pages/optout.tsx new file mode 100644 index 0000000..c3b637f --- /dev/null +++ b/application/src/pages/optout.tsx @@ -0,0 +1,58 @@ +import Head from 'next/head' +import Layout, { siteTitle } from '../components/Layout' +import { matomoConfig } from '../lib/matomoConfig' +import { GetServerSideProps, InferGetServerSidePropsType } from 'next' +import React, { useEffect } from 'react' +import getMatomo from '../lib/getMatomo' + +const OptOut: React.FC> = ({ matomoConfig }) => { + useEffect(() => { + getMatomo(matomoConfig).trackEvent({ + category: 'optout', + action: 'view' + }) + }, []) + + return ( + + + {'Opt out | ' + siteTitle} + +

Opt out

+

You don't want to be listed here? There are several ways to opt-out from our index:

+
    +
  • + On Mastodon you can set noindex option in your profile. + Head to PreferencesOther and check the option labeled as Opt-out of search engine indexing +
  • +
  • + On Mastodon you can remove yourself from data offered by your instance's API. + Head to PreferencesPreferences and uncheck the option labeled as Suggest account to others +
  • +
  • + You can add #noindex tag to your profile description +
  • + +
  • + If you are a server maintainer, you can disable crawling of your instance using robots.txt. + Just expose a textfile on your instance's domain, on path https://<your instace's domain>/robots.txt

    +
    
    +                        User-agent: FediCrawl/1.0
    + Disallow: / +
    +
  • +
+
+ ) +} + +export const getServerSideProps: GetServerSideProps = async () => { + console.info('Loading matomo config', matomoConfig) + return { + props: { + matomoConfig + } + } +} + +export default OptOut