From 3bac2b78c64d51461ef315b6b9db174ff1afae55 Mon Sep 17 00:00:00 2001 From: skyeto Date: Mon, 26 Jun 2023 19:46:30 +0200 Subject: [PATCH] Updated draft, added do not track component --- astro.config.mjs | 8 +- package-lock.json | 173 ++++++++++++++++++++++++++++++++++++++ package.json | 5 ++ public/robots.txt | 8 ++ src/components/DNT.jsx | 22 +++++ src/layouts/Layout.astro | 3 +- src/layouts/Post.astro | 9 ++ src/pages/p/nonbinary.mdx | 37 ++++++-- 8 files changed, 254 insertions(+), 11 deletions(-) create mode 100644 public/robots.txt create mode 100644 src/components/DNT.jsx diff --git a/astro.config.mjs b/astro.config.mjs index 1794ea6..bece1d2 100644 --- a/astro.config.mjs +++ b/astro.config.mjs @@ -1,6 +1,5 @@ import { defineConfig } from 'astro/config'; -// https://astro.build/config import tailwind from "@astrojs/tailwind"; // https://astro.build/config @@ -12,8 +11,11 @@ import prefetch from "@astrojs/prefetch"; // https://astro.build/config import compress from "astro-compress"; +// https://astro.build/config +import react from "@astrojs/react"; + // https://astro.build/config export default defineConfig({ site: "https://skyeto.com", - integrations: [tailwind(), mdx(), prefetch(), compress()] -}); + integrations: [tailwind(), mdx(), prefetch(), compress(), react()] +}); \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 69abe4a..bff7eef 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,11 +10,16 @@ "dependencies": { "@astrojs/mdx": "^0.11.5", "@astrojs/prefetch": "^0.1.1", + "@astrojs/react": "^2.2.1", "@astrojs/rss": "^1.2.1", "@astrojs/tailwind": "^3.0.0-beta.1", + "@types/react": "^18.2.14", + "@types/react-dom": "^18.2.6", "astro": "^2.1.7", "astro-compress": "^1.1.1", "postcss": "^8.4.21", + "react": "^18.2.0", + "react-dom": "^18.2.0", "tailwind": "^4.0.0", "tailwindcss": "^3.2.1", "three": "^0.151.3" @@ -138,6 +143,24 @@ "node": "^14.18.0 || >=16.12.0" } }, + "node_modules/@astrojs/react": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/@astrojs/react/-/react-2.2.1.tgz", + "integrity": "sha512-nq5Zr8iWdwjSp5fh1NReaCplwsnL4w5PXAY5XWu1jE/frxEfF/ycGHrrhwWW0uJHX9G+kUtmQLR0GBhlR4FmAw==", + "dependencies": { + "@babel/core": ">=7.0.0-0 <8.0.0", + "@babel/plugin-transform-react-jsx": "^7.17.12" + }, + "engines": { + "node": ">=16.12.0" + }, + "peerDependencies": { + "@types/react": "^17.0.50 || ^18.0.21", + "@types/react-dom": "^17.0.17 || ^18.0.6", + "react": "^17.0.2 || ^18.0.0", + "react-dom": "^17.0.2 || ^18.0.0" + } + }, "node_modules/@astrojs/rss": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/@astrojs/rss/-/rss-1.2.1.tgz", @@ -1250,11 +1273,39 @@ "resolved": "https://registry.npmjs.org/@types/parse5/-/parse5-6.0.3.tgz", "integrity": "sha512-SuT16Q1K51EAVPz1K29DJ/sXjhSQ0zjvsypYJ6tlwVsRV9jwW5Adq2ch8Dq8kDBCkYnELS7N7VNCSB5nC56t/g==" }, + "node_modules/@types/prop-types": { + "version": "15.7.5", + "resolved": "https://registry.npmjs.org/@types/prop-types/-/prop-types-15.7.5.tgz", + "integrity": "sha512-JCB8C6SnDoQf0cNycqd/35A7MjcnK+ZTqE7judS6o7utxUCg6imJg3QK2qzHKszlTjcj2cn+NwMB2i96ubpj7w==" + }, + "node_modules/@types/react": { + "version": "18.2.14", + "resolved": "https://registry.npmjs.org/@types/react/-/react-18.2.14.tgz", + "integrity": "sha512-A0zjq+QN/O0Kpe30hA1GidzyFjatVvrpIvWLxD+xv67Vt91TWWgco9IvrJBkeyHm1trGaFS/FSGqPlhyeZRm0g==", + "dependencies": { + "@types/prop-types": "*", + "@types/scheduler": "*", + "csstype": "^3.0.2" + } + }, + "node_modules/@types/react-dom": { + "version": "18.2.6", + "resolved": "https://registry.npmjs.org/@types/react-dom/-/react-dom-18.2.6.tgz", + "integrity": "sha512-2et4PDvg6PVCyS7fuTc4gPoksV58bW0RwSxWKcPRcHZf0PRUGq03TKcD/rUHe3azfV6/5/biUBJw+HhCQjaP0A==", + "dependencies": { + "@types/react": "*" + } + }, "node_modules/@types/resolve": { "version": "1.20.2", "resolved": "https://registry.npmjs.org/@types/resolve/-/resolve-1.20.2.tgz", "integrity": "sha512-60BCwRFOZCQhDncwQdxxeOEEkbc5dIMccYLwbxsS4TUNeVECQ/pBJ0j09mrHOl/JJvpRPGwO9SvE4nR2Nb/a4Q==" }, + "node_modules/@types/scheduler": { + "version": "0.16.3", + "resolved": "https://registry.npmjs.org/@types/scheduler/-/scheduler-0.16.3.tgz", + "integrity": "sha512-5cJ8CB4yAx7BH1oMvdU0Jh9lrEXyPkar6F9G/ERswkCuvP4KQZfZkSjcMbAICCpQTN4OuZn8tz0HiKv9TGZgrQ==" + }, "node_modules/@types/unist": { "version": "2.0.6", "resolved": "https://registry.npmjs.org/@types/unist/-/unist-2.0.6.tgz", @@ -2555,6 +2606,11 @@ "npm": ">=7.0.0" } }, + "node_modules/csstype": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.1.2.tgz", + "integrity": "sha512-I7K1Uu0MBPzaFKg4nI5Q7Vs2t+3gWWW648spaF+Rg7pI9ds18Ugn+lvg4SHczUdKlHI5LWBXyqfS8+DufyBsgQ==" + }, "node_modules/datasette": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/datasette/-/datasette-1.0.1.tgz", @@ -4738,6 +4794,17 @@ "url": "https://github.com/sponsors/wooorm" } }, + "node_modules/loose-envify": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz", + "integrity": "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==", + "dependencies": { + "js-tokens": "^3.0.0 || ^4.0.0" + }, + "bin": { + "loose-envify": "cli.js" + } + }, "node_modules/lower-case": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/lower-case/-/lower-case-2.0.2.tgz", @@ -6790,6 +6857,29 @@ "rc": "cli.js" } }, + "node_modules/react": { + "version": "18.2.0", + "resolved": "https://registry.npmjs.org/react/-/react-18.2.0.tgz", + "integrity": "sha512-/3IjMdb2L9QbBdWiW5e3P2/npwMBaU9mHCSCUzNln0ZCYbcfTsGbTJrU/kGemdH2IWmB2ioZ+zkxtmq6g09fGQ==", + "dependencies": { + "loose-envify": "^1.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/react-dom": { + "version": "18.2.0", + "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-18.2.0.tgz", + "integrity": "sha512-6IMTriUmvsjHUjNtEDudZfuDQUoWXVxKHhlEGSk81n4YFS+r/Kl99wXiwlVXtPBtJenozv2P+hxDsw9eA7Xo6g==", + "dependencies": { + "loose-envify": "^1.1.0", + "scheduler": "^0.23.0" + }, + "peerDependencies": { + "react": "^18.2.0" + } + }, "node_modules/read-cache": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/read-cache/-/read-cache-1.0.0.tgz", @@ -7253,6 +7343,14 @@ "suf-log": "^2.5.3" } }, + "node_modules/scheduler": { + "version": "0.23.0", + "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.23.0.tgz", + "integrity": "sha512-CtuThmgHNg7zIZWAXi3AsyIzA3n4xx7aNyjwC2VJldO2LMVDhFK+63xGqq6CsJH4rTAt6/M+N4GhZiDYPx9eUw==", + "dependencies": { + "loose-envify": "^1.1.0" + } + }, "node_modules/section-matter": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/section-matter/-/section-matter-1.0.0.tgz", @@ -8939,6 +9037,15 @@ "prismjs": "^1.28.0" } }, + "@astrojs/react": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/@astrojs/react/-/react-2.2.1.tgz", + "integrity": "sha512-nq5Zr8iWdwjSp5fh1NReaCplwsnL4w5PXAY5XWu1jE/frxEfF/ycGHrrhwWW0uJHX9G+kUtmQLR0GBhlR4FmAw==", + "requires": { + "@babel/core": ">=7.0.0-0 <8.0.0", + "@babel/plugin-transform-react-jsx": "^7.17.12" + } + }, "@astrojs/rss": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/@astrojs/rss/-/rss-1.2.1.tgz", @@ -9691,11 +9798,39 @@ "resolved": "https://registry.npmjs.org/@types/parse5/-/parse5-6.0.3.tgz", "integrity": "sha512-SuT16Q1K51EAVPz1K29DJ/sXjhSQ0zjvsypYJ6tlwVsRV9jwW5Adq2ch8Dq8kDBCkYnELS7N7VNCSB5nC56t/g==" }, + "@types/prop-types": { + "version": "15.7.5", + "resolved": "https://registry.npmjs.org/@types/prop-types/-/prop-types-15.7.5.tgz", + "integrity": "sha512-JCB8C6SnDoQf0cNycqd/35A7MjcnK+ZTqE7judS6o7utxUCg6imJg3QK2qzHKszlTjcj2cn+NwMB2i96ubpj7w==" + }, + "@types/react": { + "version": "18.2.14", + "resolved": "https://registry.npmjs.org/@types/react/-/react-18.2.14.tgz", + "integrity": "sha512-A0zjq+QN/O0Kpe30hA1GidzyFjatVvrpIvWLxD+xv67Vt91TWWgco9IvrJBkeyHm1trGaFS/FSGqPlhyeZRm0g==", + "requires": { + "@types/prop-types": "*", + "@types/scheduler": "*", + "csstype": "^3.0.2" + } + }, + "@types/react-dom": { + "version": "18.2.6", + "resolved": "https://registry.npmjs.org/@types/react-dom/-/react-dom-18.2.6.tgz", + "integrity": "sha512-2et4PDvg6PVCyS7fuTc4gPoksV58bW0RwSxWKcPRcHZf0PRUGq03TKcD/rUHe3azfV6/5/biUBJw+HhCQjaP0A==", + "requires": { + "@types/react": "*" + } + }, "@types/resolve": { "version": "1.20.2", "resolved": "https://registry.npmjs.org/@types/resolve/-/resolve-1.20.2.tgz", "integrity": "sha512-60BCwRFOZCQhDncwQdxxeOEEkbc5dIMccYLwbxsS4TUNeVECQ/pBJ0j09mrHOl/JJvpRPGwO9SvE4nR2Nb/a4Q==" }, + "@types/scheduler": { + "version": "0.16.3", + "resolved": "https://registry.npmjs.org/@types/scheduler/-/scheduler-0.16.3.tgz", + "integrity": "sha512-5cJ8CB4yAx7BH1oMvdU0Jh9lrEXyPkar6F9G/ERswkCuvP4KQZfZkSjcMbAICCpQTN4OuZn8tz0HiKv9TGZgrQ==" + }, "@types/unist": { "version": "2.0.6", "resolved": "https://registry.npmjs.org/@types/unist/-/unist-2.0.6.tgz", @@ -10668,6 +10803,11 @@ "css-tree": "~2.2.0" } }, + "csstype": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.1.2.tgz", + "integrity": "sha512-I7K1Uu0MBPzaFKg4nI5Q7Vs2t+3gWWW648spaF+Rg7pI9ds18Ugn+lvg4SHczUdKlHI5LWBXyqfS8+DufyBsgQ==" + }, "datasette": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/datasette/-/datasette-1.0.1.tgz", @@ -12250,6 +12390,14 @@ "resolved": "https://registry.npmjs.org/longest-streak/-/longest-streak-3.0.1.tgz", "integrity": "sha512-cHlYSUpL2s7Fb3394mYxwTYj8niTaNHUCLr0qdiCXQfSjfuA7CKofpX2uSwEfFDQ0EB7JcnMnm+GjbqqoinYYg==" }, + "loose-envify": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz", + "integrity": "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==", + "requires": { + "js-tokens": "^3.0.0 || ^4.0.0" + } + }, "lower-case": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/lower-case/-/lower-case-2.0.2.tgz", @@ -13602,6 +13750,23 @@ "strip-json-comments": "~2.0.1" } }, + "react": { + "version": "18.2.0", + "resolved": "https://registry.npmjs.org/react/-/react-18.2.0.tgz", + "integrity": "sha512-/3IjMdb2L9QbBdWiW5e3P2/npwMBaU9mHCSCUzNln0ZCYbcfTsGbTJrU/kGemdH2IWmB2ioZ+zkxtmq6g09fGQ==", + "requires": { + "loose-envify": "^1.1.0" + } + }, + "react-dom": { + "version": "18.2.0", + "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-18.2.0.tgz", + "integrity": "sha512-6IMTriUmvsjHUjNtEDudZfuDQUoWXVxKHhlEGSk81n4YFS+r/Kl99wXiwlVXtPBtJenozv2P+hxDsw9eA7Xo6g==", + "requires": { + "loose-envify": "^1.1.0", + "scheduler": "^0.23.0" + } + }, "read-cache": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/read-cache/-/read-cache-1.0.0.tgz", @@ -13923,6 +14088,14 @@ "suf-log": "^2.5.3" } }, + "scheduler": { + "version": "0.23.0", + "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.23.0.tgz", + "integrity": "sha512-CtuThmgHNg7zIZWAXi3AsyIzA3n4xx7aNyjwC2VJldO2LMVDhFK+63xGqq6CsJH4rTAt6/M+N4GhZiDYPx9eUw==", + "requires": { + "loose-envify": "^1.1.0" + } + }, "section-matter": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/section-matter/-/section-matter-1.0.0.tgz", diff --git a/package.json b/package.json index 1667412..da9bafc 100644 --- a/package.json +++ b/package.json @@ -13,11 +13,16 @@ "dependencies": { "@astrojs/mdx": "^0.11.5", "@astrojs/prefetch": "^0.1.1", + "@astrojs/react": "^2.2.1", "@astrojs/rss": "^1.2.1", "@astrojs/tailwind": "^3.0.0-beta.1", + "@types/react": "^18.2.14", + "@types/react-dom": "^18.2.6", "astro": "^2.1.7", "astro-compress": "^1.1.1", "postcss": "^8.4.21", + "react": "^18.2.0", + "react-dom": "^18.2.0", "tailwind": "^4.0.0", "tailwindcss": "^3.2.1", "three": "^0.151.3" diff --git a/public/robots.txt b/public/robots.txt new file mode 100644 index 0000000..6575ca9 --- /dev/null +++ b/public/robots.txt @@ -0,0 +1,8 @@ +User-agent: ChatGPT-User +Disallow: / + +User-agent: ChatGPT +Disallow: / + +User-agent: OpenAI +Disallow: / diff --git a/src/components/DNT.jsx b/src/components/DNT.jsx new file mode 100644 index 0000000..291aa3e --- /dev/null +++ b/src/components/DNT.jsx @@ -0,0 +1,22 @@ +import { useState } from 'react'; + +export default function DND(props) { + const [consent, setConsent] = useState(false); + + if(navigator && navigator.doNotTrack == "1" && !consent) { + return ( +
+ You have do not track enabled. Do you still want to show the remote content{props.source && from {props.source}}? +
+ ) + } + + return ( +
{props.children}
+ ) +} diff --git a/src/layouts/Layout.astro b/src/layouts/Layout.astro index 7b82eab..909a6d3 100644 --- a/src/layouts/Layout.astro +++ b/src/layouts/Layout.astro @@ -48,8 +48,7 @@ const { title, description, pubDate } = Astro.props;
- © 2023 skyeto;
- Content is not licensed for use in AI models nor for training AI models. Copying for non-commercial purposes as long as you give attribution is totally okay! + © 2023 skyeto; Licensed under CC-BY-SA 4.0